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, '/'); } /**