Skip to content

Drop interrupted workers from live agents - #712

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-7175-drop-interrupted-workers-from-the-live-agents-list
Aug 28, 2026
Merged

Drop interrupted workers from live agents#712
TheGreatAxios merged 3 commits into
mainfrom
cl-7175-drop-interrupted-workers-from-the-live-agents-list

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Drops interrupted workers from the live Agents strip after the same linger window as done, failed, and cancelled
  • Stops sticky clocks and fleet-running counts from treating an interrupted worker as live while leftover tools may still be running
  • Keeps cancelled linger painted as cancelled, not interrupted

Verification

  • bun test src/tui/chrome-state.test.ts passes, including cancelled-linger and interrupted linger/drop cases
  • bun run check passes

Fixes CL-7175

@linear-code

linear-code Bot commented Aug 28, 2026

Copy link
Copy Markdown

CL-7175

@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.

lens: critic
verdict: clean

This branch drops interrupted workers from the live agents list after the linger window and keeps leftover tools from pinning a running slot. The cancelled-linger wording regression found on the first pass is fixed. I found no remaining blocking or should-fix defects.

@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.

Review · Request changes

Stamps finishedAt on interrupt and adds agentLaneIsLive() so the agents strip, sticky poll, and fleet roll-up treat status:"running" + lifecycleStatus:"interrupted" as a lingering row that drops after 4s.

Findings

  • src/subagent/session-store.ts:1021 / :1030-1057 + src/tui/agent-progress.ts:132interruptOne stamps finishedAt and leaves lifecycleStatus:"interrupted", but followupOne (and the sendInputOne interrupt path at :972-1000) runs the new worker turn without flipping lifecycle back to "running" or clearing finishedAt (only resumeOne at :1076 does, gated to "completed"). During the follow-up turn the session is running/interrupted/finishedAt=<interrupt time>, so once now - finishedAt >= 4000: formatAgentsPanelnull, agentsChromeNeedsStickyfalse, fleetProgress.running0, while tool events are still arriving. Reproduced (interruptOne → pending followupOneappendEvent(tool_call.start) at t+9s): branch prints panel: null, sticky: false, fleet.running: 0; main shows the lane ● explorer d · interrupted · run_shell still running. This is the interrupt_agentfollowup_task / send_input {interrupt:true} flow exposed by lifecycle-tools.ts:261,319,392. On followup start, mutate lifecycle to "running" and drop finishedAt the way resumeOne does, then let the existing .then re-stamp on completion (check isSoftInterrupted in agent-fleet.ts:799-811 first).
  • src/subagent/agent-fleet.test.ts:925-968 — the new test passes with session-store.ts, agent-fleet.ts, and lifecycle-tools.ts checked out from origin/main (bun test src/subagent/agent-fleet.test.ts -t "after interrupt_agent wait-status" → 1 pass), because list_agents status comes from fleetRecords, which interrupt_agent already flipped. It does not exercise this change.

Notes

  • s.finishedAt ?? now() keeps the second interruptOne from agent-fleet.ts:741 idempotent — correct.
  • Checks: bun run typecheck, bun run lint, bun test src/tui/chrome-state.test.ts src/tui/agent-progress.test.ts src/subagent/session-store.test.ts src/subagent/agent-fleet.test.ts src/subagent/lifecycle-tools.test.ts src/subagent/followup-live-agent.test.ts src/tui/shell.test.ts (169 pass).

send_input interrupt and followup_task clear finishedAt and set lifecycle
to running so the agents strip stays live through the new turn. Settling
an interrupted run no longer re-calls interruptOne, which would overwrite
a live follow-up's linger stamp.
@TheGreatAxios
TheGreatAxios force-pushed the cl-7175-drop-interrupted-workers-from-the-live-agents-list branch from ec3aa69 to 92f9c00 Compare August 28, 2026 22:12
sendFailureText rematched the #710 credential_failure line against
raw-provider auth patterns and replaced it with the generic other
copy. #711 tests still expected the pre-#710 session-expired string.
@TheGreatAxios
TheGreatAxios merged commit 092bb0e into main Aug 28, 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