{"record":{"id":"273bf3f7edc59de0","repo":"coleam00/Archon","slug":"resume-and-config-are-mutually-exclusive-a-re","errorCode":null,"errorMessage":"--resume and --config are mutually exclusive. A resumed run keeps its original run config.","messagePattern":"--resume and --config are mutually exclusive\\. A resumed run keeps its original run config\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/cli.ts","lineNumber":438,"sourceCode":"  const requiresGitRepo = !noGitCommands.includes(command ?? '');\n  let detachedRunConfig: WorkflowRunConfigInput | undefined;\n\n  try {\n    const detachedRunConfigPayload = values['internal-detached-run-config'];\n    if (\n      command === 'workflow' &&\n      subcommand === 'run' &&\n      typeof detachedRunConfigPayload === 'string'\n    ) {\n      const { decodeWorkflowRunConfigHandoff } =\n        await import('@archon/core/config/run-config-handoff');\n      detachedRunConfig = decodeWorkflowRunConfigHandoff(detachedRunConfigPayload);\n      // Fail-fast for the decode step, not a second copy of the invariant: `workflow.ts`\n      // still owns this rejection for every caller. A legitimately spawned detached child\n      // cannot reach it — the parent refuses to seal a config for a continuation before it\n      // forks — so this only fires on a hand-built `--internal-detached-run-config`, and\n      // saves it a database round-trip on the way to the same message.\n      if (resumeFlag) throw new Error(RESUME_RUN_CONFIG_CONFLICT);\n    }\n\n    const configOutsideRun = rejectConfigOutsideRun(command, subcommand, values.config);\n    if (configOutsideRun) {\n      console.error(configOutsideRun);\n      return 1;\n    }\n    // `archon continue` was removed (#2846). Intercepted before the git gate so\n    // stale invocations get the replacement pointer in any directory.\n    if (command === 'continue') {\n      return await fail(\n        jsonFlag,\n        \"Removed: 'archon continue' inferred a run from a branch name.\\n\" +\n          'Use: archon workflow run <name> --adopt <run-id> <input>\\n' +\n          'Find a prior run id with: archon workflow runs --open (or workflow get <run-id>)'\n      );\n    }\n    // Note: orphaned run cleanup moved to `workflow cleanup` command only.","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/cli.ts#L420-L456","documentation":"The Archon CLI main() rejects invoking a run with both --resume and --config (an internal detached run-config handoff). A resumed run must keep its original persisted run configuration, so supplying a replacement config is a contract violation. The CLI fails fast with the shared RESUME_RUN_CONFIG_CONFLICT message before touching the database.","triggerScenarios":"Running a command with both `--resume <runId>` and `--internal-detached-run-config <payload>` (or the config flag it maps to), e.g. hand-crafting a detached continuation command or a wrapper script that adds --config to a resume invocation.","commonSituations":"Hand-built detached-child commands where the operator added a config flag; shell aliases that always append --config; scripted resumption of an interrupted run that mistakenly passes a new run config.","solutions":["Remove the --config / --internal-detached-run-config flag from the resume command; the original run config is restored automatically.","If you need different settings, do not resume — start a new run with the desired config.","If a wrapper script constructs the command, fix it to omit config flags when resumeFlag is set.","To change future behavior of a resumed workflow, edit the workflow file and start a new run rather than re-sealing a config."],"exampleFix":"// before\narchon run --resume run_123 --config ./other.yaml\n// after\narchon run --resume run_123","handlingStrategy":"validation","validationCode":"// Guard wrapper scripts from combining resume with a config flag\nif (args.includes('--resume') && (args.includes('--config') || args.includes('--internal-detached-run-config'))) {\n  throw new Error('Drop --config when resuming; the original run config is reused');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-craft --internal-detached-run-config commands; let the parent spawn them.","Audit shell aliases/wrappers that unconditionally append --config.","Treat resume as config-immutable; start a new run for different settings."],"tags":["cli","arguments","resume","config"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}