Skip to content

feat(models): add Sonnet 1M and GPT-5.4 with usage warnings + recover…#22

Merged
aletc1 merged 1 commit intodevfrom
claude/confident-chandrasekhar-42c7f5
Apr 18, 2026
Merged

feat(models): add Sonnet 1M and GPT-5.4 with usage warnings + recover…#22
aletc1 merged 1 commit intodevfrom
claude/confident-chandrasekhar-42c7f5

Conversation

@aletc1
Copy link
Copy Markdown
Owner

@aletc1 aletc1 commented Apr 18, 2026

Summary

  • Sonnet 4.6 1M is now selectable alongside Opus 1M. Backend strips the [1m] suffix and enables the shared context-1m-2025-08-07 beta header for either Opus or Sonnet — same code path, no per-model branching.
  • GPT-5.4 + GPT-5.4 mini added to the Codex model list, with both the backend default (gpt-5.4/high) and the frontend last-selected default flipped from gpt-5.3-codex to gpt-5.4. 5.3-codex stays available; users with stored preferences are unaffected.
  • Cost warning badge: any model with a [1m] id renders an amber "1M · higher cost" tag in the model selector with a tooltip, so users see the pricing tradeoff before opting in.
  • Recovery action on errors: when a 1M model hits a rate-limit / quota error, the toast action becomes "Switch to " instead of "Copy Error" — one click moves the active sub-chat back to the 200K variant. Description is augmented to explain why.

Pricing for gpt-5.4 / gpt-5.4-mini was already in pricing.ts so billing flows through unchanged.

Files Changed

Test plan

  • Open the model selector — verify Sonnet 4.6 1M appears with the amber "1M · higher cost" badge
  • Select Sonnet 4.6 1M, send a message — verify the child-process log shows [claude] 1M context enabled for sonnet — ANTHROPIC_BETAS=…,context-1m-2025-08-07
  • Verify the context indicator tooltip shows … / 1.0M context
  • Open the Codex section — verify GPT-5.4 and GPT-5.4 mini appear above Codex 5.3
  • Fresh install / cleared localStorage — verify the default Codex model is GPT-5.4
  • Existing user with stored gpt-5.3-codex selection — verify it is preserved (5.3 still in the list)
  • Trigger a rate-limit error on a [1m] model (or simulate by injecting RATE_LIMIT_SDK with a model: "sonnet[1m]" debugInfo) — verify the toast action reads "Switch to sonnet" and clicking it switches the sub-chat
  • Same error on a non-1M model — verify the toast still shows "Copy Error"

Sources for the model decisions

🤖 Generated with Claude Code

…y action

- Register Sonnet 4.6 1M (sonnet[1m]) alongside existing Opus 1M.
- Generalize the [1m] beta-header path so the same context-1m-2025-08-07
  slug is sent for both Opus and Sonnet 1M models.
- Add an amber "1M · higher cost" badge in the model selector to surface
  the pricing tradeoff before users opt in.
- On rate-limit / context errors against a [1m] model, swap the toast
  action to "Switch to <base model>" — one click moves the sub-chat back
  to the 200K variant instead of leaving the user stuck.
- Add gpt-5.4 and gpt-5.4-mini to Codex models and switch both the
  backend default (gpt-5.4/high) and frontend last-selected default to
  gpt-5.4. 5.3-codex stays available; existing user prefs are preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aletc1 aletc1 merged commit c62708e into dev Apr 18, 2026
@aletc1 aletc1 deleted the claude/confident-chandrasekhar-42c7f5 branch April 18, 2026 12:33
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