Skip to content

fix(hooks): deliver detached Claude failure and permission events - #764

Merged
Kuddev merged 3 commits into
mainfrom
fix/claude-tty-delivery-540-20261025
Oct 25, 2026
Merged

Kuddev merged 3 commits into
mainfrom
fix/claude-tty-delivery-540-20261025

Conversation

@Kuddev

@Kuddev Kuddev commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Result

Fixes #540. Interactive Claude hooks started without a controlling terminal can return their authenticated OSC event through the supported terminalSequence JSON 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/tty use 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 terminalSequence in 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

  • A real detached subprocess running the production bridge first failed on the previous implementation with empty stdout, then passed for permission/failure events and invalid-token rejection.
  • 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.
  • GPUI product cargo check --locked -p nebula --bin pebrel --features gpui-shell --tests --config .github/ci-profile.toml --profile ci: passed.
  • Architecture, Python compilation, prohibited-name and whitespace checks passed. No physical WSL/Claude acceptance is claimed by the detached Linux process test; required current-head CI remains separate.

@Kuddev
Kuddev merged commit e0c24ec into main Oct 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S ≤100 行源码改动

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 交互式 Claude 在 WSL 中的失败/权限 hook 通知丢失

1 participant