Skip to content

fix(coding-agent): propagate cancellation to child prompts - #144

Merged
Issacboy123 merged 3 commits into
fix/cancel-prompts-before-startfrom
fix/propagate-child-prompt-signal
Aug 29, 2026
Merged

Issacboy123 merged 3 commits into
fix/cancel-prompts-before-startfrom
fix/propagate-child-prompt-signal

Conversation

@Issacboy123

@Issacboy123 Issacboy123 commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Controller cancellation could reach an attached child before agent_start without reaching the child's prompt preflight, leaving interruption or shutdown waiting indefinitely. This PR passes the controller run signal into the child prompt and coordinates cancellation across queued, startup-publication, and running states.

Reasoning

Reusing the controller's existing run signal closes the startup gap without adding a second cancellation protocol. Serializing each run's cancellation prevents the prompt signal and session abort paths from aborting the same child twice during agent_start publication. Clearing only a rejected cancellation attempt permits later shutdown or navigation to retry after a transient failure.

Changes

  • Passed each controller run's abort signal to AgentSession.prompt() for the child run.
  • Centralized run cancellation ownership across interrupts, quiescing, reset, and shutdown.
  • Prevented duplicate aborts during the window where the session is streaming but the controller has not published the running state.
  • Allowed a later cancellation attempt after an earlier session abort rejects, while sharing concurrent attempts for the same run.
  • Added regressions for pre-start interruption, startup publication races, active shutdown, and cancellation retry after transient quiesce failure.

Testing

  • node ../../node_modules/vitest/dist/cli.js --run test/suite/subagent-startup.test.ts test/suite/subagent-persistence.test.ts
  • node ../../node_modules/vitest/dist/cli.js --run test/suite/agent-session-prompt.test.ts test/suite/subagent-services.test.ts test/suite/subagent-registration.test.ts test/suite/subagent-coordination.test.ts test/suite/subagent-parent-messaging.test.ts test/subagent-controller.test.ts
  • npm run check

@Issacboy123 Issacboy123 added bug Something isn't working coding-agent labels Aug 28, 2026
@Issacboy123 Issacboy123 self-assigned this Aug 28, 2026
@Pepps233
Pepps233 force-pushed the fix/propagate-child-prompt-signal branch from 7052465 to 371f7b0 Compare August 29, 2026 03:50
@Pepps233
Pepps233 self-requested a review August 29, 2026 03:50
@Issacboy123
Issacboy123 merged commit 1c17465 into main Aug 29, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working coding-agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants