{"record":{"id":"6b223968dca8f0dc","repo":"tinyhumansai/openhuman","slug":"agent-replay-read-run-status-failed-run-id-run","errorCode":null,"errorMessage":"[agent] replay read_run_status failed run_id={run_id}: {e}","messagePattern":"\\[agent\\] replay read_run_status failed run_id=(.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/tinyagents/replay/ops.rs","lineNumber":105,"sourceCode":"    Ok(RunEventsPage {\n        events,\n        next_offset,\n    })\n}\n\n/// Latest durable [`HarnessRunStatus`] for `run_id`, or `None` when the run is\n/// unknown. Backed by the C4 status seam\n/// ([`crate::openhuman::agent::tinyagents::journal::read_run_status`] /\n/// [`FileStatusStore::get_status`]).\npub(crate) async fn read_run_status(\n    workspace: &Path,\n    run_id: &str,\n) -> anyhow::Result<Option<HarnessRunStatus>> {\n    log::debug!(\"[agent] replay read_run_status run_id={run_id}\");\n    let stores = open_session_stores(workspace);\n    let store = FileStatusStore::new(stores.kv);\n    let status = store.get_status(run_id).await.map_err(|e| {\n        anyhow::anyhow!(\"[agent] replay read_run_status failed run_id={run_id}: {e}\")\n    })?;\n    log::debug!(\n        \"[agent] replay read_run_status run_id={run_id} found={}\",\n        status.is_some()\n    );\n    Ok(status)\n}\n\n/// Is a run still live (i.e. eligible for the \"active\" listing)?\n///\n/// Mirrors the liveness predicate the crate's status store uses for\n/// `list_active` (Pending / Running / Interrupted).\nfn is_active(status: &HarnessRunStatus) -> bool {\n    matches!(\n        status.status,\n        ExecutionStatus::Pending | ExecutionStatus::Running | ExecutionStatus::Interrupted\n    )\n}","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/openhuman/agent/tinyagents/replay/ops.rs#L87-L123","documentation":"Replay status lookup failed: FileStatusStore::get_status(run_id) on the workspace kv store errored (replay/ops.rs:105). Same storage class as the journal read — the per-workspace key-value store backing durable HarnessRunStatus could not be opened or read. A run that is simply unknown returns Ok(None), not this error; this error means the store itself was unreadable.","triggerScenarios":"Missing/moved workspace directory; kv store file locked by a concurrent writer; corrupted status store after a crash; permission or read-only-mount issues on the workspace.","commonSituations":"Querying run status while the core is actively persisting status updates; moving or copying workspace dirs between machines; containerized runs with mismatched volume permissions.","solutions":["Verify the workspace path and its permissions","Retry once the owning process stops writing (transient sqlite busy)","Check whether the status store file was truncated/corrupted (crash mid-write) and rebuild the workspace session stores if so","Ensure only one core process uses the workspace"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if std::fs::metadata(workspace).is_err() {\n    anyhow::bail!(\"workspace missing at {} — cannot read run status\", workspace.display());\n}","typeGuard":null,"tryCatchPattern":"// Treat as transient-first: retry busy, surface missing-workspace distinctly\nmatch read_run_status(workspace, run_id).await {\n    Ok(s) => s,\n    Err(e) if e.to_string().contains(\"busy\") => retry_after_backoff().await,\n    Err(e) => return Err(anyhow!(\"status store unreadable for {run_id}: {e:#}\")),\n}","preventionTips":["Remember Ok(None) means unknown run; only Err means store trouble — log them differently","Keep status queries off hot loops while a run is persisting status updates","Back up and restore workspaces atomically to avoid truncated kv stores"],"tags":["rust","replay","storage","io","run-status"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}