Skip to content

fix(cli): abort headless streams on SIGINT - #13070

Open
d3f4w2 wants to merge 1 commit into
continuedev:mainfrom
d3f4w2:fix/12701-cancel-late-tools
Open

fix(cli): abort headless streams on SIGINT#13070
d3f4w2 wants to merge 1 commit into
continuedev:mainfrom
d3f4w2:fix/12701-cancel-late-tools

Conversation

@d3f4w2

@d3f4w2 d3f4w2 commented Jul 31, 2026

Copy link
Copy Markdown

Description

Fixes the headless CLI cancellation gap reported in #12701.

The active provider stream now receives an abort signal synchronously when the process receives SIGINT. This prevents delayed provider chunks from reaching tool-call handling while the process-level shutdown handler is still awaiting cleanup. The temporary signal listener is removed after both successful and failed requests.

The TUI signal path is unchanged.

Closes #12701.

AI assistance disclosure: I used an AI coding assistant to help trace the cancellation flow and prepare the patch. I reviewed the changes and ran the validation below.

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

Not applicable; this fixes headless process cancellation behavior.

Tests

  • npm test -- --run src/util/withSigintAbort.test.ts src/stream/streamChatResponse.test.ts — 10 passed, 6 skipped
  • Full CLI suite — 1,673 passed, 49 skipped; one unrelated TUI timing assertion failed once and then passed 27/27 on an isolated rerun
  • npm run build
  • ESLint and Prettier checks on all changed files
  • git diff --check

@d3f4w2
d3f4w2 requested a review from a team as a code owner July 31, 2026 08:12
@d3f4w2
d3f4w2 requested review from sestinj and removed request for a team July 31, 2026 08:12
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.

Continue can execute a tool effect after SIGINT cancellation

1 participant