{"record":{"id":"054c7acccc3dd6ea","repo":"openai/codex","slug":"method-returned-a-pagination-cursor-exceeding-m","errorCode":null,"errorMessage":"{method} returned a pagination cursor exceeding {MAX_MCP_PAGINATION_CURSOR_BYTES} bytes","messagePattern":"(.+?) returned a pagination cursor exceeding (.+?) bytes","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/codex-mcp/src/pagination.rs","lineNumber":65,"sourceCode":"                ));\n            }\n            page_count += 1;\n            let params = cursor.as_ref().map(|next: &String| {\n                PaginatedRequestParams::default().with_cursor(Some(next.clone()))\n            });\n            let (items, next_cursor) = fetch(params).await?;\n            if items.len() > max_items.saturating_sub(collected.len()) {\n                return Err(anyhow!(\n                    \"{method} exceeded the catalog limit of {max_items} items\"\n                ));\n            }\n            collected.extend(items);\n\n            let Some(next_cursor) = next_cursor else {\n                return Ok(collected);\n            };\n            if next_cursor.len() > MAX_MCP_PAGINATION_CURSOR_BYTES {\n                return Err(anyhow!(\n                    \"{method} returned a pagination cursor exceeding {MAX_MCP_PAGINATION_CURSOR_BYTES} bytes\"\n                ));\n            }\n            if !seen_cursors.insert(next_cursor.clone()) {\n                return Err(anyhow!(\"{method} returned a repeated pagination cursor\"));\n            }\n            cursor = Some(next_cursor);\n        }\n    };\n\n    let timeout = overall_timeout.unwrap_or(DEFAULT_MCP_PAGINATION_TIMEOUT);\n    tokio::time::timeout(timeout, collect)\n        .await\n        .map_err(|_| anyhow!(\"{method} pagination timed out after {timeout:?}\"))?\n}\n\n#[cfg(test)]\n#[path = \"pagination_tests.rs\"]","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/codex-mcp/src/pagination.rs#L47-L83","documentation":"Error \"{method} returned a pagination cursor exceeding {MAX_MCP_PAGINATION_CURSOR_BYTES} bytes\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/codex-mcp/src/pagination.rs:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the MCP server to return compact pagination cursors under the byte limit."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}