tinyhumansai/openhuman · error · anyhow::Error

[agent] replay read_run_events_page failed run_id=

Error message

[agent] replay read_run_events_page failed run_id={run_id}: {e}

What it means

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.

Solutions

  1. Verify the run's journal files exist under the workspace session stores for that run_id
  2. If the journal is corrupt, replay is not recoverable for that run — re-run the agent task if the transcript matters
  3. Check for workspace_dir mismatches if the run belongs to another workspace
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/openhuman/agent/tinyagents/replay/ops.rs:67 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/c3ce767784e08f11. Report an issue: GitHub.

Appendix: source

Thrown at src/openhuman/agent/tinyagents/replay/ops.rs:67

pub(crate) async fn read_run_events_page(
    workspace: &Path,
    run_id: &str,
    offset: u64,
    limit: u64,
) -> anyhow::Result<RunEventsPage> {
    // Guard the page size: clamp a zero/absurd limit into [1, MAX].
    let effective_limit = limit.clamp(1, MAX_EVENTS_LIMIT);
    log::debug!(
        "[agent] replay read_run_events_page run_id={run_id} offset={offset} \
         limit={limit} effective_limit={effective_limit}"
    );

    let stores = open_session_stores(workspace);
    let journal = StoreEventJournal::new(stores.journal);
    // Read one extra record to detect whether a further page exists without a
    // second store round-trip.
    let mut events = journal.read_from(run_id, offset).await.map_err(|e| {
        anyhow::anyhow!("[agent] replay read_run_events_page failed run_id={run_id}: {e}")
    })?;

    let has_more = events.len() as u64 > effective_limit;
    if has_more {
        events.truncate(effective_limit as usize);
    }
    // Offsets are monotonic within a run, so the cursor is simply "one past the
    // last returned offset". `None` when this page drained the stream.
    let next_offset = if has_more {
        events.last().map(|obs| obs.offset + 1)
    } else {
        None
    };

    log::debug!(
        "[agent] replay read_run_events_page run_id={run_id} returned={} next_offset={:?}",
        events.len(),
        next_offset

View on GitHub (pinned to 7491200858)