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

invalid auth slot path

Error message

invalid auth slot path

What it means

After the per-pane loop, requireFrozenWindowTopologySync re-reads all pane proofs in one batch (readExactPaneProofsSync) as a second pass. If any single proof comes back 'unavailable' (read failure, not live/gone), this ExactPaneProofUnavailableError is thrown — the double-check exists to catch races during validation itself.

Source

Thrown at src/auth/paths.ts:36

  const trimmed = slot.trim();
  if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(trimmed)) {
    throw new Error(
      "invalid auth slot name: use 1-64 letters, numbers, '.', '_' or '-' and start with a letter or number",
    );
  }
  if (trimmed === "." || trimmed === ".." || basename(trimmed) !== trimmed) {
    throw new Error("invalid auth slot name: path traversal is not allowed");
  }
  return trimmed;
}

export function resolveSlotPath(slot: string, home = homedir()): string {
  const safeSlot = validateSlotName(slot);
  const authDir = resolveOmxAuthDir(home);
  const candidate = resolve(authDir, `${safeSlot}.json`);
  const expected = join(resolve(authDir), `${safeSlot}.json`);
  if (candidate !== expected) {
    throw new Error("invalid auth slot path");
  }
  return candidate;
}

export function resolveDefaultCodexHome(home = homedir()): string {
  return join(home, ".codex");
}

export function resolveLiveAuthPath(
  cwd = process.cwd(),
  env: NodeJS.ProcessEnv = process.env,
  home = homedir(),
): string {
  const codexHome = resolveCodexHomeForLaunch(cwd, env) || resolveDefaultCodexHome(home);
  return join(codexHome, "auth.json");
}

export async function ensurePrivateDir(dir: string): Promise<void> {

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Eliminate concurrent teardown during guarded operations (serialize via a lock or lifecycle flag)
  2. Retry the guarded operation once after confirming the session still exists
  3. Capture tmux stderr from the proof reason for the real cause
  4. Recreate the team session if the session was lost
Defensive patterns

Strategy: retry

Validate before calling

runTmuxOk(['has-session', '-t', teamTarget]) && allPaneIdsPresent(teamTarget, expectedPanePids.keys());

Try / catch

catch (err) { if (err instanceof ExactPaneProofUnavailableError) { verifySessionAlive(); retryOnce(); } else throw err; }

Prevention

When it happens

Trigger: A pane or the whole session dying, or tmux erroring, between the first per-pane validation and the batched final proof read inside one topology check.

Common situations: Concurrent session teardown racing the guarded operation, tmux server shutdown mid-call, or heavy tmux load causing command failures.

Related errors


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