mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-15 20:40:35 -07:00
repro: always parse JSON from hook output regardless of exit code
This commit is contained in:
@@ -97,9 +97,14 @@ describe('Hooks System Integration', () => {
|
||||
);
|
||||
|
||||
const blockMsg = 'File writing blocked by security policy';
|
||||
const blockJson = JSON.stringify({
|
||||
decision: 'deny',
|
||||
reason: blockMsg,
|
||||
});
|
||||
|
||||
const scriptPath = rig.createScript(
|
||||
'stderr_block_hook.cjs',
|
||||
`process.stderr.write('${blockMsg}'); process.exit(2);`,
|
||||
`process.stderr.write(JSON.stringify({ decision: 'deny', reason: '${blockMsg}' })); process.exit(2);`,
|
||||
);
|
||||
|
||||
rig.setup(
|
||||
|
||||
Reference in New Issue
Block a user