{"record":{"id":"95a5114d52f57d3a","repo":"openai/codex","slug":"capability-root-discovery-accepts-at-most-max-roo","errorCode":null,"errorMessage":"capability root discovery accepts at most {MAX_ROOTS_PER_REQUEST} roots","messagePattern":"capability root discovery accepts at most (.+?) roots","errorType":"exception","errorClass":"CapabilityDiscoveryError","httpStatus":null,"severity":"error","filePath":"codex-rs/exec-server/src/capability_discovery.rs","lineNumber":34,"sourceCode":"use codex_utils_path_uri::PathUri;\nuse futures::StreamExt;\nuse serde::Deserialize;\nuse serde_json::Value;\n\npub(crate) const MAX_ROOTS_PER_REQUEST: usize = 128;\nconst MAX_SCAN_DEPTH: usize = 6;\nconst MAX_DIRECTORIES_PER_ROOT: usize = 2_000;\nconst MAX_ENTRIES_PER_ROOT: usize = 20_000;\nconst MAX_FILE_BYTES: usize = 1024 * 1024;\nconst MAX_BUNDLE_BYTES_PER_ROOT: usize = 16 * 1024 * 1024;\nconst MAX_CONCURRENT_ROOTS: usize = 8;\nconst SKILL_FILE_NAME: &str = \"SKILL.md\";\nconst SKILL_METADATA_PATH: &str = \"agents/openai.yaml\";\nconst DEFAULT_MCP_CONFIG_PATH: &str = \".mcp.json\";\n\n#[derive(Debug, thiserror::Error)]\npub enum CapabilityDiscoveryError {\n    #[error(\"capability root discovery accepts at most {MAX_ROOTS_PER_REQUEST} roots\")]\n    TooManyRoots,\n}\n\n/// Discovers and materializes capability manifests using one executor-local filesystem.\n///\n/// Product parsing and policy intentionally remain with the caller. This operation owns the\n/// filesystem-expensive portion: bounded traversal, recognized-file selection, and reads.\n#[tracing::instrument(\n    name = \"capability_roots.discover_v1\",\n    skip_all,\n    fields(root_count = params.roots.len())\n)]\npub async fn discover_capability_roots(\n    file_system: &dyn ExecutorFileSystem,\n    params: CapabilityRootsDiscoverParams,\n) -> Result<CapabilityRootsDiscoverResponse, CapabilityDiscoveryError> {\n    if params.roots.len() > MAX_ROOTS_PER_REQUEST {\n        return Err(CapabilityDiscoveryError::TooManyRoots);","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/exec-server/src/capability_discovery.rs#L16-L52","documentation":"Error \"capability root discovery accepts at most {MAX_ROOTS_PER_REQUEST} roots\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/exec-server/src/capability_discovery.rs:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send at most the allowed number of roots per capability discovery request."],"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"}