Skip to content

feat(codex): add GPT-6.1 Sol support across execution and pricing pipelines - #15192

Merged
diegosouzapw merged 4 commits into
diegosouzapw:release/v3.8.52from
initguru:feat/codex-gpt-6-1-sol
Oct 7, 2026
Merged

diegosouzapw merged 4 commits into
diegosouzapw:release/v3.8.52from
initguru:feat/codex-gpt-6-1-sol

Conversation

@initguru

Copy link
Copy Markdown
Contributor

Summary

Adds comprehensive support for OpenAI's gpt-6.1-sol model across the Codex execution pipeline, OpenAI provider registry, reasoning effort normalization, and token pricing calculators.

  • Codex Client Version Bump: Bumps DEFAULT_CODEX_CLIENT_VERSION from 0.156.1 to 0.159.2 (and synchronizes pinned @openai/codex in Dockerfile). Reverse-engineering the native arm64 Codex CLI binary (v0.159.2) revealed that upstream https://chatgpt.com/backend-api/codex/responses checks the Version: <semver> request header and rejects clients < 0.159.0 with HTTP 400 Bad Request (The 'gpt-6.1-sol' model is not supported when using Codex with a ChatGPT account.). Updating the version header unlocks full upstream access.

  • Enhanced Upstream Error Diagnostics: Extends parseUpstreamError() in open-sse/utils/error.ts to extract top-level detail string messages from OpenAI error responses, surfacing explicit backend validation errors instead of masking them as generic Upstream error: 400.

  • Model Registration: Registers gpt-6.1-sol and 6 reasoning effort variants (ultra, max, xhigh, high, medium, low) in both codex and codex-app-server provider registries (872k context / 128k output), and registers gpt-6.1-sol in the openai provider registry and MODEL_SPECS (1.05M context / 922k max input / 128k max output).

  • Reasoning Suffix & Effort Clamping: Adds gpt-6.1-sol to CODEX_MAX_ALIAS_MODELS and CODEX_ULTRA_ALIAS_MODELS in open-sse/executors/codex/reasoningSuffix.ts, ensuring effort suffix splitting works seamlessly, preventing max and ultra efforts from being clamped to xhigh, and preserving parallel_tool_calls: true for gpt-6.1-sol-ultra under Responses Lite.

  • Pricing & Cost Calculation: Adds standard token pricing in frontier-labs.ts ($2.00 in / $10.00 out / $0.20 cache read / $2.50 cache write), OAuth credit rates in oauth-subscriptions.ts, and applies the 2.5x Fast mode multiplier in costCalculator.ts.

  • Bare-ID Routing: Adds gpt-6.1-sol variants to CODEX_NATIVE_UNPREFIXED_MODELS in open-sse/services/model.ts for direct routing.

  • Changelog fragment: changelog.d/features/0000-codex-gpt-6-1-sol.md

Related Issues

  • None

Validation

Choose the change type and focused loop from the Contribution Golden Path. The full unit suite, Vitest, the 60% coverage gate, and the production build all run in CI on this PR (#8329):

  • Change type: provider
  • Focused tests and category gates from the golden path:
    • node --import tsx/esm --test tests/unit/codex-gpt61-sol.test.ts (11/11 tests passed)
    • node --import tsx/esm --test tests/unit/executor-codex.test.ts (47/47 tests passed)
    • npm run check:provider-consistency (clean, 0 exceptions)
    • npm run typecheck:core (clean, 0 errors)
  • npm run lint (clean, 0 errors)
  • Reconciled with the current active release base (release/v3.8.52); focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR
  • Live end-to-end runtime verification:
    • Validated on running server port 20128 for non-streaming (SOL_OK) and SSE streaming (44 reasoning tokens streamed cleanly).

⚠️ base-red inherited: #15100

Tests Added Or Updated

  • tests/unit/codex-gpt61-sol.test.ts: New unit test suite (160 lines) covering client version threshold enforcement (>= 0.159.0), upstream detail string extraction, effort suffix splitting, Responses Lite tool call preservation, pricing lookup, and bare ID resolution.
  • tests/unit/executor-codex.test.ts: Updated version header expectation from 0.156.1 to 0.159.2.
  • tests/snapshots/provider/translate-path.json: Updated golden snapshot headers to match client version 0.159.2.

Coverage Notes

  • Changes in open-sse/ and src/ are comprehensively exercised by tests/unit/codex-gpt61-sol.test.ts and tests/unit/executor-codex.test.ts.
  • All touched files maintain or improve branch and statement test coverage, well exceeding the 60% repository gate.

Reviewer Notes

  • Upstream Version Requirement: OpenAI backend strictly enforces Version >= 0.159.0 for gpt-6.1-sol on Codex routes. Deployments must maintain client version >= 0.159.0; 0.159.2 was confirmed against the latest official binary.
  • Account Tier Requirements: Per upstream policy, gpt-6.1-sol via Codex requires an active Plus or Team subscription on the authenticating ChatGPT OAuth account. Free tier accounts will receive upstream HTTP 400 with the exact explanation surfaced through the new detail parsing path.

…elines

Add end-to-end support for OpenAI’s `gpt-6.1-sol` model across the Codex execution layer, OpenAI provider registry, reasoning pipelines, and pricing calculators.

Key changes and technical details:

1. Codex Client Version & Upstream Tier Gating:
   - Reverse-engineering the official `@openai/codex` CLI native binary (Mach-O arm64 v0.159.2) revealed metadata specifying `minimal_client_version: 0.153.0`, `prefer_websockets: true`, and `use_responses_lite: true`.
   - Upstream Codex endpoint enforces a client version check via the `Version` request header. Requests presenting legacy client versions (< 0.159.0, such as OmniRoute’s previous default 0.156.1) are rejected with HTTP 400 Bad Request and a `detail` message that the model is not supported with a ChatGPT account.
   - Bumped `DEFAULT_CODEX_CLIENT_VERSION` to `0.159.2` and synchronized pinned Codex CLI in `Dockerfile` to satisfy upstream tier gating.

2. Enhanced Error Diagnostics:
   - Refined `parseUpstreamError()` in `open-sse/utils/error.ts` to extract top-level `detail` string messages from OpenAI/Codex JSON error payloads, preventing actionable backend rejection explanations from being masked as generic upstream errors.

3. Provider Registries & Model Capabilities:
   - Registered `gpt-6.1-sol` and its six effort variants (`ultra`, `max`, `xhigh`, `high`, `medium`, `low`) under Codex registries with 872k context window and 128k output limits.
   - Registered `gpt-6.1-sol` under the OpenAI provider registry and `MODEL_SPECS` with 1,050,000 context (922,000 max input) and 128,000 max output.

4. Reasoning Pipeline & Suffix Handling:
   - Added `gpt-6.1-sol` to Codex max/ultra alias models, ensuring clean suffix splitting and preventing `max` and `ultra` efforts from being clamped down to `xhigh`.
   - Preserved `parallel_tool_calls: true` for `gpt-6.1-sol-ultra` under Responses Lite.
   - Extended Responses API translator and VS Code Copilot metadata to recognize GPT-6.1 model naming.
   - Added GPT-6.1 Sol variants to bare-ID routing.

5. Pricing & Fast Mode Multipliers:
   - Configured pricing and OAuth credit conversions in the pricing tables.
   - Added 2.5x Fast mode cost multiplier in `src/lib/usage/costCalculator.ts`.

6. Verification:
   - Added focused unit tests covering version headers, upstream detail extraction, effort alias splitting, Responses Lite tool calling, pricing, and bare IDs.
   - Updated existing executor tests and provider snapshots.
@initguru
initguru force-pushed the feat/codex-gpt-6-1-sol branch from 9fcc352 to da3f152 Compare September 30, 2026 11:51
@HouMinXi

HouMinXi commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

This PR has been conflicting for a week. Without gpt-6.1-sol in CODEX_MAX_ALIAS_MODELS and CODEX_ULTRA_ALIAS_MODELS, splitCodexReasoningSuffix returns effort=null for gpt-6.1-sol-ultra, so the alias never reaches the request. A rebase would unblock it.

Two notes from a local backport review:

  1. The Dockerfile hunk regresses the ip-address pin from 10.7.2 to 10.5.0 and drops the isLinkLocal / NAT64 SSRF advisory fixes that landed on the release tip after this branch was cut. That hunk should be rebased away. Only the @openai/codex bump (0.156.1 to 0.159.2) is a real advance.
  2. frontier-labs cached: 0.1 versus Codex OAuth cached: 0.2. 0.1 matches the published OpenAI standard-tier cache_read for gpt-6.1-sol, so it looks intentional. The cross-channel difference is still worth a one-line comment in the pricing files.

Happy to help resolve the conflicts if useful.

Restore the release ip-address 10.7.2 pin and advisory notes while retaining
Codex 0.159.2. Raise the Docker regression guard to the release pin.

Give GPT-6.1 Sol its own cached-input rate using the current 50/2.5/250
credit table; retain GPT-6 Sol's existing rate and cover both in tests.
Fast billing-context behavior and cache-creation accounting are unchanged.

Validation: source inspection only; tests and build not run in this update.
@initguru

initguru commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@HouMinXi Thanks for checking this. I've pushed 3661c35 to restore ip-address 10.7.2 and the advisory notes, keeping the Codex CLI bump intact. I also tightened the Docker regression guard.
On pricing, the current Codex table lists GPT-6.1 Sol at 50 / 2.5 / 250 credits per million input / cached / output tokens. Reusing GPT-6 Sol's cached rate was an error, so 6.1 now has its own 0.1 rate. The tests also check that GPT-6 Sol stays at 0.2. The API cache-read figure in the PR description should read $0.10 as well.
One clarification: gpt-6.1-sol was already in both alias sets in da3f152, including coverage for ultra mapping to upstream max. Could you check whether your backport included reasoningSuffix.ts?
GitHub now reports the branch as mergeable. I haven't rerun local tests or the build for this update; The 17 tests in the two updated test files passed in CI. The overall checks are still failing, including upstream issues identified in the logs. The build was interrupted by a runner shutdown, so build validation remains incomplete. Fast billing-context handling and cache-creation accounting remain unchanged.

@HouMinXi

HouMinXi commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Yes. The backport on deploy/v3.8.52-20261007 includes reasoningSuffix.ts, and gpt-6.1-sol is in both alias sets:

export const CODEX_MAX_ALIAS_MODELS = new Set([
  "gpt-5.6-sol",
  "gpt-5.6-terra",
  "gpt-5.6-luna",
  "gpt-6-astra",
  "gpt-6.1-sol",
  "gpt-6-sol",
  "gpt-6-luna",
]);
export const CODEX_ULTRA_ALIAS_MODELS = new Set([
  "gpt-5.6-sol",
  "gpt-5.6-terra",
  "gpt-6-astra",
  "gpt-6.1-sol",
  "gpt-6-sol",
]);

Those two lines match da3f152. They came from our own commit 1d92b1cd03 ("fix(codex): register GPT 6.1 Sol in the max/ultra alias sets"), which landed before the backport. The backport commit 87e4fe1d8b says so in its message: reasoningSuffix.ts skipped: fix/codex-61-sol-effort-alias already landed.

3661c35 touches Dockerfile, oauth-subscriptions.ts, codex-gpt61-sol.test.ts and dockerfile-npm-bundled-cve-patch.test.ts. It does not touch reasoningSuffix.ts, so the alias sets are unaffected by it.

On pricing: our backport still uses the old cached rate of 0.2 for GPT-6.1 Sol. I will update it to 0.1 to match 3661c35, and keep GPT-6 Sol at 0.2.

initguru and others added 2 commits October 7, 2026 15:36
Keep GPT-6.1 Sol registry, pricing, executor, and tests. Leave the
release ip-address@10.7.3 Dockerfile pin and the dockerfile regression
minimum unchanged.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw
diegosouzapw merged commit a3401e9 into diegosouzapw:release/v3.8.52 Oct 7, 2026
8 of 9 checks passed
@HouMinXi

HouMinXi commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Two regressions from this merge are now tracked separately.

  • fix(providers): prevent duplicate effort suffixes in Codex combo picker #16026: the combo picker appends a second effort tier, so gpt-6.1-sol-ultra is offered as gpt-6.1-sol-ultra-max. appendSyncedEffortVariants skips the "id already ends in an effort" check for codex, and ultra is not in CANONICAL_EFFORT_VALUES, so nothing stops the second suffix.
  • fix(providers): resolve Codex ultra aliases against the live catalog #16027: both codex accounts on openai-gpt-sol return HTTP 400, Model 'gpt-6.1-sol-ultra' is not available in the active live catalog. The synced catalog has gpt-6.1-sol only. resolveSyncedModelIdAndEffort (src/sse/services/model.ts, around line 189) returns the registry id unchanged, so the ultra tier is never stripped and the request never reaches splitCodexReasoningSuffix.

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.

3 participants