The spine names a dead attempt's tool call as running #73
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?
Problem
The spine and the digest name a tool call as running when its session is dead. Seen on production minutes after #71 deployed:
bd3902frestarted osfd at 01:07 whileopenspec.apply[4]ofrun_01M3GB3KN38YT9TZJ7KA7RQ5M0was in attempt 1. Attempt 1's session had just started abashcall: part…PWI9u4, whose one and only record ispendingat 01:06:59 with input{}.bashcalls./api/stream, 270 digest frames for the step saidrunning_tool: bash,running_target: "", withrunning_for_sclimbing to 133 s. That's 01:06:59 plus 133 s, so the frames were counting attempt 1's dead call, and they showed it whenever attempt 2 had nothing in flight of its own.Cause
The digest keeps one fold per step, across attempts:
_backfillreads the step's recent rows, andon_commitappends every event.derive_activityhands the whole fold torunning_tool_call, which takes the newest part stillpending/running. A part whose session died never gets another record, so it stays in flight for good.The watchdog's
_tool_in_flightreadsWHERE step_id = ? AND attempt = ?, so the stall redo is not affected.Proposal
running_tool_call(orderive_activitybefore it) considers only the tool parts of the newest attempt in the events it's given. A dead session's call inside the same attempt (a budget respawn) is worth covering in the same change if it's cheap: the respawn names the session that took over.Done when
pendingpart followed by attempt-2 events and gets no running tool (or attempt 2's own).Fixed and live on production (
9ae119c, deployed 2026-10-03).What changed
running_tool_calltakes only the newest attempt's own tool calls (the attempt the caller names, else the newest in the rows it is given), and none from before the newest budget respawn of that attempt.How it was checked
openspec.apply[4]ofrun_01M3GB3KN38YT9TZJ7KA7RQ5M0, 6,320 log rows): the old code namedbashwithrunning_for_sclimbing for 133 s into attempt 2; the new code names nothing ("Thinking") at 10 s, 60 s and 133 s. The same replay through the deployed code in production's container gives the same answer.Change record:
openspec/changes/archive/2026-10-03-running-tool-of-newest-attempt.