Hmbown/CodeWhale · error · std::io::Error

Session schema v{} is newer than supported v{}

Error message

Session schema v{} is newer than supported v{}

What it means

A saved session snapshot's schema_version exceeds the highest version this binary supports. The loader refuses to parse unknown future formats rather than resuming a session with silently misread state; firing means the snapshot came from a newer Codewhale.

Source

Thrown at crates/tui/src/session_manager.rs:1435

        if path.exists() {
            fs::remove_file(path)?;
        }
        Ok(())
    }

    /// Read a session snapshot without repairing tool call/result pairs.
    ///
    /// This is the correct API for embedding hosts that inspect or update a
    /// durable session while an engine may still be executing a tool call.
    /// A dangling `tool_use` is not proof of a crashed process in that state.
    pub fn load_session_snapshot(&self, id: &str) -> std::io::Result<SavedSession> {
        let path = self.validated_session_path(id)?;

        let content = fs::read_to_string(&path)?;
        let mut session: SavedSession = serde_json::from_str(&content)
            .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e))?;
        if session.schema_version > CURRENT_SESSION_SCHEMA_VERSION {
            return Err(std::io::Error::new(
                std::io::ErrorKind::InvalidData,
                format!(
                    "Session schema v{} is newer than supported v{}",
                    session.schema_version, CURRENT_SESSION_SCHEMA_VERSION
                ),
            ));
        }

        session.system_prompt = strip_legacy_truncation_note(session.system_prompt);
        session.ensure_journal();
        self.hydrate_approval_receipts(&mut session)?;

        Ok(session)
    }

    /// Load and repair a session after a known process or engine restart.
    ///
    /// The returned repair remains in memory until the caller persists

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Upgrade Codewhale to a version that reads the newer session schema
  2. Use an older snapshot/checkpoint compatible with this build
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/tui/src/session_manager.rs:1435 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/f2d0b48f836d1719. Report an issue: GitHub.