{"record":{"id":"6141b9e993491bf4","repo":"Yeachan-Heo/oh-my-codex","slug":"invalid-auth-slot-path","errorCode":null,"errorMessage":"invalid auth slot path","messagePattern":"invalid auth slot path","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/auth/paths.ts","lineNumber":36,"sourceCode":"  const trimmed = slot.trim();\n  if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(trimmed)) {\n    throw new Error(\n      \"invalid auth slot name: use 1-64 letters, numbers, '.', '_' or '-' and start with a letter or number\",\n    );\n  }\n  if (trimmed === \".\" || trimmed === \"..\" || basename(trimmed) !== trimmed) {\n    throw new Error(\"invalid auth slot name: path traversal is not allowed\");\n  }\n  return trimmed;\n}\n\nexport function resolveSlotPath(slot: string, home = homedir()): string {\n  const safeSlot = validateSlotName(slot);\n  const authDir = resolveOmxAuthDir(home);\n  const candidate = resolve(authDir, `${safeSlot}.json`);\n  const expected = join(resolve(authDir), `${safeSlot}.json`);\n  if (candidate !== expected) {\n    throw new Error(\"invalid auth slot path\");\n  }\n  return candidate;\n}\n\nexport function resolveDefaultCodexHome(home = homedir()): string {\n  return join(home, \".codex\");\n}\n\nexport function resolveLiveAuthPath(\n  cwd = process.cwd(),\n  env: NodeJS.ProcessEnv = process.env,\n  home = homedir(),\n): string {\n  const codexHome = resolveCodexHomeForLaunch(cwd, env) || resolveDefaultCodexHome(home);\n  return join(codexHome, \"auth.json\");\n}\n\nexport async function ensurePrivateDir(dir: string): Promise<void> {","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/auth/paths.ts#L18-L54","documentation":"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.","triggerScenarios":"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.","commonSituations":"Concurrent session teardown racing the guarded operation, tmux server shutdown mid-call, or heavy tmux load causing command failures.","solutions":["Eliminate concurrent teardown during guarded operations (serialize via a lock or lifecycle flag)","Retry the guarded operation once after confirming the session still exists","Capture tmux stderr from the proof reason for the real cause","Recreate the team session if the session was lost"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"runTmuxOk(['has-session', '-t', teamTarget]) && allPaneIdsPresent(teamTarget, expectedPanePids.keys());","typeGuard":null,"tryCatchPattern":"catch (err) { if (err instanceof ExactPaneProofUnavailableError) { verifySessionAlive(); retryOnce(); } else throw err; }","preventionTips":["Lock against concurrent teardown","Retry once after confirming session health","Capture tmux stderr from the proof for diagnosis"],"tags":["tmux","race-condition","toctou","validation"],"backgroundTag":"tmux-pane-verification-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}