Public: anyone can read this; the crew can change it.
Talk's context meter uses the model's real window, not 200k #17841
Merged 4h 32m ago, live in production
Talk's context meter now reads the window of the model that answered, and an unknown model shows no percentage. I ran the new test and the six existing Talk and conversation suites that touch the meter, plus tsc: all pass. I did not run the full suite, and I did not start the app.
-
Reviews
Changes requested — before the latest pushThe shape is right (one table, share absent when unknown, CONTEXT_TOKENS removed, test and how-to present), and the preview answers 200. One thing makes it not work for the models this forge actually uses, so I am sending it back.
- The table does not know the models Talk runs. src/crew/models.ts offers
claude-fable-5-1, and the aliasesopus,sonnet,haiku; none is in the table. With this head a normal Talk conversation, whose run reports no window, shows no percentage and no head meter at all. The issue wanted the real window, not none for the common case. Fix first: add the ids the forge really records in conversation_run.model (check the column for the aliases and full ids, e.g. claude-fable-5-1, claude-opus-5-5, claude-sonnet-5-5, claude-haiku-5-5) with their true windows, and resolve the aliases, or prefer the window the run reports. If a window truly is unknown, say so, but do not leave the default models unknown. - Because of 1, the 'full' behaviour regresses silently. src/crew/conversation.ts (startsFresh, ~595, and the carry-on check, ~790) read
share ?? 0, so for an unknown model a conversation never starts fresh and never carries on when full. Before this it did at 200k. Either keep those safe when the window is unknown (for example fall back on token count there) or cover the known models so it cannot happen; add a test that a full conversation on a model the table knows still starts fresh. - The test for 'unknown shows no percentage' is good, but add one that the head meter (talk.ts hereBar) renders for a known model above CONTEXT_SHOWN and is absent for an unknown one, since that line changed.
Smaller: in conversation_cost.ts the contextText ternary is a long one-liner; split it for reading. No new screen is needed (the terminal shares contextText), and no accent or markup changed in src/web, so the design principles are not broken.
Boxes: 1 is met in form but not in content (default models missing); 2 is met by the code path but blank for the default models; 3 is met.
ApprovedBoth earlier asks are met since 9d59eae. The default models (fable 5.1/5.2, opus/sonnet/haiku 5.5 and the aliases) now have a window, so the meter shows a percentage for them. The full rules go through
fullness(), which falls back to tokens against 200k, so an unknown model still starts fresh and carries on at 85%; tests in talk-fresh-say cover it. The head meter is tested for a known and an unknown model, and the page and terminal sharecontextText.docs/features/talk.mdhas the how-to and README is untouched.Two things I would do next:
- Non-blocking: confirm the Claude 5.x windows in
src/crew/model_windows.ts. They are all 200k and the builder says they are unconfirmed; if any is really 1M, the meter reads too full for it. A run that reports its own window already overrides the table. - Non-blocking: an unknown model shows no head bar, so on a phone a person gets no warning before the context fills. The menu line does show the token count. Consider a plain-words note in the head once tokens pass the safe window.
Boxes: the table is one small module with unknown giving no percentage, the meter reads the answering model's window, and the 1M-at-200k=20% and unknown=no-percentage tests exist.
- The table does not know the models Talk runs. src/crew/models.ts offers
-
Checks
waiting merged; waiting for the forge to restart on it deploy 5fa2c54
-
History
- Direction: one import of conversation_cost in the model-windows test (#17826) 8456644
- Direction: the meter knows the default models and the full rules never go blind on an unknown one (#17826) bbdcce9
- Try: open a /talk conversation answered by an unlisted model; its head menu reads 'Context 200k tokens', no percent No look: the change is one line of words in an existing menu, no new page. 9d59eae
- Direction: Talk's context meter reads the answering model's real window, no percentage for an unknown one (#17826) a25a23b
- An app that stops with 'Cannot find module dist/server.js' says why on its page (#17834) 6c2baf3
- Merge pull request #17792 from sold/shell-refusals-2 856fb52
- Merge pull request #17798 from sold/jar-there-later 776f58f
- Talk's Stop stays for the whole answer, with words in the box too (#17819) b51ab2e
- The changelog credits a model only when a run backs it (#17807) e780a4e
- The decider can be compared with SubQ Snap in the background, off by default, and decides nothing (#17795) c0cee92
- small: the '+ New forge' page has one primary next action, with phone and desktop looks on the pull (#17818) 6cc8e61
- GET pulls/:number runs an uncapped diff and renders it on the serving thread (#17812) 153cbb3
- Full suite red: 2 files in check run 01m8wzswcz0vr3fz25ryd619jz (#17814) 8f7dfc4
- A Talk build's version strip is in sight when its preview opens, on a phone and at 1000 px (#17810) bdc702e
- Talk says what a long turn is doing and how long since its last step, across every stream (#17808) dcfa7ed
- A Talk build starts no crew run and no review, and only a person publishes it (#17803) cd1d5b7
- Only a check writes a retry decision's outcome, and it says which one (#17796) c2d976e
- A crew run that hits the turn limit wraps up, and says so in its run and its pull (#17809) b35dca2
- app-home-batched boots one forge for the file, and each test has its own account and repositories (#17805) 4763617
- A follow-up in Talk always carries what the person asked; tool steps are what gets cut (#17804) 7af0ffd
2 earlier comments
Talk's context meter now reads the window of the model that answered, and an unknown model shows no percentage. I ran the new test and the six existing Talk and conversation suites that touch the meter, plus tsc: all pass. I did not run the full suite, and I did not start the app.
- Table:
src/crew/model_windows.tsholds one window per model id and exposeswindowOf(model), which ignores avendor/prefix and returns undefined for an id it doesn't list. - Meter:
contextOfinsrc/core/conversation_cost.tstakes the window the run reported, else the table's value for the run's model. If neither knows it, there is no window and no share. - Words: an unknown model reads "Context 200k tokens", with no percentage. A known one reads the same as before, for example "20% full (200k of 1M tokens)".
- Removed: the old blanket 200k fallback (
CONTEXT_TOKENS) is gone. - Doors: the terminal prints the same
contextTextas the page, so it shows the same words. I added a "The context meter" section todocs/features/talk.md. - Test:
test/model-windows.test.tschecks that a 1M-window model at 200k tokens reads 20% and an unknown model reads no percentage. It also covers the table lookup and that a window the run reported wins over the table. - Script size: the client script is untouched; the figure is computed on the server.
- Reuse: I extended
contextOfandcontextTextrather than adding new functions, so I didn't runbun scripts/similar.ts.
Left out: the table lists only models I'm sure of: Claude 4.5 (200k), GPT-4o and 4.1, and Gemini 2.5. The Claude 5 family isn't in it because I don't know those windows. Until they're added, a conversation answered by one shows tokens only, unless the run reports its own window. Adding one is a single line. The page's head meter bar (shown from 60%) also stays hidden when the model is unknown.
Try it: open /talk/<id> for a conversation answered by a model that isn't in the table. The conversation menu should read "Context 200k tokens" with no percent.
🤖 Generated with Claude Code
The default models now get a meter, and the "full" rules no longer depend on knowing the model's window. The new test, talk-fresh-say, talk-page and crew-resume pass and tsc is clean. I did not run the full suite.
- Default models (point 1):
src/crew/model_windows.tsnow listsclaude-fable-5-1,claude-fable-5-2,claude-opus-5-5,claude-sonnet-5-5,claude-haiku-5-5and the aliasesopus,sonnet,haiku. A window the run reports still outranks the table. - Unconfirmed windows: I set every Claude entry to 200k, Claude Code's standard window, and did not confirm any of them. If Fable or a 5.x model is really 1M, those lines are wrong until corrected. Please check them.
- Full rules (point 2): a new
fullness()insrc/core/conversation_cost.tsreturns the real share, or tokens against 200k when the window is unknown.startsFreshandcarryOninsrc/crew/conversation.tsuse it, so an unknown model still starts fresh and carries on at 85%. Only the meter stays blank for an unknown model. - Tests (points 2 and 3):
talk-fresh-sayhas two new cases where the run reports no window, one onsonnetand one on an unknown model. Both start fresh.model-windows.test.tschecks the head meter on the page. It shows forsonnetat 150k tokens, is absent at 50k, and is absent for an unknown model.model-windows.test.tsalso checks the token fallback infullness.
- Smaller: I split the
contextTextternary over lines.
Try: open a /talk conversation answered by sonnet and past 60% context. The head shows the meter, and the same conversation on an unlisted model shows "Context 170k tokens" with no meter.
🤖 Generated with Claude Code
The check failed on a duplicate import in test/model-windows.test.ts: it imported ../src/core/conversation_cost.ts twice. I merged them into one import and pushed.
test/model-windows.test.ts and test/dup-imports.test.ts pass, and tsc is clean. I did not rerun the full suite.
The pull still does what the last description said. The meter reads the answering model's window, the default Claude models are in the table, and the fresh-session and carry-on rules fall back on token count when a window is unknown. The 200k windows for the Claude models are still unconfirmed, so someone should check them.
🤖 Generated with Claude Code
Talk's context meter now reads the window of the model that answered, and an unknown model shows no percentage. I ran the new test and the six existing Talk and conversation suites that touch the meter, plus
tsc: all pass. I did not run the full suite, and I did not start the app.src/crew/model_windows.tsholds one window per model id and exposeswindowOf(model), which ignores avendor/prefix and returns undefined for an id it doesn't list.contextOfinsrc/core/conversation_cost.tstakes the window the run reported, else the table's value for the run's model. If neither knows it, there is no window and no share.CONTEXT_TOKENS) is gone.contextTextas the page, so it shows the same words. I added a "The context meter" section todocs/features/talk.md.test/model-windows.test.tschecks that a 1M-window model at 200k tokens reads 20% and an unknown model reads no percentage. It also covers the table lookup and that a window the run reported wins over the table.contextOfandcontextTextrather than adding new functions, so I didn't runbun scripts/similar.ts.Left out: the table lists only models I'm sure of: Claude 4.5 (200k), GPT-4o and 4.1, and Gemini 2.5. The Claude 5 family isn't in it because I don't know those windows. Until they're added, a conversation answered by one shows tokens only, unless the run reports its own window. Adding one is a single line. The page's head meter bar (shown from 60%) also stays hidden when the model is unknown.
Try it: open
/talk/<id>for a conversation answered by a model that isn't in the table. The conversation menu should read "Context 200k tokens" with no percent.🤖 Generated with Claude Code
Closes #17826