{"record":{"id":"de94aa5a779488fd","repo":"can1357/oh-my-pi","slug":"isolated-task-execution-requires-a-git-checkout-b","errorCode":null,"errorMessage":"Isolated task execution requires a Git checkout, but this workspace is pure Jujutsu (`.jj/` without a colocated `.git/`). Run `jj git init --colocate` to add a Git checkout, or set `task.isolation.mode: none` to disable task isolation.","messagePattern":"Isolated task execution requires a Git checkout, but this workspace is pure Jujutsu \\(`\\.jj/` without a colocated `\\.git/`\\)\\. Run `jj git init --colocate` to add a Git checkout, or set `task\\.isolation\\.mode: none` to disable task isolation\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/task/worktree.ts","lineNumber":59,"sourceCode":"\tstaged: string;\n\tunstaged: string;\n\tuntracked: string[];\n\tuntrackedPatch: string;\n}\n\n/** Baseline state for the project, including any nested git repos. */\nexport interface WorktreeBaseline {\n\troot: RepoBaseline;\n\t/** Nested git repos (path relative to root.repoRoot). */\n\tnested: Array<{ relativePath: string; baseline: RepoBaseline }>;\n}\n\nexport async function getRepoRoot(cwd: string): Promise<string> {\n\t// Pure-jj check runs first so a jj workspace nested under an unrelated\n\t// outer Git checkout is rejected at its own root rather than silently\n\t// mutating the surrounding Git tree behind jj's back.\n\tif (vcs.isPureJj(cwd)) {\n\t\tthrow new Error(\n\t\t\t\"Isolated task execution requires a Git checkout, but this workspace is pure Jujutsu (`.jj/` without a colocated `.git/`). Run `jj git init --colocate` to add a Git checkout, or set `task.isolation.mode: none` to disable task isolation.\",\n\t\t);\n\t}\n\n\tconst repoRoot = vcs.git(cwd)?.info().repoRoot;\n\tif (repoRoot) return repoRoot;\n\n\tthrow new Error(\"Git repository not found for isolated task execution.\");\n}\n\nconst GIT_NO_INDEX_NULL_PATH = process.platform === \"win32\" ? \"NUL\" : \"/dev/null\";\n\nexport function getGitNoIndexNullPath(): string {\n\treturn GIT_NO_INDEX_NULL_PATH;\n}\n\n/** Find nested git repositories (non-submodule) under the given root. */\nasync function discoverNestedRepos(repoRoot: string): Promise<string[]> {","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/task/worktree.ts#L41-L77","documentation":"Isolated task execution (git worktree-based task isolation) only supports Git repositories. When the workspace is a pure Jujutsu checkout — a `.jj/` directory with no colocated `.git/` — getRepoRoot refuses to run so it never mutates a surrounding Git tree behind jj's back. The check runs first so nested jj-under-git workspaces are rejected at their own root.","triggerScenarios":"Calling getRepoRoot/repoRoot (e.g. via ensureIsolation for a subagent task) in a directory where `vcs.isPureJj(cwd)` is true: `.jj/` exists but no `.git/` directory sits alongside it (non-colocated jj repo).","commonSituations":"Developer initialized their project with plain `jj git init` (no --colocate) and runs omp subagent tasks with task isolation enabled; also jj repos created by `jj init` inside an unrelated outer git checkout.","solutions":["Re-init as colocated: run `jj git init --colocate` (or `jj git init --colocate` in a fresh clone) so a `.git/` directory exists beside `.jj/`","Disable task isolation in config: set `task.isolation.mode: none`","Convert an existing repo: clone the repo with git, then `jj git init --colocate` on top, or migrate per jj docs"],"exampleFix":"// .omp config before\n{ \"task\": { \"isolation\": { \"mode\": \"worktree\" } } }\n// after (in a pure-jj workspace)\n{ \"task\": { \"isolation\": { \"mode\": \"none\" } } }","handlingStrategy":"validation","validationCode":"import * as fs from \"node:fs\";\nfunction canIsolateTasks(cwd: string): boolean {\n\tconst hasJj = fs.existsSync(`${cwd}/.jj`);\n\tconst hasGit = fs.existsSync(`${cwd}/.git`);\n\treturn !(hasJj && !hasGit);\n}","typeGuard":null,"tryCatchPattern":"try {\n\tawait repoRoot = getRepoRoot(cwd);\n} catch (err) {\n\tif ((err as Error).message.includes(\"pure Jujutsu\")) {\n\t\tlogger.warn(\"Task isolation unavailable in pure-jj workspace\");\n\t\treturn runWithoutIsolation();\n\t}\n\tthrow err;\n}","preventionTips":["Initialize jj repos with `jj git init --colocate` when you also use git-based tooling","Set task.isolation.mode: none in jj-only workspaces","Check for a `.git` sibling of `.jj/` before enabling task isolation"],"tags":["git","jujutsu","vcs","configuration"],"backgroundTag":"pure-jujutsu-workspace-requires-git","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}