Repository navigation
feat(codex): add GPT-6.1 Sol support across execution and pricing pipelines - #15192
Conversation
…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.
9fcc352 to
da3f152
Compare
|
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:
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.
|
@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. |
|
Yes. The backport on 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
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 |
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>
a3401e9
into
diegosouzapw:release/v3.8.52
|
Two regressions from this merge are now tracked separately.
|
Summary
Adds comprehensive support for OpenAI's
gpt-6.1-solmodel across the Codex execution pipeline, OpenAI provider registry, reasoning effort normalization, and token pricing calculators.Codex Client Version Bump: Bumps
DEFAULT_CODEX_CLIENT_VERSIONfrom0.156.1to0.159.2(and synchronizes pinned@openai/codexinDockerfile). Reverse-engineering the native arm64 Codex CLI binary (v0.159.2) revealed that upstreamhttps://chatgpt.com/backend-api/codex/responseschecks theVersion: <semver>request header and rejects clients< 0.159.0with 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()inopen-sse/utils/error.tsto extract top-leveldetailstring messages from OpenAI error responses, surfacing explicit backend validation errors instead of masking them as genericUpstream error: 400.Model Registration: Registers
gpt-6.1-soland 6 reasoning effort variants (ultra,max,xhigh,high,medium,low) in bothcodexandcodex-app-serverprovider registries (872k context / 128k output), and registersgpt-6.1-solin theopenaiprovider registry andMODEL_SPECS(1.05M context / 922k max input / 128k max output).Reasoning Suffix & Effort Clamping: Adds
gpt-6.1-soltoCODEX_MAX_ALIAS_MODELSandCODEX_ULTRA_ALIAS_MODELSinopen-sse/executors/codex/reasoningSuffix.ts, ensuring effort suffix splitting works seamlessly, preventingmaxandultraefforts from being clamped toxhigh, and preservingparallel_tool_calls: trueforgpt-6.1-sol-ultraunder 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 inoauth-subscriptions.ts, and applies the 2.5x Fast mode multiplier incostCalculator.ts.Bare-ID Routing: Adds
gpt-6.1-solvariants toCODEX_NATIVE_UNPREFIXED_MODELSinopen-sse/services/model.tsfor direct routing.Changelog fragment:
changelog.d/features/0000-codex-gpt-6-1-sol.mdRelated Issues
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):
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)release/v3.8.52); focused checks rerun afterwardSOL_OK) and SSE streaming (44 reasoning tokens streamed cleanly).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), upstreamdetailstring 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 from0.156.1to0.159.2.tests/snapshots/provider/translate-path.json: Updated golden snapshot headers to match client version0.159.2.Coverage Notes
open-sse/andsrc/are comprehensively exercised bytests/unit/codex-gpt61-sol.test.tsandtests/unit/executor-codex.test.ts.Reviewer Notes
Version >= 0.159.0forgpt-6.1-solon Codex routes. Deployments must maintain client version >= 0.159.0;0.159.2was confirmed against the latest official binary.gpt-6.1-solvia 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 newdetailparsing path.