Repository navigation
feat(codex): accept a host-supplied model provider endpoint - #1231
Closed
wujiaming-ai wants to merge 1 commit into
Closed
wujiaming-ai wants to merge 1 commit into
wujiaming-ai wants to merge 1 commit into
Conversation
A host that fronts the model API (for example a per-invocation proxy that owns tool policy) needs Codex to send Responses API traffic to that proxy instead of the configured model API base, and needs its own tool executors wrapped before they are published over the MCP bridge. Add an optional ``provider_factory`` to ``CodexRuntimeConfig``. It returns an async context manager that yields a ``CodexProviderEndpoint`` -- base URL, per-invocation token, an ``handles_extra_body`` declaration and an optional ``wrap_tool_executor`` hook. The endpoint replaces the model API base for the direct transport, is entered before the Codex home is written and closed after Codex has stopped issuing requests, and every ADK tool executor is wrapped before the bridge sees it. The endpoint is validated (http(s), https off loopback, no credentials in the URL, no control characters in the key) and its token never appears in ``repr``. ``shell_enabled=False`` now requires a provider factory because only the provider can reject Codex's native shell tool calls; the endpoint also cannot be combined with the shim transport.
wujiaming-ai
deleted the
feat/codex-provider-api-for-superagent-20261119
branch
November 20, 2026 09:21
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.
A host that fronts the model API (for example a per-invocation proxy that owns tool policy) needs Codex to send Responses API traffic to that proxy instead of the configured model API base, and needs its own tool executors wrapped before they are published over the MCP bridge.
Add an optional
provider_factorytoCodexRuntimeConfig. It returns an async context manager that yields aCodexProviderEndpoint-- base URL, per-invocation token, anhandles_extra_bodydeclaration and an optionalwrap_tool_executorhook. The endpoint replaces the model API base for the direct transport, is entered before the Codex home is written and closed after Codex has stopped issuing requests, and every ADK tool executor is wrapped before the bridge sees it.The endpoint is validated (http(s), https off loopback, no credentials in the URL, no control characters in the key) and its token never appears in
repr.shell_enabled=Falsenow requires a provider factory because only the provider can reject Codex's native shell tool calls; the endpoint also cannot be combined with the shim transport.