Yeachan-Heo/oh-my-codex · error · Error

shutdown_shared_session_${kind.replaceAll(' ', '_')}_pid_mis

Error message

shutdown_shared_session_${kind.replaceAll(' ', '_')}_pid_missing:${paneId}

What it means

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.

Source

Thrown at src/team/runtime.ts:5183

    const expectedSharedWorkerPanePids = new Map<string, number>();
    const prekillResolvedWorkerPaneIds = new Set<string>();
    type FrozenSharedPaneAuthorization = {
      paneId: string;
      pid: number;
      owner: string | null;
    };
    const freezeSharedPaneAuthorization = (
      paneId: string,
      kind: 'HUD pane' | 'restore leader pane',
      expectedPid?: number | null,
    ): FrozenSharedPaneAuthorization => {
      const proof = readExactPaneProofSync(paneId);
      if (proof.status !== 'live') {
        throw new Error(`shutdown_shared_session_${kind.replaceAll(' ', '_')}_proof_unavailable:${paneId}`);
      }
      if (typeof expectedPid === 'number') {
        if (!Number.isSafeInteger(expectedPid) || expectedPid <= 0) {
          throw new Error(`shutdown_shared_session_${kind.replaceAll(' ', '_')}_pid_missing:${paneId}`);
        }
        if (proof.pid !== expectedPid) {
          throw new Error(`shutdown_shared_session_${kind.replaceAll(' ', '_')}_identity_changed:${paneId}`);
        }
      }
      const owner = readPaneTeamOwnerTagResult(paneId);
      if (owner.status === 'error') {
        throw new Error(`shutdown_shared_session_${kind.replaceAll(' ', '_')}_owner_unavailable:${paneId}:${owner.error}`);
      }
      if (owner.status !== 'value' || !tmuxPaneOwnerId || owner.value !== tmuxPaneOwnerId) {
        throw new Error(`shutdown_shared_session_${kind.replaceAll(' ', '_')}_owner_changed:${paneId}`);
      }
      return { paneId, pid: proof.pid, owner: owner.value };
    };
    const assertSharedPaneAuthorizationContinuous = (
      authorization: FrozenSharedPaneAuthorization,
      kind: 'HUD pane' | 'restore leader pane',
    ): void => {

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Sanitize persisted pane PID values on load: treat non-safe-integer or <=0 values as absent
  2. Delete/reset the stored hud_pane_pid (or whole pane block) in the config so shutdown falls back to proof-only authorization
  3. Upgrade to a version that writes pane PIDs atomically

Example fix

// before
const hudPanePid = config.hud_pane_pid; // could be 0
// after
const hudPanePid = typeof config.hud_pane_pid === 'number' && Number.isSafeInteger(config.hud_pane_pid) && config.hud_pane_pid > 0 ? config.hud_pane_pid : undefined;
Defensive patterns

Strategy: validation

Validate before calling

const safePid = (p) => typeof p === 'number' && Number.isSafeInteger(p) && p > 0 ? p : undefined;

Type guard

const isSafePid = (p: unknown): p is number => typeof p === 'number' && Number.isSafeInteger(p) && p > 0;

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27). Data as JSON: /api/errors/781e57c897096717. Report an issue: GitHub.