fix(ci): Node 22 + EPIPE in hooks dispatcher + bash cwd test regex#8
Merged
Conversation
CI on Ubuntu was failing on commits b70c0e1 and febfa30 with three real (non-flaky) issues: 1. GlobTool tests failed because fs.promises.glob was added in Node 22 but CI used Node 20. Bumped engines.node to >=22 across all packages + .nvmrc + workflow setup-node version. Node 22 has been LTS since Oct 2024, so this is reasonable. 2. HookDispatcher tests intermittently failed with EPIPE because child processes that don't read stdin close the pipe before our write completes. Added stdin error listener + try/catch around write/end to swallow EPIPE/EBADF cleanly. 3. BashTool 'runs in the given cwd' test had a regex bug: escaping step ran AFTER inserting `(/private)?` so the parens/question-mark got literally escaped instead of staying as regex syntax. Replaced with a simpler suffix-substring check that works on both platforms. Verified locally (Node 24 → behaviour equivalent to Node 22): pnpm test → 258 passed / 4 skipped / 0 failed pnpm typecheck → green pnpm format:check → conformant Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Three real CI failures from M5/M7 merges on Ubuntu runner. Fixes:
GlobToolrequires Node 22+ (fs.promises.glob). Bumped engines.node + workflow node-version + .nvmrc to 22.HookDispatcherEPIPE when child closes stdin first — added error listener + try/catch.BashToolcwd test regex escaping bug — replaced with a simpler suffix check.All 258 tests pass locally.
release-notes:fix.Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com