{"record":{"id":"9a313a7d63434371","repo":"Yeachan-Heo/oh-my-codex","slug":"mailbox-notify-failed-finaloutcome-reason","errorCode":null,"errorMessage":"mailbox_notify_failed:${finalOutcome.reason}","messagePattern":"mailbox_notify_failed:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":7063,"sourceCode":"  body: string,\n  cwd: string,\n): Promise<DispatchOutcome> {\n  const sanitized = sanitizeTeamName(teamName);\n  const config = await readTeamConfig(sanitized, cwd);\n  if (!config) throw new Error(`Team ${sanitized} not found`);\n  const manifest = await readTeamManifestV2(sanitized, cwd);\n  const dispatchPolicy = resolveDispatchPolicy(manifest?.policy, config.worker_launch_mode);\n\n  if (toWorker === 'leader-fixed') {\n    const finalOutcome = await sendLeaderMailboxMessage({\n      teamName: sanitized,\n      fromWorker,\n      body,\n      config,\n      dispatchPolicy,\n      cwd,\n    });\n    if (!finalOutcome.ok) throw new Error(`mailbox_notify_failed:${finalOutcome.reason}`);\n    return finalOutcome;\n  }\n\n  const finalOutcome = await sendRecipientMailboxMessage({\n    teamName: sanitized,\n    fromWorker,\n    toWorker,\n    body,\n    config,\n    dispatchPolicy,\n    cwd,\n  });\n  if (!finalOutcome.ok) throw new Error(`mailbox_notify_failed:${finalOutcome.reason}`);\n  return finalOutcome;\n}\n\nexport async function broadcastWorkerMessage(\n  teamName: string,","sourceCodeStart":7045,"sourceCodeEnd":7081,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L7045-L7081","documentation":"Thrown when sending a mailbox message to the 'leader-fixed' recipient fails; finalOutcome.ok is false and the reason is embedded in the message.","triggerScenarios":"Dispatching to toWorker='leader-fixed' and the underlying leader mailbox notify (tmux trigger, file queue write, etc.) reports failure.","commonSituations":"Leader pane/session gone (crashed leader), tmux issues, or mailbox state file write failures.","solutions":["Check the embedded reason (e.g. pane_not_found, write_failed)","Verify the leader worker/session is alive before dispatching","Restart the team or leader worker if its pane is gone"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await dispatch(...) } catch (e) { if (e.message.startsWith('mailbox_notify_failed:')) { const reason = e.message.split(':')[1]; /* restart leader and retry */ } }","preventionTips":["Verify the leader pane is alive before dispatching","Retry with backoff for transient tmux trigger failures"],"tags":["team","mailbox","dispatch","leader"],"backgroundTag":"message-delivery-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}