{"record":{"id":"74cf0e397d8df37e","repo":"coleam00/Archon","slug":"workflow-workflow-name-sets-worktree-enabled-74cf0e","errorCode":null,"errorMessage":"Workflow '${workflow.name}' sets worktree.enabled: false (runs in live checkout).\n  --from/--from-branch only applies when a worktree is created.\n  Drop --from or change the workflow's worktree.enabled.","messagePattern":"Workflow '(.+?)' sets worktree\\.enabled: false \\(runs in live checkout\\)\\.\n  --from/--from-branch only applies when a worktree is created\\.\n  Drop --from or change the workflow's worktree\\.enabled\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":1898,"sourceCode":"  // config, so routing the flag through it would silently lose to a repo that\n  // sets `worktree.baseBranch`.\n  const flagBase = options.baseBranch?.trim() || undefined;\n\n  // Reconcile workflow-level worktree policy with invocation flags.\n  // The workflow YAML's `worktree.enabled` pins isolation regardless of caller —\n  // a mismatch between policy and flags is a user error we surface loudly\n  // 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' +","sourceCodeStart":1880,"sourceCodeEnd":1916,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L1880-L1916","documentation":"A workflow pinned to `worktree.enabled: false` runs in the live checkout, so `--from`/`--from-branch` — which only matters when a worktree is created — would have no effect. The CLI rejects the flag rather than silently ignoring it, mirroring the other policy-vs-flag checks.","triggerScenarios":"`archon workflow start <workflow-with-worktree-enabled-false> --from <branch>` (or `--from-branch`) — options.fromBranch set while workflow.worktree.enabled === false.","commonSituations":"Copy-pasting a full worktree flag set (`--from`, `--base`, `--branch`) onto a workflow whose YAML disables worktrees.","solutions":["Drop the `--from`/`--from-branch` flag; it only applies when a worktree is created.","Set `worktree.enabled: true` in the workflow YAML if `--from` should be meaningful."],"exampleFix":"// before\narchon workflow start live-sync --from main\n// after\narchon workflow start live-sync","handlingStrategy":"validation","validationCode":"if (wf.worktree?.enabled === false && (args.includes('--from') || args.includes('--from-branch'))) {\n  throw new Error(`${wf.name} never creates a worktree; --from is not applicable.`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat --from/--from-branch as worktree-creation-only flags.","Strip worktree flags from launchers when the target workflow disables worktrees."],"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"}