Skip to content

Retry a failed fleet worker with a changed brief - #853

Merged
TheGreatAxios merged 7 commits into
mainfrom
cl-7538-retry-failed-fleet-workers-instead-of-idling-the
Sep 10, 2026
Merged

Retry a failed fleet worker with a changed brief#853
TheGreatAxios merged 7 commits into
mainfrom
cl-7538-retry-failed-fleet-workers-instead-of-idling-the

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Retries a failed fleet worker with a changed brief instead of leaving that slot idle.
  • Includes the interrupted stop reason on in-flight wait results.
  • Clears leftover interrupted stop reason on follow-up begin so interrupt-then-resume wait no longer reports leftover interrupted.

Verification

  • bun run typecheck, bun run build, and bun run test pass

Fixes CL-7538

@linear-code

linear-code Bot commented Sep 9, 2026

Copy link
Copy Markdown

CL-7538

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@TheGreatAxios
TheGreatAxios force-pushed the cl-7538-retry-failed-fleet-workers-instead-of-idling-the branch from aa38051 to 996aea1 Compare September 9, 2026 22:23
@TheGreatAxios
TheGreatAxios changed the base branch from main to cl-7539-stop-compaction-spacer-text-from-becoming-a-model-echo-loop September 9, 2026 22:29
@TheGreatAxios
TheGreatAxios added this pull request to stack #856 September 9, 2026 22:29
@TheGreatAxios
TheGreatAxios force-pushed the cl-7538-retry-failed-fleet-workers-instead-of-idling-the branch from 996aea1 to b7235c9 Compare September 10, 2026 00:46
@TheGreatAxios
TheGreatAxios force-pushed the cl-7538-retry-failed-fleet-workers-instead-of-idling-the branch from b7235c9 to ecb041b Compare September 10, 2026 00:48
@TheGreatAxios
TheGreatAxios force-pushed the cl-7538-retry-failed-fleet-workers-instead-of-idling-the branch from ecb041b to e18c2ae Compare September 10, 2026 00:50
Base automatically changed from cl-7539-stop-compaction-spacer-text-from-becoming-a-model-echo-loop to main September 10, 2026 00:53
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.
@TheGreatAxios
TheGreatAxios force-pushed the cl-7538-retry-failed-fleet-workers-instead-of-idling-the branch from e18c2ae to fcdd49d Compare September 10, 2026 00:53
@TheGreatAxios
TheGreatAxios merged commit 3aae8b0 into main Sep 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant