{"record":{"id":"0d3755aed1109307","repo":"coleam00/Archon","slug":"container-isolation-is-folder-project-only-for-now","errorCode":null,"errorMessage":"Container isolation is folder-project-only for now. Run --container against a registered folder project (or add --folder to register this directory as one). Repo projects use worktree isolation.","messagePattern":"Container isolation is folder-project-only for now\\. Run --container against a registered folder project \\(or add --folder to register this directory as one\\)\\. Repo projects use worktree isolation\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":2444,"sourceCode":"    console.log(`Resuming workflow run: ${resumable.id}`);\n    console.log(`Working path: ${workingCwd}`);\n    console.log('');\n\n    // --resume adopts the prior run's worktree, so --base is half-applied here\n    // exactly as it is on --branch reuse above: the cut-from is already fixed,\n    // but flagBase still rides opts.baseOverride into $BASE_BRANCH.\n    if (flagBase) {\n      warnBaseOverrideOnReuse(workingCwd, flagBase);\n    }\n  }\n\n  const isFolderCodebase = codebase?.kind === 'folder';\n\n  // Container isolation is folder-project-only in v1. A repo-kind project (or a\n  // bare git repo / unregistered non-git cwd) with --container fails fast rather\n  // than silently running a worktree/in-place — no surprising isolation downgrade.\n  if (options.container && !isFolderCodebase) {\n    throw new Error(\n      'Container isolation is folder-project-only for now. Run --container against a ' +\n        'registered folder project (or add --folder to register this directory as one). ' +\n        'Repo projects use worktree isolation.'\n    );\n  }\n\n  // The codebase's stored default branch, used as the base-branch fallback when\n  // repo config sets no worktree.baseBranch (reuse validation, worktree\n  // creation, and $BASE_BRANCH resolution all derive from this one value).\n  const codebaseDefaultBranch = codebase?.default_branch?.trim() || undefined;\n\n  // Authoritative folder guards for an already-registered folder project run\n  // WITHOUT the --folder flag (the flag-based guards above only fire when the\n  // caller declared intent). Fail fast before any worktree work.\n  assertNoWorktreeOptionsForFolder(isFolderCodebase, options);\n  assertWorkflowNotWorktreePinnedForFolder(isFolderCodebase, pinnedEnabled, workflow.name);\n\n  if (isFolderCodebase && codebase) {","sourceCodeStart":2426,"sourceCodeEnd":2462,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L2426-L2462","documentation":"Container isolation (--container) is limited to folder-kind projects in v1. Repo-kind projects (and bare git repos or unregistered non-git directories) use worktree isolation instead, which is a silent downgrade of the requested isolation — so the CLI fails fast with this error rather than ignoring --container. The comment in source documents the intent: no surprising isolation downgrade.","triggerScenarios":"Running `archon workflow run <flow> --container` when the resolved codebase kind is not 'folder': a registered repo project, a bare git repo, or an unregistered non-git directory (codebase undefined or kind 'repo').","commonSituations":"Users assuming --container works everywhere and running it inside a normal git repo; forgetting to register the directory as a folder project with --folder; copy-pasting a container command from a folder-project example into a repo checkout.","solutions":["Add --folder to register the current directory as a folder project, then use --container: `archon workflow run <flow> --folder --container`.","Run --container from a directory already registered as a folder project.","If the project is a git repo, drop --container and rely on worktree isolation, or restructure the project as a folder project if container isolation is essential."],"exampleFix":"// before\ncd ~/work/git-project && archon workflow run my-flow --container  # folder-project-only\n// after\ncd ~/work/folder-project && archon workflow run my-flow --folder --container","handlingStrategy":"validation","validationCode":"import { existsSync } from 'fs';\nconst isGitRepo = existsSync(join(cwd, '.git'));\nif (wantContainer && isGitRepo) {\n  throw new Error('--container requires a folder project; use worktree isolation for repo projects, or register with --folder.');\n}","typeGuard":"function supportsContainer(c: { kind: string } | null | undefined): boolean {\n  return c?.kind === 'folder';\n}","tryCatchPattern":"try {\n  await runWorkflow({ container: true });\n} catch (error) {\n  if ((error as Error).message.includes('folder-project-only')) {\n    console.error('Either drop --container (repo projects use worktrees) or run with --folder from a folder project.');\n  } else throw error;\n}","preventionTips":["Use --container only inside registered folder projects.","For git repos, rely on worktree isolation by default.","Check the project kind with your codebase listing command before adding --container."],"tags":["containers","isolation","cli","unsupported-feature"],"backgroundTag":"container-isolation-unsupported","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}