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

${label} is not a file: ${path}

Error message

${label} is not a file: ${path}

What it means

requireFrozenWindowTopologySync ends with a second full topology read (listPanesResult) to confirm the pane set didn't change during validation. If that final `tmux list-panes` fails, this error wraps the tmux failure — validation cannot conclude.

Source

Thrown at src/auth/paths.ts:68

  const codexHome = resolveCodexHomeForLaunch(cwd, env) || resolveDefaultCodexHome(home);
  return join(codexHome, "auth.json");
}

export async function ensurePrivateDir(dir: string): Promise<void> {
  await mkdir(dir, { recursive: true, mode: AUTH_DIR_MODE });
  const info = await lstat(dir);
  if (info.isSymbolicLink()) throw new Error(`auth directory must not be a symlink: ${dir}`);
  if (!info.isDirectory()) throw new Error(`auth path is not a directory: ${dir}`);
  if (process.platform !== "win32") {
    const { chmod } = await import("fs/promises");
    await chmod(dir, AUTH_DIR_MODE).catch(() => undefined);
  }
}

export async function assertReadableFile(path: string, label: string): Promise<void> {
  try {
    const info = await stat(path);
    if (!info.isFile()) throw new Error(`${label} is not a file: ${path}`);
  } catch (err) {
    if (err && typeof err === "object" && "code" in err && err.code === "ENOENT") {
      throw new Error(`${label} not found: ${path}`);
    }
    throw err;
  }
}

export async function assertNoSymlink(path: string, label: string): Promise<void> {
  try {
    const { lstat } = await import("fs/promises");
    const info = await lstat(path);
    if (info.isSymbolicLink()) throw new Error(`${label} must not be a symlink: ${path}`);
  } catch (err) {
    if (err && typeof err === "object" && "code" in err && err.code === "ENOENT") return;
    throw err;
  }
}

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Check `tmux has-session -t <name>`; recreate the team session if gone
  2. Read the embedded error text for the tmux stderr cause
  3. Retry the guarded operation once if the session is confirmed alive
  4. Avoid running tmux kill-server / session cleanup concurrently with guarded operations
Defensive patterns

Strategy: retry

Validate before calling

runTmuxOk(['has-session', '-t', teamTarget]);

Try / catch

catch (err) { if (/failed to read tmux pane topology/.test(err.message)) { if (sessionAlive) retryOnce(); else rebuildTeamSession(); } }

Prevention

When it happens

Trigger: The session or tmux server dying between the first and final topology reads within one validation call, or transient tmux command failure under load.

Common situations: Session killed externally mid-operation, tmux server restart, or socket issues.

Related errors


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