Skip to content

Launch 1M-default Claude models without the [1m] suffix - #450

Merged
Tryanks merged 3 commits into
mainfrom
claude-1m-suffix-sync
Sep 16, 2026
Merged

Tryanks merged 3 commits into
mainfrom
claude-1m-suffix-sync

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Since #439 sourced the Claude catalog from the t3code manifest, Opus 5 / Fable 5 sessions launched as claude-opus-5[1m]. Claude Code echoes that id in system/init, but the API reports the bare claude-opus-5 on the first assistant message, so every session opened with a spurious "模型已切换: claude-opus-5[1m] → claude-opus-5" divider.

Upstream t3code appends [1m] unconditionally whenever the contextWindow option resolves to 1m (including 1M-default models) and strips the bracket suffix again on the usage side. We diverge deliberately on the launch id and sync the rest.

Changes

  • No suffix at or below the default window. context_window_suffix returns nothing when the selected window does not exceed the model's default, so 1M-default slugs (Opus 5, Fable 5) launch bare. Sonnet 5 / 4.6 (200k default) still get [1m] when 1M is selected. Smaller selections keep compacting early via autoCompactWindow.
  • Alias resolution (synced from upstream). Manifest aliases (opus, claude-opus-5.0, …) now parse and resolve case-insensitively to the canonical slug, which is what gets launched. Previously an alias typed as a custom model got no capabilities, effort map, or suffix.
  • Divider filter with an explicit suffix list. A launch id carrying a listed context suffix and its bare form count as the same served model when deciding whether to draw the model-changed divider. The list is [1m] and [2m], matched case-insensitively: Claude Code 2.1.273 compares ids with /\[1m\]$/i and its canonical-name normalizer already accepts /\[[12]m\]$/. No other bracket suffix exists in the CLI today, and unlisted ones ([3m]) still count as a real change. No [*] wildcard.

Effort mapping (effortMap, ultracode → xhigh + settings.ultracode, ultrathink as prompt prefix) and the --settings assembly were compared against upstream ClaudeAdapter.ts and already match; the bundled manifest is identical to upstream's current model-manifest.json.

Test plan

  • cargo test -p agent (186 passed) — context_window_launch_semantics updated for bare 1M-default launches and alias launches; manifest tests cover alias lookup; strip_context_window_suffix_is_an_explicit_list.
  • cargo test -p tcode-core (129 passed) — new served_model_without_1m_suffix_is_not_a_model_change.
  • cargo clippy -p agent -p tcode-core --tests clean, cargo fmt --check clean.
  • Start an Opus 5 session and confirm no model-changed divider appears on the first reply.

Claude Code echoes the launch id (`claude-opus-5[1m]`) in its `init`
message while the API reports the bare id, so every Opus 5 / Fable 5
session opened with a spurious "model changed" divider.

- Only append the manifest's context suffix when the selected window
  exceeds the model's default; 1M-default slugs launch bare. Smaller
  selections keep compacting early via `autoCompactWindow`.
- Resolve manifest aliases (`opus`, `claude-opus-5.0`) to the canonical
  slug before launch, matching upstream t3code.
- Treat a `[1m]` launch id and its bare form as the same served model
  when deciding whether to draw the divider. Only the fixed `[1m]`
  suffix is ignored.
Claude Code strips model suffixes with /\[1m\]$/i and its canonical-name
normalizer already accepts [2m], so the served-model comparison now
ignores that explicit, case-insensitive list. Arbitrary [...] suffixes
are still treated as a real model change.
@Tryanks
Tryanks enabled auto-merge (squash) September 16, 2026 10:54
The replica readiness check only proves the client received the
SessionEvents baseline. The host's resident timeline is hydrated by a
separate detached load, which on Windows CI can still be empty when the
live events are recorded, so the live snapshot lacked turn-1.
@Tryanks
Tryanks merged commit d7b3fb3 into main Sep 16, 2026
6 checks passed
@Tryanks
Tryanks deleted the claude-1m-suffix-sync branch September 16, 2026 11:48
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