Repository navigation
fix(cli): end the turn when a kiro hook script crashes - #1373
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Kiro, a hook script that crashes (exit 1) made Kiro continue the turn, and a crashing
Stopscript 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, withaidd: hook script failed: <path>on stderr.Stophook's exit 1 (probed).expected [ 1, '' ] to strictly equal [ +0, '' ]for SessionStart, PostToolUse and Stop before the fix, andexpected [ +0, ... ] to strictly equal [ 2, '', 'not this file' ]for the refusal pass-through.framework-build/golden.json, because the generated launcher text changed.Follow-up to #1363.
🤖 Generated with Claude Code