fix: hide detached broker window on Windows - #451
Conversation
|
The Worth folding in while you're in here: there's a third spawn site with the same problem that neither #440 nor #441 covers. spawnSync(process.execPath, [scriptPath, "task", "--json", prompt], {
cwd, env: childEnv, encoding: "utf8", timeout: STOP_REVIEW_TIMEOUT_MS
});and no |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d028ce9c5f
ℹ️ 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 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 address that feedback".
| process.stderr.write(`${message}\n`); | ||
| process.exitCode = 1; | ||
| function isMainModule() { | ||
| return process.argv[1] ? import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href : false; |
There was a problem hiding this comment.
Resolve symlinks when identifying the hook entrypoint
When stop-review-gate-hook.mjs is invoked through a symlinked ${CLAUDE_PLUGIN_ROOT}—for example, a locally linked plugin checkout—Node resolves import.meta.url to the real target while path.resolve(process.argv[1]) retains the symlink path. This comparison then returns false, causing the hook to exit successfully without consuming its input or running an enabled stop review, silently bypassing the gate. Compare canonical real paths or keep the executable entry module unconditional.
Useful? React with 👍 / 👎.
Summary
windowsHide: trueto the detached broker spawn path.Fixes #440.
Test plan
node --test tests/broker-lifecycle.test.mjsgit diff --checknpm testnpm run build