{"record":{"id":"144f850cd0a0fe93","repo":"openai/codex","slug":"at-most-max-open-file-reads-file-reads-may-be-op","errorCode":null,"errorMessage":"at most {MAX_OPEN_FILE_READS} file reads may be open per connection","messagePattern":"at most (.+?) file reads may be open per connection","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/exec-server/src/file_read.rs","lineNumber":37,"sourceCode":"    handles: Arc<Mutex<HashMap<String, Arc<File>>>>,\n}\n\nimpl FileReadHandleManager {\n    pub(crate) async fn open(\n        &self,\n        handle_id: String,\n        file: tokio::fs::File,\n    ) -> io::Result<String> {\n        let file = Arc::new(file.into_std().await);\n        let mut handles = self.handles.lock().await;\n        if handles.contains_key(&handle_id) {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidInput,\n                format!(\"file read handle `{handle_id}` already exists\"),\n            ));\n        }\n        if handles.len() >= MAX_OPEN_FILE_READS {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidInput,\n                format!(\"at most {MAX_OPEN_FILE_READS} file reads may be open per connection\"),\n            ));\n        }\n        handles.insert(handle_id.clone(), file);\n        Ok(handle_id)\n    }\n\n    pub(crate) async fn read_block(\n        &self,\n        handle_id: &str,\n        offset: u64,\n        len: usize,\n    ) -> io::Result<FileReadBlock> {\n        validate_read_block_len(len)?;\n        let file = {\n            let handles = self.handles.lock().await;\n            handles","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/exec-server/src/file_read.rs#L19-L55","documentation":"Error \"at most {MAX_OPEN_FILE_READS} file reads may be open per connection\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/exec-server/src/file_read.rs:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Close open file reads before opening new ones."],"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"}