{"record":{"id":"b41ecaf7bbf3ab78","repo":"Yeachan-Heo/oh-my-codex","slug":"worktree-not-provisioned-workername","errorCode":null,"errorMessage":"worktree_not_provisioned:${workerName}","messagePattern":"worktree_not_provisioned:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/scaling.ts","lineNumber":1131,"sourceCode":"            cwd: leaderCwd,\n            scope: 'team',\n            mode: effectiveWorktreeMode,\n            teamName: sanitized,\n            workerName,\n          });\n          if (!worktreePlan.enabled) throw new Error(`worktree_not_planned:${workerName}`);\n          const worktreePathExistedBeforeEnsure = existsSync(worktreePlan.worktreePath);\n          const branchExistedBeforeEnsure = worktreePlan.branchName\n            ? spawnSync('git', ['show-ref', '--verify', '--quiet', `refs/heads/${worktreePlan.branchName}`], {\n                cwd: worktreePlan.repoRoot,\n                encoding: 'utf-8',\n                windowsHide: true,\n              }).status === 0\n            : false;\n          try {\n            const ensuredWorkspace = ensureWorktree(worktreePlan);\n            throwIfScaleUpFailureInjected(env, 'worktree-ensure-post-create');\n            if (!ensuredWorkspace.enabled) throw new Error(`worktree_not_provisioned:${workerName}`);\n            workerWorkspace = ensuredWorkspace;\n          } catch (error) {\n            const recoveredWorkspace = recoverCreatedWorktreeAfterEnsureFailure(\n              worktreePlan,\n              worktreePathExistedBeforeEnsure,\n              branchExistedBeforeEnsure,\n            );\n            if (recoveredWorkspace) {\n              workerWorkspace = recoveredWorkspace;\n              provisionedWorktrees.push(recoveredWorkspace);\n            }\n            throw error;\n          }\n          if (!workerWorkspace) throw new Error(`worktree_not_provisioned:${workerName}`);\n          provisionedWorktrees.push(workerWorkspace);\n          throwIfScaleUpFailureInjected(env, 'worktree-post-create');\n          workerCwd = workerWorkspace.worktreePath;\n        }","sourceCodeStart":1113,"sourceCodeEnd":1149,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/scaling.ts#L1113-L1149","documentation":"ensureWorktree returned a disabled workspace (or a fault was injected) while provisioning a worktree for a new worker during scaleUp. The planned worktree could not actually be provisioned.","triggerScenarios":"Calling scaleUp; planWorktree succeeded but ensureWorktree returned {enabled:false} (e.g. git worktree add failed silently or config disabled) or the 'worktree-ensure-post-create' failure injection fired.","commonSituations":"git worktree add failing due to name collision, disk full, or corrupt .git/worktrees metadata; environment issue where git is unavailable on PATH.","solutions":["Run 'git worktree list' and clean up stale/corrupt worktrees under .omx/team/<team>/worktrees","Ensure git is on PATH and the repo is healthy (git fsck)","Retry scaleUp after freeing disk space / removing conflicting branches or worktree dirs"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"import { spawnSync } from 'node:child_process';\nfunction worktreesHealthy(repoRoot: string): boolean {\n  return spawnSync('git', ['worktree', 'list'], { cwd: repoRoot }).status === 0;\n}","typeGuard":null,"tryCatchPattern":"catch (e) {\n  if ((e as Error).message.startsWith('worktree_not_provisioned')) {\n    // fall back to scale-up without worktrees, or clean stale worktrees and retry\n    return scaleUp(team, count, { ...opts, worktreeMode: 'none' });\n  }\n  throw e;\n}","preventionTips":["Periodically prune stale worktrees under .omx/team/*/worktrees","Keep disk space available on the volume holding the repo"],"tags":["team","scaling","worktree","git","provisioning"],"backgroundTag":"worktree-setup-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}