{"record":{"id":"b1dcd7e5eba15a79","repo":"Yeachan-Heo/oh-my-codex","slug":"team-sanitized-not-found","errorCode":null,"errorMessage":"Team ${sanitized} not found","messagePattern":"Team (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":4704,"sourceCode":"      throw new Error(teamContinuationRequiredDiagnostic(phaseState));\n    }\n    const task = await readTask(sanitized, taskId, cwd);\n    if (!task) throw new Error(`Task ${taskId} not found`);\n  const manifest = await readTeamManifestV2(sanitized, cwd);\n  const governance = resolveGovernancePolicy(manifest?.governance);\n\n  if (governance.delegation_only && workerName === 'leader-fixed') {\n    throw new Error('delegation_only_violation');\n  }\n\n  if (governance.plan_approval_required && task.requires_code_change === true) {\n    const approved = await isTaskApprovedForExecution(sanitized, taskId, cwd);\n    if (!approved) {\n      throw new Error('plan_approval_required');\n    }\n  }\n  const config = await readTeamConfig(sanitized, cwd);\n  if (!config) throw new Error(`Team ${sanitized} not found`);\n  const workerInfo = config.workers.find(w => w.name === workerName);\n  if (!workerInfo) throw new Error(`Worker ${workerName} not found in team`);\n  const dispatchPolicy = resolveDispatchPolicy(manifest?.policy, config.worker_launch_mode);\n\n  const claim = await claimTask(sanitized, taskId, workerName, task.version ?? 1, cwd);\n  if (!claim.ok) {\n    if (claim.error === 'blocked_dependency') {\n      throw new Error(`blocked_dependency:${(claim.dependencies ?? []).join(',')}`);\n    }\n    throw new Error(claim.error);\n  }\n\n  try {\n    // Retry dispatch up to 2 times to handle trust prompts during assignment (fixes #393).\n    const approvedExecutionState = await resolvePersistedApprovedTeamExecutionContinuityState(\n      sanitized,\n      config.leader_cwd ?? cwd,\n      config.team_state_root ?? resolveCanonicalTeamStateRoot(config.leader_cwd ?? cwd),","sourceCodeStart":4686,"sourceCodeEnd":4722,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L4686-L4722","documentation":"Thrown when readTeamConfig returns null during task assignment — the team's config file does not exist or is unreadable, so the team is treated as not found.","triggerScenarios":"Calling any task-assignment API for a team whose config is missing: wrong team name (after sanitization), team never created, or the team's state directory/config file was deleted.","commonSituations":"Typo in the team name; running from the wrong cwd so the team state root resolves elsewhere; team state wiped by cleanup scripts or a fresh clone without team state.","solutions":["Verify the team name matches an existing team (list teams) and that its config file exists under the expected state root","Create/initialize the team before assigning tasks","Ensure cwd is the project directory the team belongs to"],"exampleFix":"// before\nawait assignTask('myteam', taskId, worker, cwd);\n\n// after\nconst config = await readTeamConfig(sanitizeTeamName('myteam'), cwd);\nif (!config) throw new Error('team myteam does not exist; run team create first');\nawait assignTask('myteam', taskId, worker, cwd);","handlingStrategy":"validation","validationCode":"const config = await readTeamConfig(sanitizeTeamName(teamName), cwd);\nif (!config) throw new Error(`team ${teamName} not initialized`);","typeGuard":null,"tryCatchPattern":"try { await fn(teamName, cwd); } catch (e) { if ((e as Error).message.endsWith('not found')) await createTeam(teamName, cwd); else throw e; }","preventionTips":["Pass the exact team name; sanitize before use","Run from the project cwd the team belongs to","Assert team existence during pipeline bootstrap"],"tags":["team","not-found","config"],"backgroundTag":"entity-not-found","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}