Repository navigation
Closed
Labels
Description
What problem does this solve?
The footer of the TUI shows folder · session · model · effort · context used / window (%) · tokens. A graphical client needs the same line. GET /sessions/{id}/status returns only {id, entries, busy, usage_report}:
- No model, no reasoning effort, no context window and no session name. The model and effort are session registers in the log (
fact/model,fact/reasoning_effort), but no route reads them, and the context window is not exposed at all (usage_reportcarries token counts, not the window). - While a turn runs,
entriesandusage_reportarenull(the session storage is held by the turn), so a footer built on this route goes blank exactly when the user is watching the session work.
Found while writing the screen inventory for #561 (screen 6, gap B). It blocks the status footer of every remote client (#527, #528, #529).
Proposed solution
Add fields to GET /sessions/{id}/status. The change is additive and clients already ignore unknown fields (docs/mobile-control.md).
model,effort,contextWindow(and the used count, if the TUI footer computes it from the same snapshot),name: the same values the TUI footer gets from thetole statussnapshot (feat(cli): session status snapshot — model, effort, context used/window, tokens #458; seeTuiSession::status_linesandstatus.rs), so both faces cannot disagree.nullfor anything unknown, never a made-up value (the ruleusage_reportalready follows).- A last-known snapshot, refreshed when a turn settles and when a register changes, that the route returns while a turn is running, together with a
snapshotAt(or astale: trueflag) so a client can tell it is not live. This replaces thenullwhile busy.
Alternatives considered
- Make clients read
fact/modeland friends fromGET /sessions/{id}/entries: works for the registers, but not for the context window, and every client would parse registers differently. - Take the storage lock briefly during a turn: the route deliberately does not (a turn holds the lock for a whole model call), so this would bring back the blocking problem fixed in the 2026-09-28 scan.
Acceptance criteria
-
GET /sessions/{id}/statusincludesmodel,effort,contextWindowandnamefor an idle session, equal to whattole statusshows for the same session; a test compares the two. - While a turn is running the route answers promptly with the last snapshot (not
null) and says it is a snapshot; a test with a slow mock provider proves it does not block. - Unknown values are
null, covered by a test (for example a session with no window detected). - Existing fields keep their meaning;
docs/mobile-control.mdand the CHANGELOG are updated in the same PR.
Activity