{"record":{"id":"dd94661a907f13a3","repo":"coleam00/Archon","slug":"isolation-environment-required-but-could-not-be-cr","errorCode":null,"errorMessage":"Isolation environment required but could not be created","messagePattern":"Isolation environment required but could not be created","errorType":"exception","errorClass":"IsolationBlockedError","httpStatus":null,"severity":"error","filePath":"packages/core/src/orchestrator/orchestrator.ts","lineNumber":265,"sourceCode":"        );\n      }\n      return validateAndResolveIsolation(\n        { ...conversation, isolation_env_id: null },\n        codebase,\n        platform,\n        conversationId,\n        hints,\n        true,\n        userId\n      );\n    }\n\n    case 'none':\n      return { status: 'none', cwd: result.cwd, env: null };\n\n    case 'blocked':\n      await platform.sendMessage(conversationId, result.userMessage);\n      throw new IsolationBlockedError(\n        'Isolation environment required but could not be created',\n        result.reason\n      );\n  }\n}\n\n/**\n * Context for workflow routing - avoids passing many parameters\n */\nexport interface WorkflowRoutingContext {\n  readonly platform: IPlatformAdapter;\n  readonly conversationId: string;\n  readonly cwd: string;\n  readonly originalMessage: string;\n  readonly conversationDbId: string;\n  readonly codebaseId?: string;\n  readonly availableWorkflows: readonly WorkflowDefinition[];\n  /**","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/orchestrator/orchestrator.ts#L247-L283","documentation":"validateAndResolveIsolation throws IsolationBlockedError when the isolation mode (e.g. worktree) was required for a run but the isolation environment could not be created. Before throwing, the resolved result's userMessage has already been sent to the conversation, so this error is the internal signal that the run cannot proceed safely without isolation. It exists to prevent unisolated execution of work that demands isolation.","triggerScenarios":"Calling the orchestrator with isolation set to 'worktree' (or similar required mode) when createChildWorktreeResolver/isolation provisioning fails, e.g. the codebase is not a git repo, git worktree add fails, or the workspace is unwritable. The 'blocked' branch of the isolation switch produces it.","commonSituations":"Dispatching a workflow with per-child worktree isolation against a codebase whose kind is not a git repo, a detached/dirty git directory where worktree creation fails, disk-full or permission errors under the Archon workspace, or running outside a git clone.","solutions":["Read result.reason / the userMessage already sent to the conversation to see why isolation provisioning failed.","Verify the codebase registration points at a valid git repository (kind is repo, not folder) and that `git worktree add` succeeds manually.","Check disk space and write permissions on the Archon workspace directory where worktrees are created.","If isolation is not actually required, dispatch without requesting isolation (isolation: 'none')."],"exampleFix":"// before: dispatching with required worktree isolation on a folder codebase\nrun({ codebaseId: 'docs-folder', isolation: 'worktree' })\n// after: register the codebase as a git repo or drop the isolation requirement\nrun({ codebaseId: 'app-repo', isolation: 'worktree' })","handlingStrategy":"try-catch","validationCode":"// before dispatch\ncodebase = await getCodebase(ctx.codebaseId);\nif (codebase.kind !== 'repo') throw new Error('worktree isolation requires a git-repo codebase');","typeGuard":null,"tryCatchPattern":"try {\n  await dispatch(...);\n} catch (e) {\n  if (e instanceof IsolationBlockedError) {\n    console.error('Isolation blocked:', e.reason); // surface e.reason to the operator\n  } else throw e;\n}","preventionTips":["Only request worktree isolation for codebases registered as git repos.","Ensure the workspace volume has free disk space and write permissions.","Smoke-test `git worktree add` on the host before enabling isolation."],"tags":["isolation","worktree","orchestrator"],"backgroundTag":"isolation-environment-unavailable","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}