{"record":{"id":"8ac0d47d7d564736","repo":"coleam00/Archon","slug":"workflow-workflow-name-sets-worktree-enabled-8ac0d4","errorCode":null,"errorMessage":"Workflow '${workflow.name}' sets worktree.enabled: false (runs in live checkout).\n  --base only applies when a worktree is created.\n  Drop --base or change the workflow's worktree.enabled.","messagePattern":"Workflow '(.+?)' sets worktree\\.enabled: false \\(runs in live checkout\\)\\.\n  --base only applies when a worktree is created\\.\n  Drop --base or change the workflow's worktree\\.enabled\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":1905,"sourceCode":"  // rather than silently applying one side and ignoring the other.\n  const pinnedEnabled = workflow.worktree?.enabled;\n  if (pinnedEnabled === false) {\n    if (options.branchName !== undefined) {\n      throw new Error(\n        `Workflow '${workflow.name}' sets worktree.enabled: false (runs in live checkout).\\n` +\n          '  --branch requires an isolated worktree.\\n' +\n          \"  Drop --branch or change the workflow's worktree.enabled.\"\n      );\n    }\n    if (options.fromBranch !== undefined) {\n      throw new Error(\n        `Workflow '${workflow.name}' sets worktree.enabled: false (runs in live checkout).\\n` +\n          '  --from/--from-branch only applies when a worktree is created.\\n' +\n          \"  Drop --from or change the workflow's worktree.enabled.\"\n      );\n    }\n    if (options.baseBranch !== undefined) {\n      throw new Error(\n        `Workflow '${workflow.name}' sets worktree.enabled: false (runs in live checkout).\\n` +\n          '  --base only applies when a worktree is created.\\n' +\n          \"  Drop --base or change the workflow's worktree.enabled.\"\n      );\n    }\n    // --no-worktree is redundant but not contradictory — silently accept.\n  } else if (pinnedEnabled === true) {\n    if (options.noWorktree) {\n      throw new Error(\n        `Workflow '${workflow.name}' sets worktree.enabled: true (requires a worktree).\\n` +\n          '  --no-worktree conflicts with the workflow policy.\\n' +\n          \"  Drop --no-worktree or change the workflow's worktree.enabled.\"\n      );\n    }\n  }\n\n  // Default to worktree isolation unless --no-worktree or --resume. Workflow YAML\n  // `worktree.enabled` pins the decision — mismatches with CLI flags are rejected","sourceCodeStart":1887,"sourceCodeEnd":1923,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L1887-L1923","documentation":"A workflow pinned to `worktree.enabled: false` never creates a worktree, so `--base` — the branch a new worktree would be cut from — would be silently ignored. The CLI throws instead, keeping the policy-vs-flag mismatch explicit.","triggerScenarios":"`archon workflow start <workflow-with-worktree-enabled-false> --base <branch>` — options.baseBranch set while workflow.worktree.enabled === false.","commonSituations":"Standard launch templates that always include `--base main`; confusion between the workflow's isolation policy and per-dispatch overrides.","solutions":["Drop the `--base` flag when starting this workflow.","Set `worktree.enabled: true` in the workflow YAML if `--base` should apply.","Note `--no-worktree` in this mode is redundant but accepted — only contradictory worktree flags throw."],"exampleFix":"// before\narchon workflow start live-sync --base main\n// after\narchon workflow start live-sync","handlingStrategy":"validation","validationCode":"if (wf.worktree?.enabled === false && args.includes('--base')) {\n  throw new Error(`${wf.name} never creates a worktree; --base is not applicable.`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't blanket-add --base to every workflow launch.","When a workflow is pinned to the live checkout, only flags like --input and --resume are meaningful."],"tags":["cli","flag-conflict","worktree","workflow-config"],"backgroundTag":"flag-vs-workflow-policy-conflict","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}