Skip to content

fix: restore OpenAI Codex subscription flow#49

Open
cgasgarth wants to merge 5 commits intoKuberwastaken:mainfrom
cgasgarth:fix-codex-subscription
Open

fix: restore OpenAI Codex subscription flow#49
cgasgarth wants to merge 5 commits intoKuberwastaken:mainfrom
cgasgarth:fix-codex-subscription

Conversation

@cgasgarth
Copy link
Copy Markdown

Summary

  • restore the ChatGPT Plus/Pro openai-codex path end-to-end, including OAuth token refresh, ChatGPT-Account-Id, model selection, and runtime provider switching after /connect
  • align the Codex request/response handling with the official ChatGPT backend shape, including required instructions, store: false, stream: true, and SSE response parsing
  • keep the runtime behavior scoped to the Codex provider path so non-Codex providers continue using the existing request flow

Verification

  • cargo check
  • cargo build
  • cargo test codex
  • cargo test test_anthropic_to_openai_request_basic
  • cargo test stream_accumulator_text

Notes

  • I verified the runtime changes are gated to openai-codex / openai-codex/* selection in the query path.
  • A broader existing repo test failure outside this Codex work was observed earlier in crates/tui/tests/render_snapshots.rs (thinking_block_collapsed), so the verification above is intentionally focused on the Codex path.

Route the ChatGPT Plus/Pro path through the Codex client so /connect works in the TUI again. Refresh saved Codex tokens, send the account header, and synthesize streaming events for the non-streaming backend.
Limit the runtime changes to the openai-codex path so provider switching, OAuth auth, and SSE parsing only affect ChatGPT Plus/Pro requests. Match the official Codex request shape by removing unsupported token-limit fields while keeping the required instructions, store=false, and stream=true flags.
Format the Rust workspace so formatter checks pass, stop collapsed thinking blocks from leaking hidden content so the TUI test suite passes again, and split the local hook flow into fast pre-commit checks with full tests on pre-push.
chore: fix check failures and add pre-commit hooks
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.

1 participant