{"record":{"id":"04a5af0638e9d29e","repo":"coleam00/Archon","slug":"resume-and-model-are-mutually-exclusive-a-res","errorCode":null,"errorMessage":"--resume and --model are mutually exclusive. A resumed run keeps its original model bindings.","messagePattern":"--resume and --model are mutually exclusive\\. A resumed run keeps its original model bindings\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":1671,"sourceCode":"  // id crossed between two concurrent detached launches, and the narrow window where the\n  // child's re-capture resolves a different workflow than the parent did.\n  if (detachedPreCreatedRun && detachedPreCreatedRun.workflow_name !== workflow.name) {\n    throw new Error(\n      `Cannot execute run '${detachedPreCreatedRun.id}': it belongs to workflow ` +\n        `'${detachedPreCreatedRun.workflow_name}', not '${workflow.name}'.`\n    );\n  }\n\n  // Keys this workflow's YAML declares that the engine drops (#2213). Written to\n  // stderr, never stdout: in --json mode Pino is silenced and stdout must stay\n  // exactly the machine-readable payload, so this is the ONLY channel that\n  // reaches an agent driving runs through `--json`. Not gated on --quiet — a\n  // dropped key can be a gate the author believes is protecting the run.\n  emitParseWarnings(workflowEntry?.parseWarnings, workflow.name);\n  emitDeprecationNotice(workflow);\n\n  if (isContinuation && options.modelAssignments && options.modelAssignments.length > 0) {\n    throw new Error(\n      '--resume and --model are mutually exclusive. A resumed run keeps its original model bindings.'\n    );\n  }\n\n  const dryRunOnlyOptions = [\n    ['--stubs', options.stubsPath !== undefined],\n    ['--stubs-init', options.stubsInitPath !== undefined],\n    ['--default-stubs', options.defaultStubs === true],\n    ['--exec-code', options.execCode === true],\n    ['--pause-at-gates', options.pauseAtGates === true],\n  ] as const;\n  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 = [","sourceCodeStart":1653,"sourceCodeEnd":1689,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L1653-L1689","documentation":"The CLI refuses to combine `--resume` with `--model`: a continued run inherits the model assignments recorded at its original start, and re-binding models mid-resume is unsupported. This is a hard argument-conflict check on the programmatic boundary (`workflowRunCommand`).","triggerScenarios":"`archon workflow run <wf> --resume <run> --model node=model` or calling workflowRunCommand with both isContinuation and non-empty options.modelAssignments.","commonSituations":"Wanting to change models when resuming after a failure; a script that appends `--model` flags unconditionally and is then reused for a resume.","solutions":["Drop the --model flags and re-run with --resume only; the run keeps its original model bindings","If a different model is genuinely needed, start a NEW run with --model instead of resuming"],"exampleFix":"// before\narchon workflow run wf --resume run-123 --model agent=opus\n// after\narchon workflow run wf --resume run-123","handlingStrategy":"validation","validationCode":"if (isResume && modelFlags.length > 0) {\n  throw new Error('--resume and --model are mutually exclusive');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runWorkflow(args);\n} catch (e) {\n  if (/mutually exclusive/.test(String(e.message))) {\n    args = args.filter(a => !a.startsWith('--model'));\n    return runWorkflow(args);\n  }\n  throw e;\n}","preventionTips":["Build resume invocations without any --model flags","Don't blanket-append --model in generic wrapper scripts","Start a new run if model rebinding is truly needed"],"tags":["cli","flags","mutually-exclusive","resume"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}