Skip to content

fix(agent-status): preserve Claude pending work - #10998

Closed
tianyilt wants to merge 1 commit into
stablyai:mainfrom
tianyilt:agent/fix-claude-pending-stop-state
Closed

tianyilt wants to merge 1 commit into
stablyai:mainfrom
tianyilt:agent/fix-claude-pending-stop-state

Conversation

@tianyilt

@tianyilt tianyilt commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #10997.

What changed

  • keep Claude Stop in working while a shell or monitor background task is still running
  • preserve waiting across Stop for unresolved permission requests
  • map plan-mode Stop to waiting until the plan is confirmed
  • keep explicit interrupted Stops terminal (done + interrupted)
  • add regression coverage for each state transition

Before / after

The same sanitized Claude hook payload was posted to Orca 1.4.156 and to this branch.

Before: incorrectly completed After: remains working
Before: green completed indicator After: yellow working indicator

The installed build returned state: "done" while Claude reported 1 shell, 1 monitor still running; this branch returns state: "working" for the identical payload.

Why

Claude emits Stop at a lead-turn boundary, not necessarily at true task completion. The normalizer previously mapped that event directly to done, and its background-task parser discarded non-agent task types. Permission and plan waits could likewise be overwritten by the following Stop.

Verification

  • pnpm exec vitest run src/shared/agent-hook-listener.test.ts src/shared/claude-subagent-roster.test.ts — 155 passed
  • pnpm run typecheck:node
  • directed oxlint on the four changed TypeScript files
  • pnpm run check:max-lines-ratchet
  • pnpm run build:electron-vite
  • manual stable-vs-local hook replay with the screenshots above

@nwparker

nwparker commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded by #11838, which cites this as a prior attempt and lands the background-task portion of #10997 (keep Claude working while provider background shells/monitors run across Stop).

If plan-mode / permission waiting across Stop is still wrong on current main, please open a focused follow-up rather than rebasing this whole branch — #10997 is still open for that remainder.

@nwparker nwparker closed this Aug 3, 2026
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.

[Bug]: Claude Stop marks pending monitors, shells, approvals, and plans as completed

3 participants