Skip to content

fix(models): stop false long-context fee warnings for GPT-6.1 Sol on ChatGPT plans - #329

Merged
bman654 merged 3 commits into
mainfrom
fix/sol-6-1-oauth-long-context-fee
Oct 14, 2026
Merged

bman654 merged 3 commits into
mainfrom
fix/sol-6-1-oauth-long-context-fee

Conversation

@bman654

@bman654 bman654 commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

If you use GPT-6.1 Sol through a ChatGPT/Codex sign-in, clodex was warning you about long-context fees you don't pay. OpenAI now gives GPT-6.1 Sol a 500K default window on ChatGPT plans with no long-context fees, but clodex still applied the API-key rule: "above 272,000 tokens, the whole request costs 2x input and 1.5x output." For that one model on a ChatGPT sign-in, clodex now warns only when you choose a window larger than 500K. GPT-6.1 Sol through an API key, and every other model, still warn exactly as before.

The user-visible failure

On 2026-10-13 OpenAI raised GPT-6.1 Sol's default context in Codex and ChatGPT from 272K to 500K, with no long-context fees for usage that comes from a ChatGPT subscription. API prompts over 272K input tokens still bill at 2x input and 1.5x output. After clodex providers refresh-models, the live Codex catalog reports context_window: 500000 for gpt-6.1-sol, but clodex kept attaching its 272K pricing band to the row. So:

  • clodex models --context sol=standard (now 500K) and sol=max (872K) both printed "can grow past the 272,000-token pricing boundary … 2x input and 1.5x output".
  • A session whose input grew past 272K got the per-request higher-rate notice.

Reproduced against a copy of a real ~/.clodex (refreshed today), using the released 2.21.0 compared with this branch's dist/cli.js:

$ clodex models --context sol=standard --json          # 2.21.0
sol (clodex:openai-oauth:gpt-6.1-sol): standard: 500,000 tokens.
sol: a 500,000-token window can grow past the 272,000-token pricing boundary. Above it, OpenAI prices the full request at 2x input and 1.5x output. …

$ node dist/cli.js models --context sol=standard --json  # this branch
sol (clodex:openai-oauth:gpt-6.1-sol): standard: 500,000 tokens.

$ node dist/cli.js models --context sol=max --json       # this branch, past the waiver
sol (clodex:openai-oauth:gpt-6.1-sol): max: 872,000 tokens.
sol: a 872,000-token window can grow past the 500,000-token pricing boundary. Above it, ChatGPT plan usage may be charged long-context fees. …

$ node dist/cli.js models --context daybreak-blue=max --json   # gpt-6-sol, control
daybreak-blue: a 872,000-token window can grow past the 272,000-token pricing boundary. …

Root cause

openAiPricingMetadata() derives the band from the model family (GPT ≥ 5.5, gpt-daybreak*). It served both API keys and ChatGPT OAuth. On OAuth it ran in three places: the seed list, the catalog parser for unseeded models, and the read-time overlay applyOAuthSeedContextMetadata. Refresh persists the band into providers.json, and the overlay preferred the cached value (model.pricingBoundary ?? …). Changing the derivation alone would therefore have left every refreshed install warning until it refreshed again.

The change

  • openAiOAuthPricingMetadata() wraps the API rule and gives the exact id gpt-6.1-sol a ChatGPT-plan band at 500K. The announcement waives fees for the new 500K default and says nothing about larger windows, so the band moves rather than disappearing. The OAuth seed builder, the OAuth catalog parser, and the OAuth overlay all use it. The API-key paths (fetch-template-models.ts, the non-OAuth branch of projectProviderCachedModels) are untouched.
  • The OAuth overlay now derives the band and never reads it from the cache. The Codex catalog parser ingests no pricing field, so a cached OAuth band can only be clodex's own earlier derivation. Existing installs, including named account slots, stop warning without a refresh. The cache file is not rewritten.
  • The gpt-6.1-sol seed window goes from 272K to 500K, matching the live catalog. The seed is only consulted when discovery fails or a row omits the field. A cached 272K window is still respected, because a cached window is a provider answer.
  • README and clodex models --help describe the exception.
  • The per-request notice (shared by every model) now says the provider may price the full request at a higher rate. GPT-6.1 Sol on a plan can now reach it above 500K, where the fee is unconfirmed, and the old wording stated it as fact. For API-key models the sentence is still true.

Deliberately left out: other models, other providers, and the API-key band. Pricing is not part of the patch-config hash (computePatchConfigHash hashes alias, context, display and effort), so existing patches stay valid and no re-patch is needed.

Tests and mutations

New or changed tests stage state through production producers: the real OAuth refresh with only fetch stubbed, real projection and materialization, the real main(['models', '--context', …]) CLI, and on-disk registry plus loadRegistryProvidersSync for account slots. The stale-cache fixtures copy the exact row shape found in a real refreshed providers.json.

Each mutation below was run against the full test files (no -t) and turned at least one test red:

Mutation Caught by
ChatGPT-plan band deleted (feature deleted) overlay, seed, refresh, CLI, account-slot tests
Band set to 499,999 or 500,001 CLI standard/max cases, seed, account-slot tests
Band dropped entirely instead of moved CLI, seed, account-slot tests
Overlay trusts the cached band again stale-cache overlay, CLI, account-slot tests
Overlay trusts only the cached note stale-cache overlay test
Plan band widened to prefix match gpt-6.1-sol-unreleased negatives (overlay and refresh)
Plan band also applied to API keys API-key negative, openai-api-pricing-boundary suite
Seed builder uses API pricing seed, CLI, account-slot tests
Unseeded catalog branch drops pricing refresh test (gpt-6.1-sol-unreleased, gpt-6.1-luna)
Overlay skipped for providers with named accounts oauth-pricing-account-slots (persisted and env selection)
Seed window reverted to 272K four seed and patch-config tests
Plan note or per-request notice made categorical stale-cache overlay test (pins both sentences)

Gate: pnpm typecheck && pnpm test && pnpm build all pass (Node 24.14.1, CLODEX_HOME set to a temp dir, CLAUDE_CODE_ENTRYPOINT=cli): 3464 passed, 20 skipped.

What was not verified

  • No live request near 500K or 872K was sent. The 872K ceiling is what the catalog reports; this PR only changes what clodex warns about.
  • The announcement doesn't say what plan usage above 500K costs. The 500K band is the conservative reading: it may warn about a fee that turns out not to exist, but it won't stay silent about one that does.
  • Accounts on plans that still get a smaller window: a refreshed catalog row reporting a smaller window is respected. Only a sign-in with no cache and failed discovery falls back to the 500K seed.

Failure and rollback

Pure metadata change; no request or transport behaviour changes. Reverting restores the warnings. No persisted data is migrated or rewritten.

…ChatGPT plans

OpenAI raised GPT-6.1 Sol's Codex default window to 500K and charges ChatGPT
subscriptions no long-context fee for it. API keys still pay 2x input and 1.5x
output above 272K, and no other model changed.

clodex still attached the API-key 272K band to the ChatGPT-plan row, so a
session that grew past 272K input tokens got a higher-rate notice, and
choosing any --context stop above 272K (including the new 500K default when
named explicitly) warned about a fee the user does not pay.

Drop the band for gpt-6.1-sol on the OAuth path only. Derive the band when the
catalog is read instead of trusting the cached copy, so existing installs and
named accounts stop warning without a refresh. Seed the 500K window for when
discovery is unavailable, and say so in README and `models --help`.
…K default

The announcement waives long-context fees for GPT-6.1 Sol's new 500K default on
ChatGPT plans and says nothing about larger windows. Move the ChatGPT-plan band
from none to 500K so a stop past the default (such as max) still warns.
@bman654
bman654 merged commit 58b656a into main Oct 14, 2026
7 checks passed
@bman654
bman654 deleted the fix/sol-6-1-oauth-long-context-fee branch October 14, 2026 04:19
@bman654

bman654 commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

Merged after the pre-PR gate. Verification record:

  • Reproduced on a real config. A copy of a refreshed ~/.clodex where the Codex catalog reports gpt-6.1-sol at 500K was run against released 2.21.0 and against this branch. 2.21.0 warned about the 272K boundary even at the 500K default stop. This branch is silent at standard and 400k, and warns at max against 500,000. gpt-6-sol still warns against 272,000.
  • Review rounds. All reviewers were GPT-6.1 Sol (high), a different model family from the author.
    • Round 1 had two lenses: correctness/completeness and tests/claims. Neither found a functional defect. Their gaps were fixed: exact-id and named-account tests were missing, models --help didn't mention the exception, and the commit body overstated the symptom.
    • Round 2 checked those fixes and came back clean.
    • Round 3 reviewed the move from "no band" to a 500K band. It found that the shared per-request notice stated the higher rate as certain, which is now reachable for GPT-6.1 Sol above 500K where the fee is unconfirmed. The notice now says "may", and both sentences are pinned by a test.
  • Mutations. 12 mutations, each turning at least one full-file test run red. They are listed in the PR description.
  • Not verified. No live request near 500K or 872K was sent.

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