{"record":{"id":"e601e23c2a8eefb0","repo":"Yeachan-Heo/oh-my-codex","slug":"startup-cleanup-pane-owner-unavailable-cleanuppa","errorCode":null,"errorMessage":"startup_cleanup_pane_owner_unavailable:${cleanupPane.pane_id}:${owner.error}","messagePattern":"startup_cleanup_pane_owner_unavailable:(.+?):(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":409,"sourceCode":"    }\n    const proof = readExactPaneProofSync(cleanupPane.pane_id);\n    if (proof.status === 'gone') {\n      resolvedPaneIds.add(cleanupPane.pane_id);\n      continue;\n    }\n    if (proof.status === 'unavailable') {\n      assertPaneTeardownProofsAvailable('startup_cleanup', [proof]);\n      continue;\n    }\n    if (cleanupPane.pid === null) {\n      throw new Error(`startup_cleanup_pane_pid_missing:${cleanupPane.pane_id}`);\n    }\n    if (proof.pid !== cleanupPane.pid) {\n      throw new Error(`startup_cleanup_pane_identity_changed:${cleanupPane.pane_id}`);\n    }\n    const owner = readPaneTeamOwnerTagResult(cleanupPane.pane_id);\n    if (owner.status === 'error') {\n      throw new Error(`startup_cleanup_pane_owner_unavailable:${cleanupPane.pane_id}:${owner.error}`);\n    }\n    if (owner.status !== 'value' || owner.value !== teamPaneOwnerId) {\n      throw new Error(`startup_cleanup_pane_owner_changed:${cleanupPane.pane_id}`);\n    }\n    expectedPanePids[cleanupPane.pane_id] = cleanupPane.pid;\n  }\n\n  const livePaneIds = Object.keys(expectedPanePids);\n  if (livePaneIds.length > 0) {\n    const teardown = await teardownWorkerPanes(livePaneIds, {\n      leaderPaneId: config.leader_pane_id,\n      hudPaneId: config.hud_pane_id,\n      expectedPanePids,\n      authorizePaneKill: (paneId, proof) => {\n        if (expectedPanePids[paneId] !== proof.pid) return false;\n        const owner = readPaneTeamOwnerTagResult(paneId);\n        return owner.status === 'value' && owner.value === teamPaneOwnerId;\n      },","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L391-L427","documentation":"To prove ownership of a cleanup pane the code reads the pane's team-owner tmux tag; if that read itself errors (tmux command failure, missing user option, shell error), the check cannot distinguish 'ours' from 'not ours', so it aborts with the pane id and the underlying error string.","triggerScenarios":"readPaneTeamOwnerTagResult returning status 'error' — tmux not installed/not running, session destroyed mid-read, `tmux show-options -p` failing, or a malformed user option.","commonSituations":"tmux server restarted or exited between existence check and tag read; SSH session drop; PATH issues finding tmux in the runtime environment.","solutions":["Verify tmux is running and the pane's session still exists (`tmux has-session` / `tmux list-panes`)","Retry the reconcile — transient tmux server races often clear","Check the appended owner.error string for the concrete tmux failure (exit code / stderr)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await reconcileStartupCleanupPanes(config, cwd); } catch (e) { if (e instanceof Error && e.message.startsWith('startup_cleanup_pane_owner_unavailable:') && e.message.includes(':')) { const err = e.message.split(':').pop(); /* inspect tmux error; retry on transient */ } throw e; }","preventionTips":["Ensure tmux is installed and its server alive","Retry once on transient tmux failures","Read the appended underlying error before acting"],"tags":["team-runtime","tmux","transient-failure","ownership"],"backgroundTag":"tmux-command-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}