Check saved Codex credentials locally when selecting the model proxy key. Keep usage requests on the account status path and refresh credentials when the proxy needs them.
Add a regression test that checks model key selection with and without saved credentials and fails if the lookup fetches usage or refreshes tokens.
Replace loopback trust with an internal process credential supplied automatically to local account-model calls. Keep configured external proxy tokens and deny tokenless requests from every source address.
Finalize local proxy credentials after model defaults are merged so legacy stored keys, inline keys, additional parameters and auth headers work without changing saved settings or account connections. Limit replacement to this process's loopback WebUI port and provider proxy path, preserving explicit credentials for other endpoints.
Keep the internal credential in the stable framework runtime module so plugin reloads do not invalidate existing model clients. No saved credential or configuration migration is required.
Isolate proxy tests from saved accounts and plugin toggles. Cover all account providers, disconnected state, custom ports, external endpoint credentials, public hostnames, forwarded headers, OAuth callback accessibility and real SDK HTTP streaming. Document the intentional requirement for external clients that previously relied on tokenless loopback trust.
Validation: 643 focused framework tests passed with 3 expected failures for two pre-existing backup/A2A issues, plus 52 isolated host checks and the OAuth UI regression. A live Codex Responses call using the existing account after plugin reload returned OK; saved credentials and configuration remained byte-for-byte unchanged.
Translate reported Responses token counts and details into Chat usage fields.
Honor include_usage with a terminal empty-choices chunk, and request it by
default for Codex main-model Chat calls while preserving explicit options.
Forward failures, retain incomplete finish reasons, reject premature stream
termination and close the upstream stream on completion or cancellation.
Keep Responses requests and proxy access controls unchanged.
Verified 211 broader tests plus 17 final focused Chat checks. A Docker framework
bridge probe preserved captured Codex usage exactly through Context window
accounting; the restarted runtime is healthy. No preset was changed to test
the Codex Chat compatibility endpoint.
Keep session and thread IDs stable per chat and agent, preserve caller metadata through both proxy routes, and derive bounded default cache keys from caller-supplied sessions without replacing explicit keys.
Default Codex to local Responses state to avoid the rejected store=true probe while retaining native tool calls.
Validation: 274 focused tests passed in a clean checkout. Live WebUI checks showed 64-65% completed-turn cache hits and four successful upstream requests for two terminal-and-response turns.
Remove the static OAuth API-key placeholder from provider defaults and gate the runtime dummy key on provider connection status.
This keeps unconnected OAuth providers blank in API-key surfaces while preserving the local proxy shim for connected account-backed providers. Update OAuth docs and regressions for the new contract.
Create a generic OAuth Connections plugin with Codex/ChatGPT Account as the first provider, using OpenAI's device-code flow to persist Codex-compatible account tokens.
Expose a loopback OpenAI-compatible wrapper for models, responses, and chat completions, and point LiteLLM at the container-local Agent Zero origin.
Add a dummy API-key extension and focused tests so the account-backed provider appears configured without requiring a user-entered key.
docs: add Codex plan OAuth callout
Highlight that Agent Zero can use an existing OpenAI Codex plan through the new OAuth flow.
Add the account-backed LLM plans image and surface the section from the README navigation, while pointing toward future Gemini CLI and Claude Code integrations.
Handle Codex account SSE chat chunks
Teach the Codex/ChatGPT account bridge to extract text from OpenAI-style SSE chat completion deltas and fall back to a normal output_text response when upstream only streams chunks.
Strip user-supplied stream kwargs before LiteLLM calls so Agent Zero owns streaming mode and custom parameters cannot pass stream twice.
Add targeted tests for streamed delta extraction and reconstructed responses.
update README.md with LLM plans mention