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

Session goal objective must contain 1..={MAX_SESSION_GOAL_OB

Error message

Session goal objective must contain 1..={MAX_SESSION_GOAL_OBJECTIVE_CHARS} characters

What it means

Validation in SessionGoalState::validate: the trimmed objective length fell outside the 1..=MAX_SESSION_GOAL_OBJECTIVE_CHARS (8192) bound. Goal objectives are persisted as bounded files (MAX_SESSION_GOAL_FILE_BYTES 64 KiB) and an empty or oversized objective is invalid data for the goal schema.

Source

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

            pause_reason: snapshot.pause_reason,
        };
        state.validate()?;
        Ok(Some(state))
    }

    pub fn validate(&self) -> io::Result<()> {
        if self.schema_version > CURRENT_SESSION_GOAL_SCHEMA_VERSION {
            return Err(io::Error::new(
                io::ErrorKind::InvalidData,
                format!(
                    "Session goal schema v{} is newer than supported v{}",
                    self.schema_version, CURRENT_SESSION_GOAL_SCHEMA_VERSION
                ),
            ));
        }
        let objective = self.objective.trim();
        if objective.is_empty() || objective.chars().count() > MAX_SESSION_GOAL_OBJECTIVE_CHARS {
            return Err(io::Error::new(
                io::ErrorKind::InvalidData,
                format!(
                    "Session goal objective must contain 1..={MAX_SESSION_GOAL_OBJECTIVE_CHARS} characters"
                ),
            ));
        }
        Ok(())
    }

    #[must_use]
    pub fn to_runtime_snapshot(&self) -> GoalSnapshot {
        GoalSnapshot {
            objective: Some(self.objective.clone()),
            status: match self.status {
                SessionGoalStatus::Active => "active",
                SessionGoalStatus::Paused => "paused",
                SessionGoalStatus::Complete => "complete",
                SessionGoalStatus::Blocked => "blocked",

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Supply an objective with at least 1 and at most MAX_SESSION_GOAL_OBJECTIVE_CHARS characters.
  2. Truncate or summarize overly long objectives before persisting.
Defensive patterns

Strategy: validation

When it happens

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