{"record":{"id":"f3e07418d57d579f","repo":"openai/codex","slug":"file-file-name-is-too-large-size-bytes-byte","errorCode":null,"errorMessage":"file `{file_name}` is too large: {size_bytes} bytes exceeds the limit of {limit_bytes} bytes","messagePattern":"file `(.+?)` is too large: (.+?) bytes exceeds the limit of (.+?) bytes","errorType":"validation","errorClass":"OpenAiFileError","httpStatus":null,"severity":"error","filePath":"codex-rs/codex-api/src/files.rs","lineNumber":44,"sourceCode":"pub struct HostedFileUploadContext {\n    pub connector_id: String,\n    pub action_name: String,\n    pub model: String,\n}\n\n#[derive(Debug, Clone, PartialEq, Eq)]\npub struct UploadedOpenAiFile {\n    pub file_id: String,\n    pub uri: String,\n    pub download_url: String,\n    pub file_name: String,\n    pub file_size_bytes: u64,\n    pub mime_type: Option<String>,\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum OpenAiFileError {\n    #[error(\n        \"file `{file_name}` is too large: {size_bytes} bytes exceeds the limit of {limit_bytes} bytes\"\n    )]\n    FileTooLarge {\n        file_name: String,\n        size_bytes: u64,\n        limit_bytes: u64,\n    },\n    #[error(\"failed to send OpenAI file request to {url}: {source}\")]\n    Request {\n        url: String,\n        #[source]\n        source: RouteAwareRequestError,\n    },\n    #[error(\n        \"OpenAI file blob upload to {host} failed after {elapsed_ms} ms ({error_kind}, azure_client_request_id={azure_client_request_id}): {source}\"\n    )]\n    BlobUploadRequest {\n        host: String,","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/codex-api/src/files.rs#L26-L62","documentation":"Error \"file `{file_name}` is too large: {size_bytes} bytes exceeds the limit of {limit_bytes} bytes\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/codex-api/src/files.rs:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}