Commit Graph
1 Commits
Author SHA1 Message Date
yetoneandggbdpq 2dac9b84eb routing: a session's context line is its conversation's, not whatever asked under it
The Routing page's context window card drew every request the session id
went under into one "This session" line — the lead's turns, a subagent's
(298K against a lead holding at 96K–108K), and the agent's tool-less side
calls (a classifier, a title) — so the line rose and fell as though the
conversation kept compacting (WK-Apollo, #5561). The Usage page's Context
tab draws the same session by its turns alone (contextOfRecs, e98440ae):
the card's line draws by that attribution now — a subagent on a line of
its own, by its sub, and a side call reading its session's line without a
point of its own. The live strip of sessions read its numbers off
whatever asked last, so a subagent's 298K read as the session's; it reads
the session's own newest turn now. ctx-session-line draws the reporter's
interleaved session and the strip; it fails on the old code (8 points on
the lead's line, the strip at 298K).

Review edits: a prompt part of kind "tools" counts only with tokens > 0
(withTools, both places), so an empty tools part doesn't make a side
call read as a turn; ctx-session-line runs in Chromium and WebKit and
waits for the picked card's own Context used figure instead of 300ms,
clicking again when a click lands while the list redraws (one Chromium
timeout in that pick in 6 loaded runs before it; a card that never gets
there names what it shows).

Review run at this tree on origin/main ef81b7ad1 (mote-run, Playwright
1.62.0):
- ctx-session-line.test.cjs: 4 of 4 ok (chromium, webkit)
- routing-*, ctx-*, context-* (concurrency 4): 3419 pass, 29 fail;
  base ef81b7ad1 3423 pass, 21 fail. Every file with a new red
  (routing-ctx-sessions #4711, context-tune #5635, routing-rule-drag
  #3789, routing-wb-restricted #1905's class) run alone, patched:
  412 pass, 0 fail; base alone: rule-drag webkit en/zh/de and
  wb-restricted webkit de 1100 red. The rest are the base's (#5392,
  #4627, #3799, #4628, #3954/#4629, #5586); #5623 green this time.
- go test ./internal/gui/: ok but TestPanelHiddenByWailsMarksPageOutOfSight,
  red 1 of 3 alone at base too (#5322).
After rebasing on 83d9ee892/ea1a8ae80 (routing client.js changed), with
the pick retry: ctx-session-line alone 3 of 3 ok; ctx-session-line,
routing-ctx-*, ctx-*, context-* at concurrency 4, three runs: the new
file green in all; 690/0, 688/2, 688/2, the 2 being routing-ctx-sessions
chromium (#4711).
Broken by hand: main's client.js under the new test: 4 of 4 red, the
lead's line holding 8 points (96K, 298K, 96K, 7.2K, ...).
Not tried: the real app with WK-Apollo's session.

Reported-by: WK-Apollo
Co-authored-by: ggbdpq <ggbdpq@gmail.com>
2026-11-08 01:16:03 +08:00