{"record":{"id":"f732775ba590d087","repo":"BigPizzaV3/CodexPlusPlus","slug":"unsupported-native-runtime-component-file","errorCode":null,"errorMessage":"Unsupported native runtime component: {file}","messagePattern":"Unsupported native runtime component: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/native_browser.rs","lineNumber":373,"sourceCode":"            continue;\n        }\n        let data: Value = serde_json::from_slice(&read_regular(&descriptor, 1024 * 1024)?)?;\n        keys.insert(selected_key(&data, &paths.runtime_root)?);\n    }\n    ensure!(\n        keys.len() <= 1,\n        \"Ambiguous runtime selection; no cache was modified\"\n    );\n    Ok(keys.into_iter().next())\n}\n\nfn prepare(paths: &BrowserPaths, key: &str, contract: &RuntimeContract) -> Result<()> {\n    ensure!(key_valid(key), \"Invalid runtime key\");\n    let runtime = paths.runtime_root.join(key);\n    let target = runtime.join(SERVICE);\n    let _runtime_guards = pin_parents(&target)?;\n    for (file, expected) in &contract.files {\n        ensure!(\n            sha(&read_regular(&runtime.join(file), 128 * 1024 * 1024)?) == *expected,\n            \"Unsupported native runtime component: {file}\"\n        );\n    }\n    let mut current = read_regular(&target, MAX_SERVICE)?;\n    let backup_dir = paths.state_root.join(key);\n    plain_path(&backup_dir)?;\n    fs::create_dir_all(&backup_dir)?;\n    let _backup_guards = pin_parents(&backup_dir.join(\"journal.json\"))?;\n    let backup = backup_dir.join(\"original.mjs\");\n    let journal_path = backup_dir.join(\"journal.json\");\n    let control = paths.state_root.join(\"control.json\");\n    if journal_path.exists() {\n        let (journal, original, recorded_candidate) = recovery_material(paths, key, contract)?;\n        let candidate = transform(&original, &control, contract)?;\n        if current == recorded_candidate {\n            if candidate == recorded_candidate {\n                return Ok(());","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/native_browser.rs#L355-L391","documentation":"Before patching, prepare() verifies every file listed in the RuntimeContract by comparing its SHA-256 against the expected hash. If any component's hash differs, the runtime does not match the known-good build Codex++ supports (wrong version, corrupted download, or previously modified file), and patching is refused, naming the offending file.","triggerScenarios":"prepare() (via reconcile_locked) hashes runtime_root/<key>/<file> for each (file, expected) in contract.files and the digest mismatches — e.g. the plugin auto-updated the runtime underneath Codex++, a download was truncated, or an external tool modified a runtime binary.","commonSituations":"Plugin runtime upgrades that outpace the pinned contract; antivirus quarantining/altering files; interrupted downloads leaving corrupt node_modules; manual edits inside the runtime cache.","solutions":["Delete the affected runtime directory under the runtime root and let Codex++/the plugin re-download it so hashes match the contract","Reinstall the plugin at the version matching the current RuntimeContract (or upgrade Codex++ so its contract matches the new runtime)","Verify no antivirus/sync tool is modifying files in the runtime cache and restore from a clean source"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"for (file, expected) in &contract.files {\n    let actual = sha(&read_regular(&runtime.join(file), 128 * 1024 * 1024)?);\n    if actual != *expected { eprintln!(\"runtime file {file} hash mismatch; reinstall needed\"); }\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = prepare(&paths, &key, &contract) {\n    if e.to_string().starts_with(\"Unsupported native runtime component\") {\n        remove_runtime_dir(&runtime)?;      // delete the corrupt/mismatched runtime\n        redownload_runtime(&key)?;          // let the plugin re-fetch it\n        prepare(&paths, &key, &contract)?;\n    }\n}","preventionTips":["Let the plugin finish downloads/upgrades before running reconcile","Exclude runtime cache dirs from antivirus mutation and file sync","After plugin updates, ensure Codex++'s contract version matches the new runtime"],"tags":["integrity","checksum","native-browser","runtime"],"backgroundTag":"checksum-mismatch","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}