openai/codex · error · anyhow::Error

animation {name} references sprite index {sprite_index}, but

Error message

animation {name} references sprite index {sprite_index}, but pet has {frame_count} frames

What it means

Error "animation {name} references sprite index {sprite_index}, but pet has {frame_count} frames" thrown in openai/codex.

Source

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

}

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,
        };
        let duration = Duration::from_secs_f64(1.0 / fps);
        let fallback = if spec.fallback.is_empty() {
            "idle".to_string()
        } else {

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/tui/src/pets/model.rs:404 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/7b20f29d303a6182. Report an issue: GitHub.