{"record":{"id":"8d54ed0b421ed1b2","repo":"Hmbown/CodeWhale","slug":"thread-schema-v-is-newer-than-supported-v","errorCode":null,"errorMessage":"Thread schema v{} is newer than supported v{}","messagePattern":"Thread schema v(.+?) is newer than supported v(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":2286,"sourceCode":"        let path = self.thread_path(thread_id)?;\n        let raw = read_store_file(&path).with_context(|| {\n            RuntimeStoreRecordFailure::new(\n                RuntimeStoreOperation::Read,\n                RuntimeStoreRecordKind::Thread,\n                thread_id,\n                &path,\n            )\n        })?;\n        let record: ThreadRecord = serde_json::from_str(&raw).with_context(|| {\n            RuntimeStoreRecordFailure::new(\n                RuntimeStoreOperation::Parse,\n                RuntimeStoreRecordKind::Thread,\n                thread_id,\n                &path,\n            )\n        })?;\n        if record.schema_version > MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION {\n            bail!(\n                \"Thread schema v{} is newer than supported v{}\",\n                record.schema_version,\n                MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION\n            );\n        }\n        Ok(record)\n    }\n\n    pub fn load_turn(&self, turn_id: &str) -> Result<TurnRecord> {\n        let path = self.turn_path(turn_id)?;\n        let raw = read_store_file(&path).with_context(|| {\n            RuntimeStoreRecordFailure::new(\n                RuntimeStoreOperation::Read,\n                RuntimeStoreRecordKind::Turn,\n                turn_id,\n                &path,\n            )\n        })?;","sourceCodeStart":2268,"sourceCodeEnd":2304,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/runtime_threads.rs#L2268-L2304","documentation":"The runtime thread store reads each ThreadRecord from disk and checks its schema_version against MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION before use. A thread persisted by a newer Codewhale build carries a version this binary cannot interpret, so the record is rejected instead of being read incorrectly. This is forward-compatibility protection, not data corruption.","triggerScenarios":"Loading a thread from the runtime store after the store was written by a newer release whose RuntimeStoreRecordKind::Thread schema_version exceeds MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION of the running build.","commonSituations":"Downgrading Codewhale after a newer version migrated the store; sharing a session/data directory between two installs of different versions; resuming a session created by a dev/nightly build.","solutions":["Upgrade Codewhale back to the version (or newer) that wrote the thread.","Move the newer session directory aside or use a separate data dir for the old binary.","Check the record's schema_version in the store file to confirm the mismatch, and consult the changelog for the migration.","Do not hand-edit schema_version down; the layout may genuinely differ."],"exampleFix":"// before: old binary reading newer store\n$ codewhale-tui  # v1 with MAX v3, store at v4\n\n// after: upgrade the binary so supported >= stored\n$ cargo build --release -p codewhale-tui  # newer checkout, MAX v4","handlingStrategy":"validation","validationCode":"let v: serde_json::Value = serde_json::from_str(&std::fs::read_to_string(&thread_path)?)?;\nlet sv = v[\"schema_version\"].as_u64().unwrap_or(0) as u32;\nif sv > MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION {\n    eprintln!(\"thread requires a newer build (schema v{sv})\");\n}","typeGuard":"fn is_supported_schema(record: &ThreadRecord) -> bool {\n    record.schema_version <= MAX_SUPPORTED_RUNTIME_SCHEMA_VERSION\n}","tryCatchPattern":"match store.load_thread(id) {\n    Ok(t) => t,\n    Err(e) if e.to_string().contains(\"newer than supported\") => {\n        eprintln!(\"upgrade codewhale to open this thread\"); Default::default()\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep all installs that share a data directory on the same version.","Never downgrade below the version that last wrote the store.","Before downgrading, snapshot or export sessions with the newer build."],"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"}