{"record":{"id":"17099eb59066a760","repo":"Yeachan-Heo/oh-my-codex","slug":"shutdown-detached-session-hud-pane-authorization-u","errorCode":null,"errorMessage":"shutdown_detached_session_HUD_pane_authorization_unavailable:${effectiveHudPaneId}","messagePattern":"shutdown_detached_session_HUD_pane_authorization_unavailable:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":5236,"sourceCode":"      : 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\n        ? freezeSharedPaneAuthorization(\n          effectiveHudPaneId,\n          'HUD pane',\n          effectiveHudPaneId === persistedHudPaneId ? hudPanePid : undefined,\n        )\n        : (() => {\n          if (!persistedHudPaneId || effectiveHudPaneId !== persistedHudPaneId || !tmuxPaneOwnerId\n            || typeof hudPanePid !== 'number' || !Number.isSafeInteger(hudPanePid) || hudPanePid <= 0) {\n            throw new Error(`shutdown_detached_session_HUD_pane_authorization_unavailable:${effectiveHudPaneId}`);\n          }\n          const proof = readExactPaneProofSync(effectiveHudPaneId);\n          if (proof.status !== 'live' || proof.pid !== hudPanePid) {\n            throw new Error(`shutdown_detached_session_HUD_pane_identity_changed:${effectiveHudPaneId}`);\n          }\n          const owner = readPaneTeamOwnerTagResult(proof.paneId);\n          if (owner.status !== 'value' || owner.value !== tmuxPaneOwnerId) {\n            throw new Error(`shutdown_detached_session_HUD_pane_owner_changed:${effectiveHudPaneId}`);\n          }\n          const finalProof = readExactPaneProofSync(proof.paneId);\n          if (finalProof.status !== 'live' || finalProof.pid !== hudPanePid) {\n            throw new Error(`shutdown_detached_session_HUD_pane_identity_changed:${effectiveHudPaneId}`);\n          }\n          return { paneId: finalProof.paneId, pid: hudPanePid, owner: tmuxPaneOwnerId };\n        })())\n      : null;\n    if (persistedLeaderPaneId && trustedHudRestoreLeaderPaneId === persistedLeaderPaneId && (typeof leaderPanePid !== 'number' || !Number.isSafeInteger(leaderPanePid) || leaderPanePid <= 0)) {\n      throw new Error(`shutdown_shared_session_restore_leader_pane_pid_missing:${trustedHudRestoreLeaderPaneId}`);","sourceCodeStart":5218,"sourceCodeEnd":5254,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L5218-L5254","documentation":"In detached-session topology, the HUD pane authorization fallback path requires: a persisted HUD pane id equal to the effective one, a known tmux owner id, and a valid persisted PID. This error fires when any of those preconditions is missing.","triggerScenarios":"Detached (non-shared) topology and (!persistedHudPaneId || effectiveHudPaneId !== persistedHudPaneId || !tmuxPaneOwnerId || invalid hudPanePid) inside the HUD authorization IIFE.","commonSituations":"Detached session where the HUD pane was recreated (effective id differs from persisted); owner id never captured for detached runs; config partially populated.","solutions":["If the HUD pane legitimately moved, clear the stale persisted hud_pane_id/hud_pane_pid so authorization is rebuilt","Ensure tmuxPaneOwnerId is available (run within the tmux session the tool created)","Recreate the detached session from scratch to repopulate config"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (effectiveHudPaneId !== persistedHudPaneId || !isValidPid(hudPanePid) || !tmuxPaneOwnerId) { /* skip pin or refresh config */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["For detached sessions, ensure owner id is captured before shutdown","Refresh persisted hud ids whenever the HUD pane is recreated"],"tags":["tmux","detached-session","stale-state","shutdown"],"backgroundTag":"stale-resource-id","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}