openclaw/openclaw · error · Error

Codex thread/loaded/list exceeded ${MAX_COMPAT_PAGINATION_PA

Error message

Codex thread/loaded/list exceeded ${MAX_COMPAT_PAGINATION_PAGES} pages with a continuation cursor

What it means

Thrown by listLoadedSessions when pagination exceeds MAX_COMPAT_PAGINATION_PAGES (100) without terminating. Loaded-thread listing has no caller limit, so the only stop conditions are an empty cursor or a repeated cursor; this guard catches runaway pagination.

Source

Thrown at extensions/codex/src/supervision-tools.ts:612

        if (!isLoadedThreadReadMiss(error)) {
          throw error;
        }
      }
    }
    const nextCursor = readCompatNextCursor(listed.nextCursor, "thread/loaded/list");
    if (nextCursor && seenCursors.has(nextCursor)) {
      throw new Error(`Codex thread/loaded/list returned repeated cursor ${nextCursor}`);
    }
    if (nextCursor) {
      seenCursors.add(nextCursor);
    }
    cursor = nextCursor;
    if (!cursor) {
      break;
    }
  }
  if (cursor) {
    throw new Error(
      `Codex thread/loaded/list exceeded ${MAX_COMPAT_PAGINATION_PAGES} pages with a continuation cursor`,
    );
  }
  return sessions;
}

async function listStoredSessions(params: {
  request: EndpointRequest;
  endpoint: ResolvedSupervisionEndpoint;
  limit: number;
}): Promise<CodexSupervisorSession[]> {
  const sessions: CodexSupervisorSession[] = [];
  const seenCursors = new Set<string>();
  let cursor: string | undefined;
  for (let pageIndex = 0; pageIndex < MAX_COMPAT_PAGINATION_PAGES; pageIndex += 1) {
    const remaining = params.limit - sessions.length;
    if (remaining <= 0) {
      break;

View on GitHub (pinned to 01804a7531)

Solutions

  1. Close unused loaded threads in Codex to reduce the active set below ~10,000.
  2. Confirm the app-server isn't returning empty pages with fresh cursors.
  3. Use codex_session_read with a known thread id instead of listing when possible.
Defensive patterns

Strategy: try-catch

Prevention

When it happens

Trigger: More than 100 pages x 100 entries (>10,000 loaded threads) returned with always-fresh cursors.

Common situations: A very large number of loaded (active) Codex threads; or an app-server pagination bug returning endless cursors.

Related errors


AI-assisted analysis of openclaw/openclaw@01804a7531 (2026-08-12). Data as JSON: /api/errors/586b19244993d0c6. Report an issue: GitHub.