[Bug] Persisted waking follow-up survives SIGKILL but remains idle after resume #374
andrew-stelmach-fleet
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
A waking
Agent.followup()can be durably persisted before SIGKILL, reconstructed byagents.resume(), and then remain indefinitely queued because the resumed agent starts idle and does not restore the wake obligation.Tested on
masterat47f943859bef60e4160492346772ded9b24f765a.Reproduction
I used two processes and the public agent/persistence APIs.
Process 1:
runMaintenance()so the driver cannot claim the message.agent.followup()withsurvive the crash. This is a waking operation and is latched while maintenance owns the phase.Process 2:
ctx.agents.resume(sessionId).Exact output:
The message survives and reconstructs correctly, but no turn starts and no model request occurs.
Expected behavior
An accepted waking follow-up that was durably recorded before process death should eventually execute after a successful resume, without requiring a second unrelated message.
Non-waking
inject()semantics should remain non-waking. A robust fix may therefore need durable wake intent, or at minimum an explicit rule that pendingnext-turninput wakes on cold resume.Root cause
ReactLoopAgentconstruction always initializes the phase as idle.followup()is documented to queue next-turn input and wake the driver.The current resume test covers deliberately non-waking
inject()state and requires a later follow-up to activate it. It does not cover a persisted waking follow-up:resume.spec.ts.Impact
A service restart, crash, machine reboot, or worker replacement can leave accepted durable user work parked forever while the resumed agent reports
idle. The user receives no failure and recovery requires a later unrelated wake.Acceptance criteria
followup/steerfrominject.This is distinct from Discussion #274, which reports a same-process driver-retirement race. Here the process dies while the wake is validly latched and cold resume loses the wake despite reconstructing the message. It is also distinct from #167, which requests a headless CLI resume entrypoint; this reproduction uses the existing programmatic resume successfully.
All reactions