Panic in the turn completion path: tokio oneshot "called after complete" fires once per timed-out turn #282
Loading…
Reference in a new issue
No description provided.
Delete branch "claude/wi-019fb9d6-panic-in-the-turn-completion-path-tokio"
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?
Anima work item
019fb9d6-de2a-71b1-9911-782b1677c076.Symptom
Observed on
akh-thoth, image0fc0416b257d(built from53c5b86), during thefirst tecton turn after #279 was deployed. One occurrence, mid-turn. The
process survived — the panicking worker died, the daemon kept running and the
learning daemon kept ticking either side of it.
Why it is almost certainly #279
oneshot.rs:1289called after completeis a oneshot used twice:send(ora completion poll) after the channel has already resolved. #279 introduced
exactly that shape — an explicit completion signal from the turn worker plus a
recv_timeoutselect in the drain loop, replacing the previous "wait for everyChannelSinksender clone to drop". Before that merge this panic did not appearin the daemon log.
Candidate paths to audit:
done_tx/done_rxoneshotaround the turn worker (
src/acp/mod.rs, thetokio::spawnthat awaitshandleand relays the join result)turn was killed by the runner's 3600s budget cap, so cancellation and normal
completion may both fire.
Context — the turn it happened in
Session
019fb977-d7ff-70f3-b89f-d15f18566c65, workspacetecton, WI-259.Started 18:37:46, killed 19:38:00 by the 3600s budget cap
(
{"outcome":"failed","stop_reason":"cancelled"}). The panic landed at 19:25:56,about 48 minutes in — not aligned to either the turn start or the cap, so it
is not simply "cancellation raced completion at the deadline".
Note the idle watchdog did not fire in this turn (
grep -c "chat turn stalled"= 0), which is #279 working as intended. This item is only about thepanic.
Required
cancellation, must be a no-op rather than a panic. Prefer a type that cannot
be misused twice over a
debug_assert.the drain loop terminates without panicking.
tokio-runtime-workershould be visible as more than a bare stderrline — it currently carries no session id, no workspace, no context. Whoever
fixes this should leave enough breadcrumb that the next one is greppable.
Acceptance
called after completepanic across a run that includes at least onecancelled turn and one normally-completed turn.
ab0403440e408ff35b4eWIP: Panic in the turn completion path: tokio oneshot "called after complete" fires once per timed-out turnto Panic in the turn completion path: tokio oneshot "called after complete" fires once per timed-out turn