Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: Claude providers that pin a permission mode no longer also get the bypass flag (#10419)
Adam Eivy138601bb5d4b
diff --git a/server/lib/providerVendors.claudePermissionPosture.test.js b/server/lib/providerVendors.claudePermissionPosture.test.jsnew file mode 100644index 0000000000..a012ba67eb--- /dev/null+++ b/server/lib/providerVendors.claudePermissionPosture.test.js@@ -0,0 +1,24 @@+// #10419: a Claude provider that pins its own permission posture must not also+// get the default `--dangerously-skip-permissions`, which would override it.+import { describe, expect, it } from 'vitest';+import { buildVendorSpawnConfig } from './providerVendors.js';++const claude = (args) => ({ id: 'claude-code', type: 'cli', command: 'claude', args });+const spawnArgs = (provider) => buildVendorSpawnConfig(provider, { effectiveModel: null }).args;++describe('claude spawn permission posture', () => {+ it('keeps the default bypass when the provider pins no posture', () => {+ expect(spawnArgs(claude([]))).toContain('--dangerously-skip-permissions');+ });++ it.each([+ [['--permission-mode', 'auto']],+ [['--permission-mode=auto']],+ [['--dangerously-skip-permissions']],+ [['--allow-dangerously-skip-permissions']],+ ])('does not inject the bypass when args are %j', (args) => {+ const out = spawnArgs(claude(args));+ expect(out.filter((a) => a === '--dangerously-skip-permissions').length).toBe(args[0] === '--dangerously-skip-permissions' ? 1 : 0);+ for (const a of args) expect(out).toContain(a);+ });+});diff --git a/server/lib/providerVendors.js b/server/lib/providerVendors.jsindex 2db6d6dfe2..13dffecb84 100644--- a/server/lib/providerVendors.js+++ b/server/lib/providerVendors.js@@ -819,15 +819,23 @@ function claudeCliArgs(baseArgs, { model, effort, provider }) {return args;}+const CLAUDE_PERMISSION_POSTURE_FLAGS = [+ '--permission-mode', '--dangerously-skip-permissions', '--allow-dangerously-skip-permissions',+];+function claudeSpawnArgs(provider, { effectiveModel, effort, systemPromptFile, settingsEnv }) {const providerId = provider?.id || 'claude-code';+ const providerArgs = provider?.args || [];+ // A provider that pins its own permission posture (e.g. `--permission-mode auto`)+ // must not also receive the default bypass, which would override it (#10419).+ const hasPosture = argvHasFlag(providerArgs, CLAUDE_PERMISSION_POSTURE_FLAGS);const args = applyLeanClaudeArgs(provider, [- '--dangerously-skip-permissions',+ ...(hasPosture ? [] : ['--dangerously-skip-permissions']),'--print','--output-format', 'stream-json','--verbose','--include-partial-messages',- ...(provider?.args || []),+ ...providerArgs,], provider?.command || 'claude');if (systemPromptFile) {args.push('--append-system-prompt-file', systemPromptFile);