{"record":{"id":"730613173e0df104","repo":"Yeachan-Heo/oh-my-codex","slug":"tmux-pane-is-not-proven-live-paneid","errorCode":null,"errorMessage":"tmux pane is not proven live: ${paneId}","messagePattern":"tmux pane is not proven live: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/team/tmux-session.ts","lineNumber":585,"sourceCode":"  const hudMatches = !topology.error && topology.panes.filter((pane) => pane.paneId === debt.pane_id\n    && hudPaneMatchesOwner(pane, { leaderPaneId: debt.hud_owner_leader_pane_id })).length === 1;\n  if (!hudMatches) throw new Error(`restored_hud_cleanup_debt_unresolved:${debt.pane_id}`);\n  const finalProof = readExactPaneProofSync(debt.pane_id);\n  if (finalProof.status !== 'live' || finalProof.pid !== debt.pane_pid) {\n    throw new Error(`restored_hud_cleanup_debt_unresolved:${debt.pane_id}`);\n  }\n  removeRestoredHudCleanupDebtSync(record.path);\n}\n\n\n/**\n * Kill only a pane that a fresh global snapshot proves live. Callers treat\n * gone/dead rows as already cleaned and unavailable snapshots as fail-closed.\n */\nfunction requireLiveExactPaneSync(paneId: string, expectedPid?: number): string {\n  const proof = readExactPaneProofSync(paneId);\n  if (proof.status === 'unavailable') throw new ExactPaneProofUnavailableError(proof);\n  if (proof.status === 'gone') throw new Error(`tmux pane is not proven live: ${paneId}`);\n  if (expectedPid !== undefined && proof.pid !== expectedPid) {\n    throw new Error(`tmux pane identity changed: ${paneId}`);\n  }\n  return proof.paneId;\n}\n\nfunction killExactPaneSync(paneId: string, expectedPid?: number, assertAuthorization?: () => void): void {\n  const proof = readExactPaneProofSync(paneId);\n  if (proof.status === 'unavailable') throw new ExactPaneProofUnavailableError(proof);\n  if (proof.status === 'gone') return;\n  if (expectedPid !== undefined && proof.pid !== expectedPid) {\n    throw new Error(`tmux pane identity changed: ${paneId}`);\n  }\n  assertAuthorization?.();\n  // Authorization can read tmux. Re-prove immediately after it so a recycled\n  // pane ID cannot be targeted by the subsequent kill.\n  const finalProof = readExactPaneProofSync(proof.paneId);\n  if (finalProof.status === 'unavailable') throw new ExactPaneProofUnavailableError(finalProof);","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/tmux-session.ts#L567-L603","documentation":"requireLiveExactPaneSync demands a fresh global snapshot proving the pane is live before any destructive operation. `gone' means tmux explicitly reported the pane as dead/deleted — callers should treat this as 'already cleaned' rather than an actual failure, but the guard throws so no action is taken.","triggerScenarios":"Calling kill/cleanup paths (requireLiveExactPaneSync) for a pane that tmux already deleted: normal shutdown race where the pane exited first, or a previous cleanup already killed it.","commonSituations":"Idempotent cleanup retries; agent pane finished and closed before the sweeper ran; double-shutdown paths.","solutions":["Catch this and treat as success/no-op when cleaning up (pane already gone)","Avoid retry storms: check whether your orchestrator already killed the pane","No repair needed if the goal was removal"],"exampleFix":"// before\nrequireLiveExactPaneSync(paneId);\n// after\ntry { requireLiveExactPaneSync(paneId); }\ncatch (e) { if (!/not proven live/.test(e.message)) throw e; /* already gone */ }","handlingStrategy":"try-catch","validationCode":"const proof = readExactPaneProofSync(paneId);\nif (proof.status === 'gone') return; // already cleaned","typeGuard":"const paneIsGone = (p: ExactPaneProof): boolean => p.status === 'gone';","tryCatchPattern":"catch (e) { if (/not proven live/.test(e.message)) return; /* idempotent success */ throw e; }","preventionTips":["Make cleanup idempotent and treat 'gone' as success"],"tags":["tmux","pane-lifecycle","idempotency"],"backgroundTag":"resource-already-deleted","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}