Skip to content

fix: Codex OAuth end-to-end + reasoning effort (v2.1.2)#205

Merged
typelicious merged 7 commits into
mainfrom
fix/codex-v2.1.2
Apr 6, 2026
Merged

fix: Codex OAuth end-to-end + reasoning effort (v2.1.2)#205
typelicious merged 7 commits into
mainfrom
fix/codex-v2.1.2

Conversation

@typelicious
Copy link
Copy Markdown
Collaborator

Summary

  • chat_path bug: Codex endpoint IS the full URL; openai-compat was appending /chat/completions → all requests 404'd → Sonnet fallback
  • faigate-auth JSON output: OAuthBackend expects JSON on stdout; CLI printed human-readable text → json.JSONDecodeError on every request
  • max_tokens: Codex max is 8192; OpenCode limit was 32768 → invalid_request_error
  • Paid fallbacks: Removed Sonnet/GPT-4o from Codex degrade_to chains
  • oauth backend validation: Added to _SUPPORTED_BACKENDS in config.py
  • Repo-safety badge: Removed (workflow was consolidated into CI in v2.1.0)

Codex reasoning effort (GPT-5.4 + 5.3 series)

New default_extra_body mechanism in providers.py injects provider-configured fields into every request. GPT-5.4 reasoning providers:

Provider reasoning_effort
openai-codex-5.4-xhigh extra_high
openai-codex-5.4-high high
openai-codex-5.4-medium medium
openai-codex-5.4-low low

GPT-5.3 reasoning via model name: openai-codex-xhigh, openai-codex-high, openai-codex-spark, openai-codex-low, openai-codex-mini.

All 20 Codex model variants added to _CANONICAL_MODEL_LANES.

Test plan

  • faigate-auth openai-codex 2>/dev/null | python -c "import json,sys; d=json.load(sys.stdin); print(d['access_token'][:10])" → prints token prefix
  • OpenCode: "Codex GPT-5.4" request completes without Sonnet fallback
  • OpenCode: "Codex GPT-5.4 xHigh" sends reasoning_effort=extra_high in body
  • faigate --version → 2.1.2 after brew upgrade

🤖 Generated with Claude Code

André Lange and others added 7 commits April 7, 2026 01:12
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Uncomment openai-codex provider in config.yaml (model: gpt-5.4)
- Add openai-codex-mini/spark/high variant providers
- Add oauth backend to _SUPPORTED_BACKENDS in config.py
- Add oauth default transport profile in lane_registry.py
- Update _PROVIDER_LANE_BINDINGS: openai-codex canonical → gpt-5.4,
  add mini/spark/high bindings
- Add all 20 Codex models to _CANONICAL_MODEL_LANES
- Update registry.py example_model to openai-codex/gpt-5.4
- Add model_requested routing rules for codex/gpt-5.4/codex-mini/codex-high

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Codex base_url (chatgpt.com/backend-api/codex/responses) IS the full
endpoint. The openai-compat wrapper was appending /chat/completions, causing
all requests to 404 → triggering degrade_to fallback → Sonnet.

- Add per-provider transport bindings for openai-codex* with chat_path: ""
- Remove paid providers (gpt-4o, sonnet) from openai-codex degrade_to chain

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
OAuthBackend._run_helper() parses stdout as JSON to populate TokenStore.
The helper was printing human-readable text to stdout → json.JSONDecodeError
→ every Codex request failed before even reaching the API.

Status/info messages already went to stderr; now stdout is only the JSON token.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- openai-codex-xhigh → gpt-5.3-codex-xhigh (Extra hoch)
- openai-codex-low   → gpt-5.3-codex-low   (Niedrig)
- Routing rules + lane bindings + transport bindings for both
- Remove anthropic/sonnet-4.6 from openai-codex-high degrade_to

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…roviders

providers.py: load extra_body from provider config as default_extra_body,
injected into every request before caller's extra_body override.

New providers for GPT-5.4 reasoning control:
  openai-codex-5.4-xhigh  → reasoning_effort=extra_high
  openai-codex-5.4-high   → reasoning_effort=high
  openai-codex-5.4-medium → reasoning_effort=medium
  openai-codex-5.4-low    → reasoning_effort=low

All share model=gpt-5.4 with chat_path="" transport binding.
Routing rules + transport bindings + OpenCode model entries included.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@typelicious typelicious enabled auto-merge (squash) April 6, 2026 23:13
Comment thread faigate/oauth/cli.py
print("Token stored in credentials file.")
# Output token data as JSON to stdout so OAuthBackend._run_helper() can parse it.
# All human-readable status messages go to stderr (see above).
print(json.dumps(token_data))
@typelicious typelicious merged commit 63589fb into main Apr 6, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants