Retry a failed fleet worker with a changed brief - #853
Conversation
TheGreatAxios
left a comment
There was a problem hiding this comment.
CL-7538 mostly holds at b2f24bd8. Fail / incomplete-report invite one changed-brief successor; operator-cancel waits; interrupt_agent is resume, not a successor spawn; in-flight wait JSON includes stop_reason: interrupted. Runtime still does not auto-spawn.
Should-fix: send_input interrupt:true re-stamps session.stopReason = "interrupted" after beginFollowupTurn clears it (src/subagent/session-store.ts). Follow-up success mutates to completed and never deletes that stamp, so a later wait_agents returns { status: "done", stop_reason: "interrupted" }. Skywalker treats that as resume-not-complete. resume_agent success already clears this; send_input interrupt success should too.
Please add: send_input({ interrupt: true }) → follow-up fulfills → wait is done with stop_reason undefined.
TheGreatAxios
left a comment
There was a problem hiding this comment.
Verdict: comment.
CL-7538 mostly holds at b2f24bd8. Fail / incomplete-report invite one changed-brief successor; operator-cancel waits; interrupt_agent is resume, not a successor spawn; in-flight wait JSON includes stop_reason: interrupted. Runtime still does not auto-spawn.
Should-fix: send_input interrupt:true re-stamps session.stopReason = "interrupted" after beginFollowupTurn clears it (src/subagent/session-store.ts). Follow-up success mutates to completed and never deletes that stamp, so a later wait_agents returns { status: "done", stop_reason: "interrupted" }. Skywalker treats that as resume-not-complete. resume_agent success already clears this; send_input interrupt success should too.
Please add: send_input({ interrupt: true }) → follow-up fulfills → wait is done with stop_reason undefined.
aa38051 to
996aea1
Compare
996aea1 to
b7235c9
Compare
b7235c9 to
ecb041b
Compare
ecb041b to
e18c2ae
Compare
After 0.3.15 the parent idled on fail and incomplete-report as if the operator had cancelled. Fail-path salvage now invites one successor with a changed brief; operator-cancel still waits; identical briefs stay refused at the prompt layer.
interrupt_agent flipped wait to interrupted while the run was still in flight, so wait JSON omitted stop_reason. Skywalker classifies interrupted-incomplete only on that field.
A successful resume kept the prior interrupt stamp, so wait_agents returned done with stop_reason interrupted. That looked like interrupted-incomplete and could start another successor.
A parent-initiated pause unblocks wait with stop_reason interrupted while the worker is often still live. Inviting spawn_agent on that stamp collided with resume_agent. Failed and incomplete-report stay on the one-successor path; operator-cancel still waits.
send_input with interrupt:true already unblocked wait_agents as interrupted, but only the overlay flipped. Stamp session.stopReason after the follow-up queues so that wait JSON includes stop_reason interrupted, matching interrupt_agent.
send_input interrupt restamps interrupted for in-flight wait; a completed follow-up must not keep that stamp on done.
The leftover interrupted stop_reason coverage is send_input behavior. Keep it next to the other send_input cases so resume_agent does not own that contract.
e18c2ae to
fcdd49d
Compare
Summary
Verification
bun run typecheck,bun run build, andbun run testpassFixes CL-7538