Skip to content

Fix Windows hook stalls caused by daemon handle inheritance - #152

Merged
Stephen Belanger (Qard) merged 2 commits into
mainfrom
fix/windows-daemon-hook-pipes
Oct 7, 2026
Merged

Stephen Belanger (Qard) merged 2 commits into
mainfrom
fix/windows-daemon-hook-pipes

Conversation

@Qard

Copy link
Copy Markdown
Collaborator

Summary

Fix SDK-495. On Windows, a hook's detached bt daemon inherited the write ends of the hook's stdout and stderr pipes. Codex waited for EOF after the hook process exited and remained stuck until the daemon was killed.

Launch the Windows daemon with CreateProcessW and an explicit inherited handle list containing only its NUL stdin and log stdout/stderr handles. Keep the existing Unix launch behavior. Add a Windows regression test that requires hook pipe EOF while the daemon remains alive.

Validation

  • Windows ARM64 VM: regression test passed (cargo test --locked --features cli --lib daemon_does_not_hold_hook_output_pipes).
  • Windows ARM64 VM: built bt with this patch and ran a real authenticated Codex 0.160.1 session with the installed Codex plugin. SessionStart, UserPromptSubmit, and Stop hooks all completed, Codex exited 0, and the daemon accepted all three events.
  • cargo fmt --manifest-path bt-daemon/Cargo.toml --check and git diff --check passed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: beb87cbd8b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread bt-daemon/src/subprocess/windows_daemon.rs Outdated
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T18:18:55.051829Z beb87cb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Qard
Stephen Belanger (Qard) merged commit cccf8d0 into main Oct 7, 2026
20 checks passed
@Qard
Stephen Belanger (Qard) deleted the fix/windows-daemon-hook-pipes branch October 7, 2026 09:27
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.

2 participants