{"record":{"id":"781e57c897096717","repo":"Yeachan-Heo/oh-my-codex","slug":"shutdown-shared-session-kind-replaceall-781e57","errorCode":null,"errorMessage":"shutdown_shared_session_${kind.replaceAll(' ', '_')}_pid_missing:${paneId}","messagePattern":"shutdown_shared_session_(.+?)_pid_missing:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":5183,"sourceCode":"    const expectedSharedWorkerPanePids = new Map<string, number>();\n    const prekillResolvedWorkerPaneIds = new Set<string>();\n    type FrozenSharedPaneAuthorization = {\n      paneId: string;\n      pid: number;\n      owner: string | null;\n    };\n    const freezeSharedPaneAuthorization = (\n      paneId: string,\n      kind: 'HUD pane' | 'restore leader pane',\n      expectedPid?: number | null,\n    ): FrozenSharedPaneAuthorization => {\n      const proof = readExactPaneProofSync(paneId);\n      if (proof.status !== 'live') {\n        throw new Error(`shutdown_shared_session_${kind.replaceAll(' ', '_')}_proof_unavailable:${paneId}`);\n      }\n      if (typeof expectedPid === 'number') {\n        if (!Number.isSafeInteger(expectedPid) || expectedPid <= 0) {\n          throw new Error(`shutdown_shared_session_${kind.replaceAll(' ', '_')}_pid_missing:${paneId}`);\n        }\n        if (proof.pid !== expectedPid) {\n          throw new Error(`shutdown_shared_session_${kind.replaceAll(' ', '_')}_identity_changed:${paneId}`);\n        }\n      }\n      const owner = readPaneTeamOwnerTagResult(paneId);\n      if (owner.status === 'error') {\n        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 => {","sourceCodeStart":5165,"sourceCodeEnd":5201,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L5165-L5201","documentation":"Thrown when an expected PID was supplied for a shared pane during shutdown but it is not a valid positive safe integer. This is a guard against corrupt or malformed persisted PID values before they are compared against the live pane proof.","triggerScenarios":"freezeSharedPaneAuthorization is called with expectedPid that is a number but fails Number.isSafeInteger or is <= 0 — e.g. hudPanePid of 0, -1, a float, or a corrupted value read from config.","commonSituations":"Config files hand-edited or written by an older version storing hud_pane_pid = 0/null coerced to number; PID fields corrupted by partial writes.","solutions":["Sanitize persisted pane PID values on load: treat non-safe-integer or <=0 values as absent","Delete/reset the stored hud_pane_pid (or whole pane block) in the config so shutdown falls back to proof-only authorization","Upgrade to a version that writes pane PIDs atomically"],"exampleFix":"// before\nconst hudPanePid = config.hud_pane_pid; // could be 0\n// after\nconst hudPanePid = typeof config.hud_pane_pid === 'number' && Number.isSafeInteger(config.hud_pane_pid) && config.hud_pane_pid > 0 ? config.hud_pane_pid : undefined;","handlingStrategy":"validation","validationCode":"const safePid = (p) => typeof p === 'number' && Number.isSafeInteger(p) && p > 0 ? p : undefined;","typeGuard":"const isSafePid = (p: unknown): p is number => typeof p === 'number' && Number.isSafeInteger(p) && p > 0;","tryCatchPattern":null,"preventionTips":["Sanitize persisted pid fields on config load","Never hand-edit pid fields in config"],"tags":["tmux","validation","pid","shutdown"],"backgroundTag":"invalid-numeric-config-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}