{"record":{"id":"2dc0c71dd4259f7a","repo":"ruvnet/ruflo","slug":"unattended-swarm-automation-is-disabled-set-swar","errorCode":null,"errorMessage":"unattended swarm automation is disabled; set [swarm.automation] enabled = true","messagePattern":"unattended swarm automation is disabled; set \\[swarm\\.automation\\] enabled = true","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/codex/src/dual-mode/cli.ts","lineNumber":63,"sourceCode":"      (val: string, acc: string[]) => { acc.push(val); return acc; },\n      [] as string[],\n    )\n    .option('--parallel-workers', 'Run --worker specs in parallel instead of chaining them sequentially', false)\n    .option('-c, --config <path>', 'Path to collaboration config JSON')\n    .option('--task <description>', 'Task description for the swarm')\n    .option('--max-concurrent <n>', 'Maximum concurrent workers (bounded by .agents/config.toml)')\n    .option('--timeout <ms>', 'Worker timeout in milliseconds (bounded by .agents/config.toml)')\n    .option('--namespace <name>', 'Shared memory namespace', 'collaboration')\n    .action(async (templateArg: string | undefined, options) => {\n      console.log(chalk.cyan('═══════════════════════════════════════════════════════════════'));\n      console.log(chalk.cyan.bold('  DUAL-MODE COLLABORATIVE EXECUTION'));\n      console.log(chalk.cyan('  Claude Code + Codex workers with shared memory'));\n      console.log(chalk.cyan('═══════════════════════════════════════════════════════════════'));\n      console.log();\n\n      const automation = loadSwarmAutomationConfig(process.cwd());\n      if (!automation.enabled) {\n        throw new Error('unattended swarm automation is disabled; set [swarm.automation] enabled = true');\n      }\n      const requestedConcurrency = options.maxConcurrent\n        ? parseInt(options.maxConcurrent, 10)\n        : automation.maxConcurrent;\n      const requestedTimeout = options.timeout\n        ? parseInt(options.timeout, 10)\n        : automation.agentTimeoutSeconds * 1000;\n      const config: DualModeConfig = {\n        projectPath: process.cwd(),\n        maxConcurrent: Math.min(requestedConcurrency, automation.maxConcurrent),\n        maxWriters: automation.maxWriters,\n        worktreeIsolation: automation.worktreeIsolation,\n        dependencyFailure: automation.dependencyFailure,\n        timeout: Math.min(requestedTimeout, automation.agentTimeoutSeconds * 1000),\n        maxOutputBytes: automation.maxOutputBytes,\n        policyPreflight: true,\n        sharedNamespace: options.namespace,\n      };","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/codex/src/dual-mode/cli.ts#L45-L81","documentation":"The dual-mode collaborative-execution command loads swarm-automation settings from .agents/config.toml in the current working directory via loadSwarmAutomationConfig(process.cwd()) and refuses to run when [swarm.automation] enabled is not true. This is a deliberate safety gate: unattended multi-worker automation (spawning Claude Code + Codex processes that write to your repo) must be opted into explicitly rather than running by default.","triggerScenarios":"(1) Running the dual-mode run/collaborate command in a project where .agents/config.toml has no [swarm.automation] table or enabled = false (the default); (2) running it from a subdirectory that does not contain .agents/config.toml — the config is resolved from process.cwd(), not the package root; (3) a typo in the TOML key so it never parses as the automation table.","commonSituations":"Fresh clones where the gate has not been enabled; CI jobs invoking the command without first provisioning the config; developers running from a nested folder (src/, packages/x) of a monorepo where cwd lacks the file.","solutions":["Add an explicit opt-in block to .agents/config.toml in the project root: `[swarm.automation]` then `enabled = true`.","Run the command from the directory that contains .agents/config.toml (config is read from process.cwd()).","While enabling, set the companion caps you actually want (maxConcurrent, maxWriters, agentTimeoutSeconds, worktreeIsolation) — the CLI clamps its flags to these values.","If automation is intentionally forbidden in this repo, use attended workflows instead of the unattended dual-mode command."],"exampleFix":"# before\n$ npx @claude-flow/codex dual-mode run feature \"add auth\"\nError: unattended swarm automation is disabled; set [swarm.automation] enabled = true\n\n# after — .agents/config.toml\n[swarm.automation]\nenabled = true\nmaxConcurrent = 4\nmaxWriters = 2\n$ npx @claude-flow/codex dual-mode run feature \"add auth\"","handlingStrategy":"validation","validationCode":"import { parse } from '@iarna/toml';\nimport { readFile } from 'node:fs/promises';\nfunction automationEnabled(cwd: string): boolean {\n  try {\n    const t = parse(await readFile(join(cwd, '.agents/config.toml'), 'utf8')) as Record<string, unknown>;\n    const a = t.swarm && (t.swarm as Record<string, unknown>).automation;\n    return Boolean(a && (a as { enabled?: unknown }).enabled === true);\n  } catch { return false; }\n}\nif (!automationEnabled(process.cwd())) {\n  throw new Error('add [swarm.automation] enabled = true to .agents/config.toml first');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runDualMode(args);\n} catch (err) {\n  if (err instanceof Error && err.message.includes('unattended swarm automation is disabled')) {\n    throw new Error('opt-in required: add [swarm.automation] enabled=true to .agents/config.toml in the cwd you run from');\n  }\n  throw err;\n}","preventionTips":["Provision .agents/config.toml (with the automation block) as part of project bootstrap/CI setup, not ad hoc","Run dual-mode commands from the directory containing .agents/config.toml — config resolves from process.cwd()","Set the companion caps (maxConcurrent, maxWriters, agentTimeoutSeconds) when enabling so CLI flags clamp sensibly","Treat this error as a policy gate, not a bug — do not work around it by editing library code"],"tags":["dual-mode","config","feature-flag","opt-in","toml"],"backgroundTag":"feature-disabled-by-config","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}