{"record":{"id":"ef4c3bf3401681f9","repo":"Yeachan-Heo/oh-my-codex","slug":"shutdown-scope-kind-replaceall-own","errorCode":null,"errorMessage":"shutdown_${scope}_${kind.replaceAll(' ', '_')}_owner_unavailable:${authorization.paneId}:${owner.error}","messagePattern":"shutdown_(.+?)_(.+?)_owner_unavailable:(.+?):(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":5209,"sourceCode":"        throw new Error(`shutdown_shared_session_${kind.replaceAll(' ', '_')}_owner_unavailable:${paneId}:${owner.error}`);\n      }\n      if (owner.status !== 'value' || !tmuxPaneOwnerId || owner.value !== tmuxPaneOwnerId) {\n        throw new Error(`shutdown_shared_session_${kind.replaceAll(' ', '_')}_owner_changed:${paneId}`);\n      }\n      return { paneId, pid: proof.pid, owner: owner.value };\n    };\n    const assertSharedPaneAuthorizationContinuous = (\n      authorization: FrozenSharedPaneAuthorization,\n      kind: 'HUD pane' | 'restore leader pane',\n    ): void => {\n      const scope = sharedSessionTopology ? 'shared_session' : 'detached_session';\n      const proof = readExactPaneProofSync(authorization.paneId);\n      if (proof.status !== 'live' || proof.pid !== authorization.pid) {\n        throw new Error(`shutdown_${scope}_${kind.replaceAll(' ', '_')}_identity_changed:${authorization.paneId}`);\n      }\n      const owner = readPaneTeamOwnerTagResult(authorization.paneId);\n      if (owner.status === 'error') {\n        throw new Error(`shutdown_${scope}_${kind.replaceAll(' ', '_')}_owner_unavailable:${authorization.paneId}:${owner.error}`);\n      }\n      const currentOwner = owner.status === 'value' ? owner.value : null;\n      if (currentOwner !== authorization.owner) {\n        throw new Error(`shutdown_${scope}_${kind.replaceAll(' ', '_')}_owner_changed:${authorization.paneId}`);\n      }\n    };\n    const persistedHudPaneId = typeof hudPaneId === 'string' && /^%[0-9]+$/.test(hudPaneId)\n      ? hudPaneId\n      : null;\n    const persistedLeaderPaneId = typeof leaderPaneId === 'string' && /^%[0-9]+$/.test(leaderPaneId)\n      ? leaderPaneId\n      : null;\n    if (persistedHudPaneId && effectiveHudPaneId === persistedHudPaneId && (typeof hudPanePid !== 'number' || !Number.isSafeInteger(hudPanePid) || hudPanePid <= 0)) {\n      const scope = sharedSessionTopology ? 'shared_session' : 'detached_session';\n      throw new Error(`shutdown_${scope}_HUD_pane_pid_missing:${effectiveHudPaneId}`);\n    }\n    const frozenHudAuthorization = effectiveHudPaneId\n      ? (sharedSessionTopology","sourceCodeStart":5191,"sourceCodeEnd":5227,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L5191-L5227","documentation":"Thrown by assertSharedPaneAuthorizationContinuous when re-reading a pane's team owner tag mid-shutdown errors out. The shutdown flow deliberately aborts rather than continue with unverifiable ownership.","triggerScenarios":"readPaneTeamOwnerTagResult returns status 'error' during a continuity check — tmux command failure, socket error, or server termination between teardown phases.","commonSituations":"tmux server exiting during shutdown; transient EPIPE/ENOENT on the tmux socket; environment variable TMUX unset mid-process.","solutions":["Check the appended error string; retry shutdown after confirming tmux is healthy (tmux info)","If the tmux server is gone, the session is already down — clear persisted state and finish cleanup manually","Pin a stable tmux socket (set -g default-terminal / Sockets) if tmpdir cleanup races are involved"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (e) { if (/owner_unavailable:/.test(e.message) && retries < 3) return retry(); throw e; }","preventionTips":["Keep TMUX env and socket stable during teardown","Check tmux info when the appended error appears"],"tags":["tmux","transient","owner-tag","shutdown"],"backgroundTag":"tmux-owner-tag-read-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}