feat(sandbox): openai model provider authenticates via ChatGPT OAuth (requires_openai_auth)#112
Open
dinghengda-creator wants to merge 1 commit into
Conversation
--model-provider openai now emits requires_openai_auth = true (and no env_key) so codex authenticates that provider with the injected ChatGPT oauth token instead of an api key. --model-name and --model-base-url pass through; the model and base_url default to codex's ChatGPT endpoint. Ark providers (model_square / coding_plan / agent_plan) are unchanged.
b946538 to
a786318
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.
Reuses the existing --model-provider / --model-name / --model-base-url path.
When --model-provider is openai, build_codex_config_toml emits requires_openai_auth = true and no env_key, so codex authenticates that provider with the chatgpt oauth token from
agentkit sandbox codex-login. --model-name and --model-base-url pass through (base-url can point at a proxy); they default to codex's ChatGPT endpoint and gpt-5-codex. Ark providers (model_square / coding_plan / agent_plan) keep env_key = CODEX_API_KEY.requires_openai_auth is a ModelProviderInfo field in codex 0.135.
Tests cover the openai case and that Ark providers are unchanged. ruff/mypy pass.
Note: takes effect when the tool is created with --model-provider openai. Serving a turn from a China-region sandbox additionally needs egress to OpenAI via a supported region (codex has CODEX_REFRESH_TOKEN_URL_OVERRIDE for the token refresh).