Hmbown/CodeWhale · error

goal snapshot has unsupported status

Error message

goal snapshot has unsupported status '{other}'

What it means

Session export's goal snapshot conversion: the runtime goal status string is none of the recognized values, so it cannot be mapped to a SessionGoalStatus; export refuses to write a goal block it cannot interpret rather than guessing.

Solutions

  1. Change the status field to one of: "active", "paused", "complete", "blocked".
  2. Delete the goal file and recreate the goal via the TUI.
  3. If migrating from an older format, map legacy status names to the current enum before load.

Example fix

// before
{"objective": "Ship it", "status": "in-progress"}
// after
{"objective": "Ship it", "status": "active"}
Defensive patterns

Strategy: validation

Validate before calling

fn status_is_supported(s: &str) -> bool {
    matches!(s.trim(), "active" | "paused" | "complete" | "blocked")
}

Try / catch

match load_goal(path) {
    Err(e) if e.to_string().contains("unsupported status") => {
        eprintln!("fix the status field to active|paused|complete|blocked: {e}");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Loading a goal snapshot whose status field contains a value outside the four allowed enum strings, e.g. "in-progress", "ACTIVE", or a localized label.

Common situations: Hand-edited goal files with a typo or non-canonical casing; old versions of the tool that used different status names; scripts writing goal JSON with custom statuses.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/e869e576e58e695f. Report an issue: GitHub.

Appendix: source

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

    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,
            tokens_used: snapshot.tokens_used,
            time_used_seconds: snapshot.time_used_seconds,
            continuation_count: snapshot.continuation_count,
            elapsed_seconds: snapshot.elapsed_seconds.unwrap_or_default(),
            pause_reason: snapshot.pause_reason,
            goal_id: snapshot.goal_id.clone(),
            last_gap_fingerprint: snapshot.last_gap_fingerprint.clone(),
            repeated_gap_count: snapshot.repeated_gap_count,

View on GitHub (pinned to 73e0f67d83)