{"record":{"id":"fc7302761f271e7b","repo":"coleam00/Archon","slug":"dry-run-cannot-be-combined-with-incompatiblefl","errorCode":null,"errorMessage":"--dry-run cannot be combined with ${incompatibleFlag}.","messagePattern":"--dry-run cannot be combined with (.+?)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":1701,"sourceCode":"  const optionWithoutDryRun = dryRunOnlyOptions.find(([, present]) => present)?.[0];\n  if (!options.dryRun && optionWithoutDryRun) {\n    throw new Error(`${optionWithoutDryRun} requires --dry-run.`);\n  }\n\n  if (options.dryRun) {\n    const incompatible = [\n      ['--branch', options.branchName !== undefined],\n      ['--from/--from-branch', options.fromBranch !== undefined],\n      ['--base', options.baseBranch !== undefined],\n      ['--no-worktree', options.noWorktree === true],\n      ['--folder', options.folder === true],\n      ['--container', options.container === true],\n      ['--resume', options.resume === true],\n      ['--detach', options.detach === true],\n    ] as const;\n    const incompatibleFlag = incompatible.find(([, present]) => present)?.[0];\n    if (incompatibleFlag) {\n      throw new Error(`--dry-run cannot be combined with ${incompatibleFlag}.`);\n    }\n    if (options.stubsInitPath !== undefined && options.stubsPath !== undefined) {\n      throw new Error('--stubs-init cannot be combined with --stubs.');\n    }\n    if (options.stubsInitPath !== undefined && options.defaultStubs) {\n      throw new Error('--stubs-init cannot be combined with --default-stubs.');\n    }\n\n    // The IDENTICAL invocation gate a real run passes through below (#2610): parse\n    // `--input name=value`, validate against the declared `inputs:` contract, and fail\n    // with the same errors (undeclared key, missing required) before any trace output.\n    // Only the supplied entries travel; the simulator derives declared defaults itself,\n    // mirroring the executor's `defaultRunInputs` merge at run start.\n    const dryRunInputs = resolveTopLevelInputs(\n      workflow,\n      options.inputs ? parseInputAssignments(options.inputs) : undefined\n    );\n","sourceCodeStart":1683,"sourceCodeEnd":1719,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L1683-L1719","documentation":"`--dry-run` simulates a run and cannot be combined with flags that affect a real execution: --branch, --from/--from-branch, --container, --resume, or --detach. The CLI enumerates these pairs and throws naming the first offending flag.","triggerScenarios":"e.g. `archon workflow run wf --dry-run --detach`, or --dry-run together with --resume/--container/--branch.","commonSituations":"Combining a simulation with worktree/branch isolation flags out of habit; scripts that always pass --resume but are pointed at a dry-run test.","solutions":["Remove the incompatible flag named in the message","Or drop --dry-run if you actually want a real run with that flag"],"exampleFix":"// before\narchon workflow run wf --dry-run --detach\n// after\narchon workflow run wf --dry-run","handlingStrategy":"validation","validationCode":"if (args.includes('--dry-run')) {\n  const bad = ['--branch','--from','--from-branch','--container','--resume','--detach']\n    .find(f => args.includes(f));\n  if (bad) throw new Error(`--dry-run cannot be combined with ${bad}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runWorkflow(args);\n} catch (e) {\n  if (/--dry-run cannot be combined/.test(String(e.message))) {\n    const flag = String(e.message).split('combined with ')[1];\n    return runWorkflow(args.filter(a => a !== flag));\n  }\n  throw e;\n}","preventionTips":["Model dry-run args and real-run args as separate option sets in scripts","Don't share a single argument builder between simulate and execute paths","Check flag combos before invoking"],"tags":["cli","flags","dry-run","mutually-exclusive"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}