Skip to content

fix(cli): end the turn when a kiro hook script crashes - #1373

Merged
blafourcade merged 2 commits into
nextfrom
fix/kiro-stop-crash-ends-turn
Nov 25, 2026
Merged

blafourcade merged 2 commits into
nextfrom
fix/kiro-stop-crash-ends-turn

Conversation

@blafourcade

Copy link
Copy Markdown
Contributor

Summary

On Kiro, a hook script that crashes (exit 1) made Kiro continue the turn, and a crashing Stop script could keep doing so on every turn end. The one launcher that runs every Kiro hook command now passes exit 0 and exit 2 (a deliberate refusal, reason on stderr) through unchanged. It turns any other status or a signal into exit 0, with aidd: hook script failed: <path> on stderr.

  • Host fact: kiro-cli 3.6.0 continues the turn on a Stop hook's exit 1 (probed).
  • Red lines: expected [ 1, '' ] to strictly equal [ +0, '' ] for SessionStart, PostToolUse and Stop before the fix, and expected [ +0, ... ] to strictly equal [ 2, '', 'not this file' ] for the refusal pass-through.
  • Mutation proof: dropping the exit-2 pass-through turns only the refusal test red. Passing every status through turns only the three crash tests red.
  • Goldens moved: the five Kiro hooks-routes fixtures and the Kiro flat cell of framework-build/golden.json, because the generated launcher text changed.

Follow-up to #1363.

🤖 Generated with Claude Code

blafourcade and others added 2 commits November 25, 2026 20:47
Kiro continues a Stop turn when the hook command exits 1, so a crashing script kept the turn going. The launcher now exits 0 whatever the script returns and reports a failure on stderr; a deliberate continuation stays the block decision printed on stdout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Exit 0 and exit 2 pass through the launcher, so a script's refusal reaches Kiro; any other status or a signal is a crash and exits 0, so the turn ends instead of continuing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@blafourcade
blafourcade marked this pull request as ready for review November 25, 2026 19:52
@blafourcade
blafourcade requested a review from a team as a code owner November 25, 2026 19:52
@blafourcade
blafourcade merged commit 6d32521 into next Nov 25, 2026
5 checks passed
@blafourcade
blafourcade deleted the fix/kiro-stop-crash-ends-turn branch November 25, 2026 19:52
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