{"record":{"id":"a89b03bb6729f73e","repo":"Hmbown/CodeWhale","slug":"item-schema-v-is-newer-than-supported-v","errorCode":null,"errorMessage":"Item schema v{} is newer than supported v{}","messagePattern":"Item schema v(.+?) is newer than supported v(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":2336,"sourceCode":"        let path = self.item_path(item_id)?;\n        let raw = read_store_file(&path).with_context(|| {\n            RuntimeStoreRecordFailure::new(\n                RuntimeStoreOperation::Read,\n                RuntimeStoreRecordKind::Item,\n                item_id,\n                &path,\n            )\n        })?;\n        let record: TurnItemRecord = serde_json::from_str(&raw).with_context(|| {\n            RuntimeStoreRecordFailure::new(\n                RuntimeStoreOperation::Parse,\n                RuntimeStoreRecordKind::Item,\n                item_id,\n                &path,\n            )\n        })?;\n        if record.schema_version > MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION {\n            bail!(\n                \"Item schema v{} is newer than supported v{}\",\n                record.schema_version,\n                MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION\n            );\n        }\n        if matches!(\n            record.schema_version,\n            IMAGE_RUNTIME_SCHEMA_VERSION | OUTPUT_LIMIT_RUNTIME_SCHEMA_VERSION\n        ) && record.kind == TurnItemKind::UserMessage\n        {\n            record.user_content()?;\n        }\n        Ok(record)\n    }\n\n    pub fn list_threads(&self) -> Result<Vec<ThreadRecord>> {\n        let mut out = Vec::new();\n        let threads_dir = checked_existing_runtime_store_dir(&self.threads_dir)?;","sourceCodeStart":2318,"sourceCodeEnd":2354,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/runtime_threads.rs#L2318-L2354","documentation":"Same forward-compatibility guard as for threads, applied to a single ItemRecord fetched by id: if the stored item's schema_version exceeds the running binary's MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION, the item cannot be safely deserialized into known fields and the load fails. Only this item's lookup is refused; other items may still load.","triggerScenarios":"Calling the store's get-item path (RuntimeStoreRecordKind::Item lookup by item_id) where the JSON on disk has schema_version > MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION.","commonSituations":"A newer app version wrote the item; downgrade or mixed-version installs sharing one data directory; opening a session exported from a newer release.","solutions":["Upgrade the application to a build that supports the stored schema version.","Skip or archive the incompatible item; load the thread with a binary matching the writer version.","Use one data directory per app version to avoid mixed-version reads.","If the item is expendable, remove its store file so the thread can load."],"exampleFix":"// before\nlet item = store.get_item(item_id)?; // fails on newer schema\n\n// after: guard by checking version in the raw record first\nlet raw = read_store_file(&path)?;\nlet v: u32 = serde_json::from_slice::<serde_json::Value>(&raw)?[\"schema_version\"]\n    .take().as_u64().unwrap_or(0) as u32;\nif v > MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION { skip_item(item_id); }","handlingStrategy":"validation","validationCode":"let raw = std::fs::read_to_string(&item_path)?;\nlet v: serde_json::Value = serde_json::from_str(&raw)?;\nif v[\"schema_version\"].as_u64().unwrap_or(0) as u32 > MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION {\n    eprintln!(\"item written by a newer build; upgrade before reading\");\n}","typeGuard":"fn item_supported(item: &ItemRecord) -> bool {\n    item.schema_version <= MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION\n}","tryCatchPattern":"match store.get_item(item_id) {\n    Ok(i) => Some(i),\n    Err(e) if e.to_string().contains(\"newer than supported\") => { warn!(\"item skipped: newer schema\"); None }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Sync app versions across machines that share session data.","Check release notes for schema bumps before downgrading.","Archive incompatible items instead of mixing them into active threads."],"tags":["schema","compatibility","versioning"],"backgroundTag":"schema-version-mismatch","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"}