openai/codex · error · anyhow::Error

animation must include at least one frame

Error message

animation {name} must include at least one frame

What it means

Manifest guard in load_animations: a custom animation entry in the pet manifest declared an empty frames list. Every animation must reference at least one spritesheet frame index; an empty one has no duration or sprite to render, so the manifest load fails.

Solutions

  1. Add at least one valid frame index to the animation's frames array in the pet manifest
  2. Remove the empty animation entry to fall back to default_animations
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/tui/src/pets/model.rs:400 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/05ea7bfa676c1f2c. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/tui/src/pets/model.rs:400

        return Ok(PathBuf::from(home).join(&value[2..]));
    }

    Ok(PathBuf::from(value))
}

fn load_animations(
    specs: HashMap<String, AnimationSpec>,
    frame_count: usize,
) -> Result<HashMap<String, Animation>> {
    let mut animations = default_animations();
    if specs.is_empty() {
        validate_animation_indices(&animations, frame_count)?;
        return Ok(animations);
    }

    for (name, spec) in specs {
        if spec.frames.is_empty() {
            bail!("animation {name} must include at least one frame");
        }
        for sprite_index in &spec.frames {
            if *sprite_index >= frame_count {
                bail!(
                    "animation {name} references sprite index {sprite_index}, but pet has {frame_count} frames"
                );
            }
        }

        let fps = match spec.fps {
            Some(fps) if fps.is_finite() && fps > 0.0 && fps <= MAX_ANIMATION_FPS => fps,
            Some(fps) => {
                bail!(
                    "animation {name} fps must be finite and between 0 and {MAX_ANIMATION_FPS}, got {fps}"
                );
            }
            None => 8.0,
        };

View on GitHub (pinned to 339751715c)