openai/codex · error · anyhow::Error
animation {name} references sprite index {}, but pet has {fr
Error message
animation {name} references sprite index {}, but pet has {frame_count} frames What it means
Error "animation {name} references sprite index {}, but pet has {frame_count} frames" thrown in openai/codex.
Source
Thrown at codex-rs/tui/src/pets/model.rs:464
animations
.entry("idle".to_string())
.or_insert_with(idle_animation);
validate_animation_indices(&animations, frame_count)?;
Ok(animations)
}
fn validate_animation_indices(
animations: &HashMap<String, Animation>,
frame_count: usize,
) -> Result<()> {
for (name, animation) in animations {
if animation.frames.is_empty() {
bail!("animation {name} must include at least one frame");
}
for frame in &animation.frames {
if frame.sprite_index >= frame_count {
bail!(
"animation {name} references sprite index {}, but pet has {frame_count} frames",
frame.sprite_index
);
}
}
if !animations.contains_key(&animation.fallback) {
bail!(
"animation {name} fallback {} does not exist",
animation.fallback
);
}
}
Ok(())
}
fn default_frame_count() -> usize {
(catalog::DEFAULT_FRAME_COLUMNS * catalog::DEFAULT_FRAME_ROWS) as usize
}View on GitHub (pinned to 339751715c)
When it happens
Trigger: Thrown at codex-rs/tui/src/pets/model.rs:464 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/8b91e7fa2d41b98b.
Report an issue: GitHub.