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

goal snapshot has no objective

Error message

goal snapshot has no objective

What it means

Contract guard in SessionGoalState::from_runtime: the runtime goal snapshot neither qualifies as the canonical empty snapshot (no objective and status "none") nor carries a non-empty objective, so it cannot be converted into a durable session-goal record.

Source

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

const fn current_session_goal_schema_version() -> u32 {
    CURRENT_SESSION_GOAL_SCHEMA_VERSION
}

impl SessionGoalState {
    /// Convert a runtime update into the durable, bounded session contract.
    /// The canonical empty runtime snapshot removes the sidecar.
    pub fn from_runtime(snapshot: &GoalSnapshot) -> io::Result<Option<Self>> {
        if snapshot.objective.is_none() && snapshot.status.trim() == "none" {
            return Ok(None);
        }
        let objective = snapshot
            .objective
            .as_deref()
            .map(str::trim)
            .filter(|objective| !objective.is_empty())
            .ok_or_else(|| {
                io::Error::new(io::ErrorKind::InvalidData, "goal snapshot has no objective")
            })?;
        let status = match snapshot.status.trim() {
            "active" => SessionGoalStatus::Active,
            "paused" => SessionGoalStatus::Paused,
            "complete" => SessionGoalStatus::Complete,
            "blocked" => SessionGoalStatus::Blocked,
            other => {
                return Err(io::Error::new(
                    io::ErrorKind::InvalidData,
                    format!("goal snapshot has unsupported status '{other}'"),
                ));
            }
        };
        let state = Self {
            schema_version: CURRENT_SESSION_GOAL_SCHEMA_VERSION,
            objective: objective.to_string(),
            status,
            token_budget: snapshot.token_budget,

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Provide a non-empty objective string with the goal snapshot.
  2. If the goal is meant to be cleared, send the canonical empty snapshot: no objective and status "none".
  3. Check the runtime component producing GoalSnapshot for fields left unset.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/session_manager.rs:562 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/e600f0e3f10a0f67. Report an issue: GitHub.