Add Codex (ChatGPT subscription) provider with global login, per-role models, fallback, and docs#1022
Open
vivenstrix wants to merge 1 commit intoagent0ai:mainfrom
Open
Conversation
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.
This PR adds a new
codexmodel provider to Agent Zero that uses local Codex CLI auth (ChatGPT subscription), not OpenAI API billing. It supports Chat/Utility/Browser roles, preserves per-role model selection, resumes Codex sessions per chat+role, and falls back per-call to the previous non-Codex provider on failures.Global login works from Settings → Agent Settings → ChatGPT Subscription.
Chat/Utility/Browser can each use Codex (ChatGPT subscription).
Role model values persist independently after save/reopen.
Backend settings reflect role-specific model values.
Codex failure triggers temporary per-call fallback and warning, without changing saved provider.
Notes
Requires codex CLI installed and available in PATH.
Requires successful codex login.
Why
This will allow ChatGPT subscribers to use their subscription an NOT API usage:
What Changed
Provider + Runtime
codexto model providers.codex_statuscodex_modelscodex_loginCodex Execution Helper
python/helpers/codex_exec.py:codex exec --jsonModel Layer / Agent Integration
models.py.AgentContext.data["codex_threads"].agent.pyfor Chat/Utility/Browser calls.Settings + Fallback Snapshots
*_prev).UI
codexBanners
codexfrom missing API key banner.Docs
docs/guides/codex-subscription.mdREADME.mddocs/README.mddocs/setup/installation.mddocs/guides/troubleshooting.mddocs/res/setup/codex/.Tests
Added:
tests/test_codex_exec_helper.pytests/test_codex_provider_fallback.pytests/test_settings_codex_prev_snapshot.pytests/test_codex_chat_normalization.pyExecuted: