{"record":{"id":"6114db42d02adf9a","repo":"Hmbown/CodeWhale","slug":"saved-runtime-store-path-must-be-absolute","errorCode":null,"errorMessage":"Saved Runtime store path must be absolute","messagePattern":"Saved Runtime store path must be absolute","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":3247,"sourceCode":"            return Ok(false);\n        }\n        if !self.data_dir.is_dir() {\n            return Ok(false);\n        }\n        if self.has_live_holder()? {\n            return Ok(false);\n        }\n        if !self.has_no_durable_work()? {\n            return Ok(false);\n        }\n        if self.has_scope_pinned_automation()? {\n            return Ok(false);\n        }\n        Ok(true)\n    }\n\n    pub(crate) fn validate_existing_store(&self) -> Result<()> {\n        anyhow::ensure!(\n            self.data_dir.is_absolute(),\n            \"Saved Runtime store path must be absolute\"\n        );\n        let root = checked_existing_runtime_store_dir(&self.data_dir)?;\n        let owner: RuntimeStoreOwner =\n            serde_json::from_str(&read_store_file(&root.join(AGENT_MAIL_OWNER_FILE))?)?;\n        validated_record_id(&owner.owner_id, \"Runtime owner id\")?;\n        anyhow::ensure!(\n            runtime_execution_scope(&owner.owner_id, &root.join(EVENT_TRANSACTION_LOCK_FILE))\n                == self.execution_scope,\n            \"Saved session Runtime store ownership does not match; refusing to recover another scope\"\n        );\n        Ok(())\n    }\n}\n\nfn runtime_execution_scope(owner_id: &str, event_lock_path: &Path) -> String {\n    let mut digest = Sha256::new();","sourceCodeStart":3229,"sourceCodeEnd":3265,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/runtime_threads.rs#L3229-L3265","documentation":"validate_existing_store ensures the saved runtime store's data_dir is an absolute path before opening it. It throws 'Saved Runtime store path must be absolute' when the persisted store binding contains a relative path, because the store owner/scope checks require a stable, resolvable filesystem location.","triggerScenarios":"Resuming a session whose saved RuntimeStoreBinding / data_dir was persisted as a relative path (e.g. saved from a different working directory, or hand-edited state file), then calling validate_existing_store().","commonSituations":"Session state file written by an older version that stored relative paths; user moved/edited the session store file; running the binary from a different cwd with a relative --runtime-dir style value persisted.","solutions":["Fix the saved store path to an absolute path (canonicalize with realpath on the directory).","If the store was genuinely relocated, update the session binding to the new absolute location.","Delete the stale session binding and start a fresh session with an absolute data_dir.","Upgrade to a version that stores absolute paths, then regenerate the session state."],"exampleFix":"// before: relative path persisted\n\"data_dir\": \"runtime-store\"\n// after: absolute path persisted\n\"data_dir\": \"/home/user/.cache/app/runtime-store\"","handlingStrategy":"validation","validationCode":"fn ensure_absolute_store_path(data_dir: &Path) -> Result<()> {\n    anyhow::ensure!(data_dir.is_absolute(), \"store path must be absolute: {}\", data_dir.display());\n    Ok(())\n}\n","typeGuard":"fn is_absolute_dir(p: &Path) -> bool { p.is_absolute() }\n","tryCatchPattern":"match store.validate_existing_store() {\n    Ok(()) => (),\n    Err(e) if e.to_string().contains(\"must be absolute\") => {\n        let fixed = std::fs::canonicalize(&relative_dir)?;\n        reopen_with_data_dir(fixed)?;\n    }\n    Err(e) => return Err(e),\n}\n","preventionTips":["Always canonicalize (std::fs::canonicalize) data_dir before persisting a store binding.","Never hand-edit session state files that contain paths.","Pin versions so the store format writer is consistent.","Resume sessions from the same working setup they were created in."],"tags":["configuration","path","validation","session"],"backgroundTag":"invalid-config-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}