openai/codex · error · anyhow::Error

animation fallback does not exist

Error message

animation {name} fallback {} does not exist

What it means

Reference-integrity guard in validate_animation_indices: an animation names a fallback animation that is not present in the animation map, so playback could not transition when the primary animation completes or is interrupted.

Solutions

  1. Point the animation's fallback at an existing animation name (typically "idle")
  2. Add the missing animation with the referenced name
  3. Remove the fallback reference if none is needed
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

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
}

fn default_animations() -> HashMap<String, Animation> {
    [
        ("idle", idle_animation()),
        (
            "running-right",
            app_state_animation(

View on GitHub (pinned to 339751715c)