{"record":{"id":"9726ddfdf3e5abfb","repo":"openai/codex","slug":"failed-to-load-agents-md-instructions-for-environm","errorCode":null,"errorMessage":"failed to load AGENTS.md instructions for environment `{}`: {error}","messagePattern":"failed to load AGENTS\\.md instructions for environment `(.+?)`: (.+?)","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/core/src/agents_md.rs","lineNumber":117,"sourceCode":"            sandbox.as_ref(),\n        )\n        .await\n        {\n            Ok(Some(docs)) => {\n                for entry in docs.entries {\n                    remaining = remaining.saturating_sub(entry.contents.len());\n                    loaded.entries.push(entry);\n                }\n            }\n            Ok(None) => {}\n            Err(error) if sandbox.is_none() => {\n                error!(\n                    environment_id = turn_environment.selection.environment_id,\n                    \"error trying to find AGENTS.md docs: {error:#}\"\n                );\n            }\n            Err(error) => {\n                return Err(io::Error::new(\n                    error.kind(),\n                    format!(\n                        \"failed to load AGENTS.md instructions for environment `{}`: {error}\",\n                        turn_environment.selection.environment_id\n                    ),\n                ));\n            }\n        }\n    }\n\n    Ok((!loaded.is_empty()).then_some(loaded))\n}\n\n/// Attempt to locate and load AGENTS.md documentation.\n///\n/// On success returns `Ok(Some(loaded))` where `loaded` contains every\n/// discovered doc. If no documentation file is found the function returns\n/// `Ok(None)`. Unexpected I/O failures bubble up as `Err` so callers can","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/core/src/agents_md.rs#L99-L135","documentation":"Error \"failed to load AGENTS.md instructions for environment `{}`: {error}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/core/src/agents_md.rs:117 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the AGENTS.md file exists and is readable in the reported environment."],"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"}