[codex] Add connector package prototype#3436
Draft
dannyzhang-oai wants to merge 5 commits into
Draft
Conversation
eb6aa95 to
67694d2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an initial Agents SDK connector package prototype that composes existing SDK primitives instead of introducing a separate runtime.
Connector,ConnectorComponents,ConnectorPlugin,ConnectorRegistry, connector policy labels, andHostedConnectorAuthorization.Agent(connectors=[...])to include connector-provided direct tools and MCP servers in the existing tool resolution path..codex-plugin/plugin.json,.mcp.json, and optional.app.jsonhosted connector IDs.ConnectorRegistry.from_plugin_records(...)andConnector.from_installed_plugin(...)as a narrow adapter for already-fetched Unified Plugins-style records.package_root, auth aliases/refs, app-level server labels, allowed tools, approval/deferred-loading options, and policy label metadata.examples/connectors/package_demo.pyto verify the registry path end to end without an API key, including auth alias resolution, mounted package paths, policy labels, and hosted tool options.Agent(...)constructor compatibility by appending the newconnectorsfield.Test plan
uv run --frozen pytest tests/test_connectors.py tests/test_connector_demo.py tests/test_source_compat_constructors.py::test_agent_connectors_append_preserves_reset_tool_choice_position -quv run --frozen python examples/connectors/package_demo.py --verifyuv run --frozen ruff format --check src/agents/connectors.py src/agents/agent.py src/agents/__init__.py examples/connectors/package_demo.py tests/test_connectors.py tests/test_connector_demo.py tests/test_source_compat_constructors.pyuv run --frozen ruff check src/agents/connectors.py src/agents/agent.py src/agents/__init__.py examples/connectors/package_demo.py tests/test_connectors.py tests/test_connector_demo.py tests/test_source_compat_constructors.pyuv run --frozen mypy src/agents/connectors.py src/agents/agent.py tests/test_connectors.py tests/test_connector_demo.py tests/test_source_compat_constructors.pyuv run --frozen pyright src/agents/connectors.py src/agents/agent.py tests/test_connectors.py tests/test_connector_demo.py tests/test_source_compat_constructors.pyuv run --frozen mkdocs buildmkdocs buildstill emits the repo's existing localized-doc/autoref warnings, but exits 0. Fullmake tests,make lint, andmake formatwere not run; this is focused prototype validation.Issue number
N/A
Checks
make lintandmake format