Repository navigation
fix(hooks): deliver detached Claude failure and permission events - #764
Merged
Merged
Conversation
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.
Result
Fixes #540. Interactive Claude hooks started without a controlling terminal can return their authenticated OSC event through the supported
terminalSequenceJSON field instead of silently losing failure and permission notifications.This isolates the notification-delivery fix proposed by @wyr-zal in #542. Automatic continuation from #541 is a separate feature and is not included.
Scope and compatibility
Only Claude and ENXIO from opening
/dev/ttyuse this fallback, before any terminal bytes have been written. Existing frame authentication, ordering, bounded payloads, provider isolation and partial-write cancellation remain. No dependency, setting, credential, real hook installation or retry-policy changes.The official Claude Code changelog documents
terminalSequencein version 2.1.141. Older clients and non-interactive/SDK modes that ignore this field are not covered. The causal note records the decision and attribution.Validation
python3 -m unittest scripts.tests.test_remote_hooks -v: 14 passed on Linux, including real PTY delivery, normal-TTY single delivery, provider/error isolation and partial-frame cancellation without stdout retry.cargo check --locked -p nebula --bin pebrel --features gpui-shell --tests --config .github/ci-profile.toml --profile ci: passed.