{"record":{"id":"73efa4b7001bb8a4","repo":"Yeachan-Heo/oh-my-codex","slug":"worker-assignment-failed-reason","errorCode":null,"errorMessage":"worker_assignment_failed:${reason}","messagePattern":"worker_assignment_failed:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":4814,"sourceCode":"\n    try {\n      await writeWorkerInbox(\n        sanitized,\n        workerName,\n        `# Assignment Cancelled\\n\\nTask ${taskId} was not dispatched due to ${reason}.\\nDo not execute this task from prior inbox content.`,\n        cwd,\n      );\n    } catch (err) {\n      process.stderr.write(`[team/runtime] operation failed: ${err}\\n`);\n      // best effort\n    }\n\n    if (!released.ok) {\n      throw new Error(`${reason}:${released.error}`);\n    }\n\n    if (reason === 'worker_notify_failed') throw new Error('worker_notify_failed');\n    throw new Error(`worker_assignment_failed:${reason}`);\n  }\n  });\n}\n\n/**\n * Reassign a task from one worker to another.\n */\nexport async function reassignTask(\n  teamName: string,\n  taskId: string,\n  _fromWorker: string,\n  toWorker: string,\n  cwd: string,\n): Promise<void> {\n  await assignTask(teamName, toWorker, taskId, cwd);\n}\n\nfunction resolveCommitHygieneArtifactTeamNames(config: TeamConfig, internalTeamName: string): string[] {","sourceCodeStart":4796,"sourceCodeEnd":4832,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L4796-L4832","documentation":"Generic dispatch-failure rethrow after rollback: the post-claim dispatch failed with a reason other than 'worker_notify_failed' and the claim was released successfully. The message is 'worker_assignment_failed:' plus the underlying reason string extracted from the caught error.","triggerScenarios":"Any exception inside the post-claim dispatch try-block (other than worker_notify_failed) — e.g. approved-execution continuity state resolution failure, tmux errors, or environment errors — after which releaseTaskClaim succeeded.","commonSituations":"Transient filesystem errors reading execution-continuity state; tmux binary missing or misconfigured; unexpected exceptions in dispatch plumbing surfaced as the `reason` suffix.","solutions":["Read the suffix after 'worker_assignment_failed:' to identify the real cause and address it","Check tmux availability/permissions and team state directory health","Retry the assignment — the claim was cleanly released, so the task is claimable again"],"exampleFix":"// before\nawait assignTask(team, taskId, worker, cwd);\n\n// after\ntry {\n  await assignTask(team, taskId, worker, cwd);\n} catch (e) {\n  const m = /^worker_assignment_failed:(.+)$/.exec((e as Error).message);\n  if (m && isTransient(m[1])) { await sleep(2000); await assignTask(team, taskId, worker, cwd); }\n  else throw e;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await assignTask(t, id, w, cwd); } catch (e) { const m = /^worker_assignment_failed:(.+)$/.exec((e as Error).message); if (m && isTransient(m[1])) { await sleep(2000); await assignTask(t, id, w, cwd); } else throw e; }","preventionTips":["Surface the reason suffix in logs for diagnosis","Keep tmux and the state directory healthy","Retry transient failures — the claim is released on rollback"],"tags":["dispatch","assignment","worker"],"backgroundTag":"remote-dispatch-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}