fix(installer): guard .sh hook registration with fs.existsSync before writing settings.json (#1823)

Before registering each .sh hook (validate-commit, session-state, phase-boundary),
check that the target file was actually copied. If the .sh file is missing (e.g.
omitted from the npm package as in v1.32.0), skip registration and emit a warning
instead of writing a broken hook entry that errors on every tool invocation.

Closes #1817

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-04-05 17:49:20 -04:00
committed by GitHub
parent e881c91ef1
commit b185529f48
3 changed files with 79 additions and 7 deletions

View File

@@ -226,7 +226,7 @@ describe('agent files use inline @-reference wiring at decision points', () => {
assert.equal(
reqReadingContent.includes(wiring.refFile),
false,
`${agent}.md puts ${wiring.refFile} inside a <required_reading> block — should use inline @-reference wiring instead`
`${agent}.md puts ${wiring.refFile} inside a <required_reading> block — thinking-model references must use inline @-reference wiring at decision points, not <required_reading> blocks`
);
});
});