Step pane: context card and session chip ignore a budget respawn #57
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Seen on production run
run_01M3FS9FFXEHTY5WTHX36V4Z5Y, stepfix.implement(stp_01M3FS9JXBQJN4A21P8HBWMY0S), after attempt 1 hit the 196k alarm and respawned once.The engine did the right thing: the handoff happened, and a fresh session (
ses_f20430c…) carried on at about 28k and is growing normally. The step pane still reports the attempt as if nothing had changed. Two display problems:1. The context card shows the attempt's peak as though it were the current context
The graph row reads the live digest, which is the current session's context (28k). The step pane card, labelled "Attempt 1 · context 196k of 252k" with an orange bar at 78%, reads
budget_ledger.peak_input_tokensthroughreadingOf(ui/src/lib/budget.ts). That value is the attempt's high-water mark across every session it has had, and it never resets on a respawn (by design, seeon_respawninsrc/osf/engine/budget.py).The two panes then disagree (28k vs 196k), and the card reads as if the step were nearly full just after a respawn emptied it. "CONTEXT 196k" next to "ALARM 196k" makes it worse.
Want: while a step is running, the card shows the live reading of the current session, and it agrees with the graph row. The attempt's peak and its respawns stay visible, labelled as the peak.
2. The attempt's session chip names the retired session
The attempt row shows
session 5pj0YKlr, which is the pre-respawn session.attempt.session_idkeeps the first session id. The digest already followsosf.budget.respawnedto the session actually in use (_RESPAWNED_TO_SQLinsrc/osf/engine/digest.py), but the step pane does not.Want: after a respawn, the attempt chip names the session the attempt is actually using.
Shipped in #61 (
d8f447a) and archived asstep-pane-follows-respawn(2465b85).contextfield read the same live digest frame as the graph row, so the two now agree. The attempt's high-water mark is its ownpeakfield, with an ⓘ. A finished attempt that respawned labels its figurepeakrather thancontext.GET /api/steps/{id}gainscurrent_session_idon each attempt (the latestosf.budget.respawnedto_session,nullwithout one).session_idis unchanged, because recovery asks about it.step-detailsis updated with the running-after-respawn, finished-after-respawn and session-chip scenarios.