Commit 99bb2e8
fix: size the 1M context window for the bracket alias form (opus[1m]) (#302)
`contextWindowForModel` matched only the `-1m` suffix, so the bracket form
Claude Code actually emits — `opus[1m]`, `claude-opus-5[1m]` — fell through to
the conservative 200k default. Asking EXPLICITLY for the 1M variant therefore
sized the window WORSE than the bare `opus` alias, which resolves to 1M.
Observed on a live session pinned to `opus[1m]`: codeoid computed a 200k window
against ~999k of real usage. Affected consumers:
- the percent-of-window figure on SessionInfo (session.ts) — reads ~500%
- the fork / provider-switch seed budget (seedBudgetChars via
targetContextWindow) — 5x too small, so history seeds over-truncate
Auto-rotate is NOT affected: decideRotation is passed the static
`Session.CONTEXT_WINDOW` (1M), not this per-model resolution.
This also did NOT cause the "prompt is too long" overflow seen on that session
— that has a separate cause (compaction firing reactively after the API error
rather than proactively). This is an independent defect surfaced while
investigating it.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 3028190 commit 99bb2e8
2 files changed
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
38 | 55 | | |
39 | 56 | | |
40 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
| |||
0 commit comments