{"record":{"id":"32c6d4d8b28d6d17","repo":"Yeachan-Heo/oh-my-codex","slug":"reason-released-error","errorCode":null,"errorMessage":"${reason}:${released.error}","messagePattern":"\\$\\{reason\\}:\\$\\{released\\.error\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"src/team/runtime.ts","lineNumber":4810,"sourceCode":"\n    const reason = error instanceof Error && error.message.trim() !== ''\n      ? error.message\n      : 'worker_assignment_failed';\n\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> {","sourceCodeStart":4792,"sourceCodeEnd":4828,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L4792-L4828","documentation":"Composite error from the claim-rollback path: after a dispatch failure the runtime tried to release the claim (releaseTaskClaim) and that release itself failed. The message is `${reason}:${released.error}` — the original failure reason plus the release failure detail.","triggerScenarios":"Any post-claim dispatch error (catch block) where the compensating releaseTaskClaim call returns ok:false, e.g. claim token no longer recognized or task state changed underneath the rollback.","commonSituations":"Claim token expired or was already released by a watchdog; concurrent supervisor also trying to release the same claim; filesystem/state corruption in the task store making the release fail.","solutions":["Inspect both halves of the message: fix the original dispatch reason, then reconcile the stale claim (re-read task state; force-release if a tool is available)","Check whether a watchdog/supervisor already released the claim — the task may simply need re-assignment","If task state files are corrupted, restore from backup or reinitialize the task"],"exampleFix":"// before\n// no handling; intermittent `${reason}:${released.error}` failures\n\n// after\ntry {\n  await assignTask(team, taskId, worker, cwd);\n} catch (e) {\n  if (/^.+:.+$/.test(String((e as Error).message)) && await isClaimStuck(team, taskId)) {\n    await forceReleaseClaim(team, taskId);\n  }\n  throw e;\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await assignTask(t, id, w, cwd); } catch (e) { const m = /^(.+):(.+)$/.exec((e as Error).message); if (m && await isClaimStuck(t, id)) await forceReleaseClaim(t, id); throw e; }","preventionTips":["Monitor for stuck in_progress claims with a watchdog","Avoid multiple supervisors releasing the same claim","Back up task state files to recover from corruption"],"tags":["claim","rollback","state-corruption"],"backgroundTag":"rollback-failure","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}