{"record":{"id":"e2932b225607023d","repo":"Hmbown/CodeWhale","slug":"turn-schema-v-is-newer-than-supported-v","errorCode":null,"errorMessage":"Turn schema v{} is newer than supported v{}","messagePattern":"Turn schema v(.+?) is newer than supported v(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":1045,"sourceCode":"    )]\n    pub model_request_diagnostics: Option<RuntimeTurnRequestDiagnostics>,\n    #[serde(skip_serializing_if = \"Option::is_none\")]\n    pub error: Option<String>,\n    #[serde(default)]\n    pub item_ids: Vec<String>,\n    #[serde(default)]\n    pub steer_count: usize,\n    /// Stable Agent Mail id that caused this turn. This is the durable\n    /// idempotency bridge between a claimed mail envelope and the existing\n    /// turn queue; ordinary external-user turns leave it unset.\n    #[serde(default, skip_serializing_if = \"Option::is_none\")]\n    pub agent_mail_message_id: Option<String>,\n}\n\nimpl TurnRecord {\n    fn validate_output_token_limit(&self) -> Result<()> {\n        if self.schema_version > MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION {\n            bail!(\n                \"Turn schema v{} is newer than supported v{}\",\n                self.schema_version,\n                MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION\n            );\n        }\n        if self.max_output_tokens.is_some()\n            != (self.schema_version == OUTPUT_LIMIT_RUNTIME_SCHEMA_VERSION)\n        {\n            bail!(\"Turn output allowance does not match its schema\");\n        }\n        Ok(())\n    }\n\n    pub(crate) fn effective_provider_label(&self) -> Option<&str> {\n        self.effective_provider_id\n            .as_deref()\n            .filter(|identity| !identity.trim().is_empty())\n            .or_else(|| {","sourceCodeStart":1027,"sourceCodeEnd":1063,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/runtime_threads.rs#L1027-L1063","documentation":"`TurnRecord::validate_output_token_limit` refuses to load a turn record whose `schema_version` exceeds `MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION`. This is a forward-compatibility guard: a newer binary must not silently misinterpret fields written by a newer schema.","triggerScenarios":"Loading a turn file written by a newer Codewhale build (higher schema version) with an older binary; downgrading the app and opening existing thread data.","commonSituations":"Rolling back a release; sharing thread data between machines running different versions; a preview build wrote records a stable build cannot read.","solutions":["Upgrade the application to a build supporting the record's schema version.","Move the newer turn records out of the data directory if staying on the old build.","Discard or archive the too-new turn record if its data is not needed."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const MAX_SCHEMA: u32 = MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION;\nif record.schema_version > MAX_SCHEMA { return Err(format!(\"schema v{} too new (max v{})\", record.schema_version, MAX_SCHEMA)); }","typeGuard":null,"tryCatchPattern":"match store.load_turn(&turn_id) { Err(e) if e.contains(\"newer than supported\") => { archive_record(&turn_id); warn_and_skip() }, Err(e) => Err(e.into()), Ok(t) => Ok(t) }","preventionTips":["Upgrade before opening thread data written by newer builds","Check schema version in record headers before full parse","Keep data backups when downgrading the application"],"tags":["versioning","schema","compatibility"],"backgroundTag":"schema-validation-failed","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}