{"record":{"id":"0dfc8fb11a08bd41","repo":"coleam00/Archon","slug":"cannot-adopt-run-options-adoptrunid-workflow","errorCode":null,"errorMessage":"Cannot adopt run '${options.adoptRunId}': workflow '${workflow.name}' disables worktrees, so there is no worktree or branch estate to inherit. Drop the adoption or run a worktree-isolated workflow.","messagePattern":"Cannot adopt run '(.+?)': workflow '(.+?)' disables worktrees, so there is no worktree or branch estate to inherit\\. Drop the adoption or run a worktree-isolated workflow\\.","errorType":"exception","errorClass":"WorkflowAdoptionError","httpStatus":null,"severity":"error","filePath":"packages/core/src/orchestrator/orchestrator-agent.ts","lineNumber":799,"sourceCode":"        await resolveWorkflowAdoption({\n          adoptedRunId: options.adoptRunId,\n          codebaseId: codebase.id,\n          codebasePath: codebase.default_cwd,\n          codebaseKind: codebase.kind,\n        })\n      ).lane\n    : undefined;\n\n  // A lane other than in-place inherits a worktree or branch estate; a workflow\n  // that opted out of worktrees runs in the parent checkout and has nothing to\n  // inherit, so honoring the adoption would mean silently dropping the lane.\n  if (\n    options?.adoptRunId !== undefined &&\n    adoptionLane !== undefined &&\n    adoptionLane.kind !== 'in-place' &&\n    workflow.worktree?.enabled === false\n  ) {\n    throw new WorkflowAdoptionError(\n      `Cannot adopt run '${options.adoptRunId}': workflow '${workflow.name}' disables ` +\n        'worktrees, so there is no worktree or branch estate to inherit. ' +\n        'Drop the adoption or run a worktree-isolated workflow.'\n    );\n  }\n\n  // Per-child isolation resolver (#2121 slice 2, PR-A): a `workflow:` node with\n  // `isolation: 'worktree'` gets its own worktree per child. Built for git-repo\n  // codebases only — a folder project can't make worktrees, so the engine fails\n  // such a node fast (no resolver injected). Shared across every dispatch below.\n  const resolveChildIsolation =\n    codebase.kind !== 'folder'\n      ? createChildWorktreeResolver({\n          codebaseId: codebase.id,\n          codebaseName: codebase.name,\n          canonicalRepoPath: codebase.default_cwd,\n          baseBranch: codebaseBaseBranch,\n          createdByPlatform: platform.getPlatformType(),","sourceCodeStart":781,"sourceCodeEnd":817,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/orchestrator/orchestrator-agent.ts#L781-L817","documentation":"WorkflowAdoptionError thrown by dispatchOrchestratorWorkflowOwned when a run adoption (adoptRunId) is requested while the target workflow explicitly disables worktrees (workflow.worktree.enabled === false) and the adoption lane is not in-place. Adoption inherits the previous run's worktree/branch estate; with worktrees disabled there is nothing to inherit, so the engine refuses rather than silently dropping the adoption.","triggerScenarios":"Dispatching the orchestrator workflow with options.adoptRunId set while the workflow definition sets worktree.enabled: false and the computed adoption lane is not 'in-place'.","commonSituations":"Reusing an adoption-capable command or platform message against a workflow that was switched to run in-place only; a user asks to 'continue that run in a fresh checkout' but the workflow is configured without worktrees.","solutions":["Drop the adoptRunId option and dispatch without adoption.","Enable worktrees on the workflow (worktree.enabled: true) so there is an estate to inherit.","If in-place continuation is acceptable, configure the adoption lane as in-place."],"exampleFix":"// before\nawait dispatchOrchestratorWorkflow({ adoptRunId: runId }); // workflow has worktree.enabled: false\n// after\nawait dispatchOrchestratorWorkflow({ adoptRunId: runId }); // with worktree.enabled: true\n// or\nawait dispatchOrchestratorWorkflow({}); // no adoption","handlingStrategy":"validation","validationCode":"if (adoptRunId && workflow.worktree?.enabled === false) {\n  throw new Error('Adoption requires a worktree-enabled workflow');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await dispatchOrchestratorWorkflow({ adoptRunId });\n} catch (e) {\n  if (e instanceof WorkflowAdoptionError && e.message.includes('disables worktrees')) {\n    await dispatchOrchestratorWorkflow({}); // dispatch without adoption\n  } else throw e;\n}","preventionTips":["Check workflow.worktree.enabled before offering adoption in UIs or commands.","Keep workflows that support adoption worktree-enabled.","Document that adoption requires an inheritable worktree/branch estate."],"tags":["workflow","worktree","adoption","configuration"],"backgroundTag":"adoption-not-supported","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}