{"record":{"id":"012849028ea0be3e","repo":"openai/codex","slug":"pet-frame-count-frame-count-exceeds-maximum-max","errorCode":null,"errorMessage":"pet frame count {frame_count} exceeds maximum {MAX_PET_FRAMES}","messagePattern":"pet frame count (.+?) exceeds maximum (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/tui/src/pets/model.rs","lineNumber":356,"sourceCode":"        .checked_mul(frame.columns)\n        .context(\"pet frame grid width overflow\")?;\n    let total_height = frame\n        .height\n        .checked_mul(frame.rows)\n        .context(\"pet frame grid height overflow\")?;\n    if total_width != spritesheet_width || total_height != spritesheet_height {\n        bail!(\n            \"pet frame grid must cover spritesheet exactly: expected {spritesheet_width}x{spritesheet_height}, got {total_width}x{total_height}\"\n        );\n    }\n\n    let frame_count = frame\n        .columns\n        .checked_mul(frame.rows)\n        .context(\"pet frame count overflow\")?;\n    let frame_count = usize::try_from(frame_count).context(\"pet frame count does not fit usize\")?;\n    if frame_count > MAX_PET_FRAMES {\n        bail!(\"pet frame count {frame_count} exceeds maximum {MAX_PET_FRAMES}\");\n    }\n    Ok(frame_count)\n}\n\nfn custom_pet_cache_id(id: &str) -> String {\n    format!(\"custom-{id}\")\n}\n\nfn path_like(value: &str) -> bool {\n    value == \".\"\n        || value == \"..\"\n        || value.starts_with(\"~/\")\n        || value.starts_with(\"../\")\n        || value.starts_with(\"./\")\n        || Path::new(value).is_absolute()\n        || value.contains('/')\n        || value.contains('\\\\')\n}","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/tui/src/pets/model.rs#L338-L374","documentation":"Resource guard in validate_frame_spec: columns*rows for a frame spec exceeds MAX_PET_FRAMES, i.e. the spritesheet grid would yield more frames than the pet animation system allows. The manifest is rejected to keep frame buffers and animation indices bounded.","triggerScenarios":"Thrown at codex-rs/tui/src/pets/model.rs:356 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce columns/rows (or frame count) in the pet manifest to stay within MAX_PET_FRAMES","Split the pet into multiple smaller spritesheets if more frames are genuinely needed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}