{"record":{"id":"c3ce767784e08f11","repo":"tinyhumansai/openhuman","slug":"agent-replay-read-run-events-page-failed-run-id","errorCode":null,"errorMessage":"[agent] replay read_run_events_page failed run_id={run_id}: {e}","messagePattern":"\\[agent\\] replay read_run_events_page failed run_id=(.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/tinyagents/replay/ops.rs","lineNumber":67,"sourceCode":"pub(crate) async fn read_run_events_page(\n    workspace: &Path,\n    run_id: &str,\n    offset: u64,\n    limit: u64,\n) -> anyhow::Result<RunEventsPage> {\n    // Guard the page size: clamp a zero/absurd limit into [1, MAX].\n    let effective_limit = limit.clamp(1, MAX_EVENTS_LIMIT);\n    log::debug!(\n        \"[agent] replay read_run_events_page run_id={run_id} offset={offset} \\\n         limit={limit} effective_limit={effective_limit}\"\n    );\n\n    let stores = open_session_stores(workspace);\n    let journal = StoreEventJournal::new(stores.journal);\n    // Read one extra record to detect whether a further page exists without a\n    // second store round-trip.\n    let mut events = journal.read_from(run_id, offset).await.map_err(|e| {\n        anyhow::anyhow!(\"[agent] replay read_run_events_page failed run_id={run_id}: {e}\")\n    })?;\n\n    let has_more = events.len() as u64 > effective_limit;\n    if has_more {\n        events.truncate(effective_limit as usize);\n    }\n    // Offsets are monotonic within a run, so the cursor is simply \"one past the\n    // last returned offset\". `None` when this page drained the stream.\n    let next_offset = if has_more {\n        events.last().map(|obs| obs.offset + 1)\n    } else {\n        None\n    };\n\n    log::debug!(\n        \"[agent] replay read_run_events_page run_id={run_id} returned={} next_offset={:?}\",\n        events.len(),\n        next_offset","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/tinyagents/replay/ops.rs#L49-L85","documentation":"Reading one page of run events from the replay journal failed — opening the session stores or reading the journal store errored for that run_id. Logged (warn) with the run_id and error, it degrades the replay/inspection surface rather than the live run. Causes: journal file missing/corrupt for that run, IO error, or a run id with no persisted events directory.","triggerScenarios":"Thrown at src/openhuman/agent/tinyagents/replay/ops.rs:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the run's journal files exist under the workspace session stores for that run_id","If the journal is corrupt, replay is not recoverable for that run — re-run the agent task if the transcript matters","Check for workspace_dir mismatches if the run belongs to another workspace"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}