openai/codex · error

{method} pagination timed out after {timeout:?}

Error message

{method} pagination timed out after {timeout:?}

What it means

Error "{method} pagination timed out after {timeout:?}" thrown in openai/codex.

Source

Thrown at codex-rs/codex-mcp/src/pagination.rs:79

            let Some(next_cursor) = next_cursor else {
                return Ok(collected);
            };
            if next_cursor.len() > MAX_MCP_PAGINATION_CURSOR_BYTES {
                return Err(anyhow!(
                    "{method} returned a pagination cursor exceeding {MAX_MCP_PAGINATION_CURSOR_BYTES} bytes"
                ));
            }
            if !seen_cursors.insert(next_cursor.clone()) {
                return Err(anyhow!("{method} returned a repeated pagination cursor"));
            }
            cursor = Some(next_cursor);
        }
    };

    let timeout = overall_timeout.unwrap_or(DEFAULT_MCP_PAGINATION_TIMEOUT);
    tokio::time::timeout(timeout, collect)
        .await
        .map_err(|_| anyhow!("{method} pagination timed out after {timeout:?}"))?
}

#[cfg(test)]
#[path = "pagination_tests.rs"]
mod tests;

View on GitHub (pinned to 339751715c)

Solutions

  1. Increase the pagination timeout or reduce per-page latency; check the MCP server's responsiveness.

When it happens

Trigger: Thrown at codex-rs/codex-mcp/src/pagination.rs:79 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/5b878c9c621b6132. Report an issue: GitHub.