Skip to content

feat(composer): context window selector follows native defaults, adds custom window - #318

Merged
Tryanks merged 1 commit into
mainfrom
feat/context-window-selector
Sep 2, 2026
Merged

feat(composer): context window selector follows native defaults, adds custom window#318
Tryanks merged 1 commit into
mainfrom
feat/context-window-selector

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Claude contextWindow option defaults to the model's native window (200k: Sonnet 4.6 / Opus 4.6; 1M: Fable 5 / 5.1, Opus 5, Sonnet 5, Opus 4.7 / 4.8 — the last two gain the option).
  • Selecting the default emits no launch flags. A smaller window is passed as --settings {"autoCompactWindow":N}; [1m] is only appended to expand a native-200k model.
  • Picker gains a Custom row with an inline input (500k, 500000, 500; 100k–1M, inline validation error).
  • Changing the window while the provider is live restarts it before the next turn and records a ContextWindowChanged divider ("Context window set to 200k") directly under the user message. Not emitted for the first message of a conversation or an idle session.
  • Composer context meter is clamped to the selected window.

Verification

  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace pass locally.
  • Manual run against a throwaway TCODE_DATA_DIR: Opus 5 shows 1M by default; entering 500k launches claude --model claude-opus-5 --settings {"autoCompactWindow":500000} (no [1m]); switching to 200k mid-session relaunches with autoCompactWindow: 200000 and renders the divider under the second user message.

… custom window

Claude models now default the Context Window option to their native window
(200k for Sonnet 4.6 / Opus 4.6, 1M for Fable 5/5.1, Opus 5, Sonnet 5,
Opus 4.7/4.8; the latter two gain the option). Selecting the default emits no
launch flags; a smaller window is passed as `--settings {"autoCompactWindow":N}`
and `[1m]` is only appended to expand a native-200k model.

The picker gains a Custom row with an inline input (500k / 500000 / 500,
100k–1M). Changing the window while the provider is live restarts it before
the next turn and records a `ContextWindowChanged` timeline divider under the
user message. The composer's context meter is clamped to the selected window.
@Tryanks
Tryanks merged commit dfe8c46 into main Sep 2, 2026
3 checks passed
@Tryanks
Tryanks deleted the feat/context-window-selector branch September 2, 2026 20:40
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