{"record":{"id":"b1180d0e49aaabc9","repo":"openai/codex","slug":"file-is-too-large-to-read-limit-is-max-read-file","errorCode":null,"errorMessage":"file is too large to read: limit is {MAX_READ_FILE_BYTES} bytes","messagePattern":"file is too large to read: limit is (.+?) bytes","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/exec-server/src/local_file_system.rs","lineNumber":48,"sourceCode":"use crate::FileSystemSandboxContext;\nuse crate::GetMetadataOptions;\nuse crate::ReadDirectoryEntry;\nuse crate::ReadFileOptions;\nuse crate::RemoveOptions;\nuse crate::WalkEntry;\nuse crate::WalkEntryKind;\nuse crate::WalkError;\nuse crate::WalkOptions;\nuse crate::WalkOutcome;\nuse crate::WriteFileOptions;\nuse crate::no_follow;\nuse crate::regular_file;\nuse crate::sandboxed_file_system::SandboxedFileSystem;\n\nconst MAX_READ_FILE_BYTES: u64 = 512 * 1024 * 1024;\n\nfn file_too_large_error() -> io::Error {\n    io::Error::new(\n        io::ErrorKind::InvalidInput,\n        format!(\"file is too large to read: limit is {MAX_READ_FILE_BYTES} bytes\"),\n    )\n}\n\npub static LOCAL_FS: LazyLock<Arc<dyn ExecutorFileSystem>> =\n    LazyLock::new(|| -> Arc<dyn ExecutorFileSystem> { Arc::new(LocalFileSystem::unsandboxed()) });\n\n#[derive(Clone, Default)]\npub(crate) struct DirectFileSystem;\n\n#[derive(Clone, Default)]\npub(crate) struct UnsandboxedFileSystem {\n    file_system: DirectFileSystem,\n}\n\n#[derive(Clone, Default)]\npub struct LocalFileSystem {","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/exec-server/src/local_file_system.rs#L30-L66","documentation":"Error \"file is too large to read: limit is {MAX_READ_FILE_BYTES} bytes\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/exec-server/src/local_file_system.rs:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the file in ranged chunks below 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"}