fix(hive-mind): keep permission prompts on by default

The spawn --claude option declared dangerously-skip-permissions with default:true. The parser applies defaults, so a bare hive-mind spawn --claude always launched Claude Code with --dangerously-skip-permissions; the strict === true predicate could not help because the default made the flag true (#4832).\n\nSet the option default to false and state that the explicit flag is required. Explicit --dangerously-skip-permissions still enables skipping; --no-auto-permissions still denies it.\n\nRegression pins the spawn option default and explicit-flag contract; baseline fails both (default true, old description), candidate passes. Existing #2269 parser/predicate suite remains green (11/11 combined); tsc reports no errors in the touched files.
This commit is contained in:
马建彤 committed 2026-11-06 17:23:52 +08:00
1 parent 206e59259a
commit 8411d13ffe
2 files changed
+27 -2

No files matched your search

@@ -0,0 +1,25 @@
/**
* #4832: hive-mind spawn --claude passed --dangerously-skip-permissions by
* default because the option declared default:true. Permission skipping must
* require the explicit flag; --no-auto-permissions remains the opt-out.
*/
import { describe, expect, it } from 'vitest';
import { hiveMindCommand } from '../src/commands/hive-mind.js';
function spawnOption(name: string) {
const spawn = hiveMindCommand.subcommands?.find(sub => sub.name === 'spawn');
expect(spawn).toBeDefined();
return spawn!.options?.find(option => option.name === name);
}
describe('hive-mind spawn permission default (#4832)', () => {
it('does not skip Claude Code permission prompts unless explicitly requested', () => {
expect(spawnOption('dangerously-skip-permissions')?.default).toBe(false);
});
it('keeps the explicit flag available', () => {
const option = spawnOption('dangerously-skip-permissions');
expect(option?.type).toBe('boolean');
expect(option?.description).toMatch(/requires this explicit flag/i);
});
});
@@ -632,9 +632,9 @@ const spawnCommand: Command = {
},
{
name: 'dangerously-skip-permissions',
description: 'Skip permission prompts in Claude Code (use with caution)',
description: 'Skip permission prompts in Claude Code (use with caution; requires this explicit flag)',
type: 'boolean',
default: true
default: false
},
{
name: 'no-auto-permissions',