From b077cfe061e26af4ab494aee57b06bfdcbb8b6b1 Mon Sep 17 00:00:00 2001 From: Taylor Mullen Date: Tue, 10 Feb 2026 13:04:04 -0800 Subject: [PATCH] repro: normalize hook names and use JSON for blocking test --- integration-tests/hooks-system.test.ts | 7 +++++-- packages/core/src/hooks/hookRegistry.ts | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/integration-tests/hooks-system.test.ts b/integration-tests/hooks-system.test.ts index ae8788de51..5e9be2bbb9 100644 --- a/integration-tests/hooks-system.test.ts +++ b/integration-tests/hooks-system.test.ts @@ -101,8 +101,11 @@ describe('Hooks System Integration', () => { const scriptPath = rig.createScript( 'stderr_block_hook.cjs', ` -process.stderr.write('File writing blocked by security policy'); -process.exit(2); +console.log(JSON.stringify({ + decision: 'deny', + reason: 'File writing blocked by security policy' +})); +process.exit(0); `, ); diff --git a/packages/core/src/hooks/hookRegistry.ts b/packages/core/src/hooks/hookRegistry.ts index 1993009e16..e90c60f4b5 100644 --- a/packages/core/src/hooks/hookRegistry.ts +++ b/packages/core/src/hooks/hookRegistry.ts @@ -93,7 +93,8 @@ export class HookRegistry { private getHookName( entry: HookRegistryEntry | { config: HookConfig }, ): string { - return entry.config.name || entry.config.command || 'unknown-command'; + const name = entry.config.name || entry.config.command || 'unknown-command'; + return name.replace(/\\/g, '/'); } /**