{"record":{"id":"31719e2a96d8ffb3","repo":"Yeachan-Heo/oh-my-codex","slug":"mailbox-notify-failed-firstfailure-reason-u","errorCode":null,"errorMessage":"mailbox_notify_failed:${firstFailure?.reason ?? 'unknown'}","messagePattern":"mailbox_notify_failed:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":7125,"sourceCode":"    fallbackAllowed: transportPreference === 'hook_preferred_with_fallback',\n    notify: async (target, message) =>\n      transportPreference === 'hook_preferred_with_fallback'\n        ? { ok: true, transport: 'hook', reason: 'queued_for_hook_dispatch' }\n        : (typeof target.workerIndex === 'number'\n        ? await notifyWorkerOutcome(config, target.workerIndex, message, target.paneId)\n        : { ok: false, transport: 'none', reason: 'missing_worker_index' }),\n  });\n  const results = await finalizeBroadcastMailboxOutcomes({\n    teamName: sanitized,\n    outcomes,\n    transportPreference,\n    config,\n    dispatchPolicy,\n    cwd,\n  });\n  if (results.some((result) => !result.ok)) {\n    const firstFailure = results.find((result) => !result.ok);\n    throw new Error(`mailbox_notify_failed:${firstFailure?.reason ?? 'unknown'}`);\n  }\n}\n","sourceCodeStart":7107,"sourceCodeEnd":7128,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L7107-L7128","documentation":"Thrown after a broadcast when at least one worker's mailbox notify failed; the message contains the first failing outcome's reason (or 'unknown').","triggerScenarios":"queueBroadcastMailboxMessage returns per-worker results and any result has ok=false — e.g. one worker's pane is dead while others succeeded.","commonSituations":"Partially degraded teams: one worker crashed or was scaled down, tmux issues affecting a single pane.","solutions":["Inspect the reason suffix to identify which failure mode hit","Verify all workers' panes/processes are alive before broadcasting","Treat broadcast as best-effort: catch and retry only to failed workers"],"exampleFix":"// before\nawait broadcastWorkerMessage(teamName, fromWorker, body, cwd);\n// after\ntry { await broadcastWorkerMessage(teamName, fromWorker, body, cwd); }\ncatch (e) { /* inspect reason, retry to dead workers after restart */ }","handlingStrategy":"try-catch","validationCode":"const dead = cfg.workers.filter(w => !isWorkerAlive(w)); if (dead.length) await restartWorkers(dead);","typeGuard":null,"tryCatchPattern":"try { await broadcastWorkerMessage(...) } catch (e) { if (e.message.startsWith('mailbox_notify_failed:')) { /* partial failure: log and retry targeted workers */ } }","preventionTips":["Treat broadcast as best-effort; log per-worker outcomes","Ensure all workers are healthy before broadcasting"],"tags":["team","broadcast","mailbox","partial-failure"],"backgroundTag":"message-delivery-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}