tinyhumansai/openhuman · error

workflow run vanished mid-loop

Error message

workflow run {run_id} vanished mid-loop

What it means

The engine loop's dispatch step re-read the run row mid-loop and it no longer exists in the ledger. The run was executing moments ago, so this indicates external interference — concurrent deletion, workspace switched, or a ledger fault — not a normal lifecycle transition. The guard prevents the loop from operating on a phantom run.

Solutions

  1. Check whether the run was concurrently stopped/deleted from another session or the UI
  2. Verify the ledger store's health (SQLite errors on read)
  3. Restart the run from its definition if it was deleted unintentionally
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/agent/orchestration/workflow_runs/engine.rs:428 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/f653258421fbb21d. Report an issue: GitHub.

Appendix: source

Thrown at src/openhuman/agent/orchestration/workflow_runs/engine.rs:428

    Continue { spawned: u32 },
    /// The run reached a terminal status (already persisted) — route to `done`.
    Terminated,
}

/// `dispatch` step: reload the run, honour cancellation, and pick the next
/// runnable phase (pending, all deps `completed`). When none remains, persist the
/// terminal status (Completed / Failed) and return [`PhaseSelection::Terminated`].
pub(super) async fn select_next_phase(
    config: &Config,
    run_id: &str,
    definition: &WorkflowDefinition,
    cancel: &Arc<AtomicBool>,
    session: &crate::openhuman::agent::orchestration::AgentOrchestrationSession,
) -> Result<PhaseSelection> {
    // Reload so we read the latest phase_states (and a resume picks up persisted
    // progress).
    let run = get_workflow_run(&config.workspace_dir, run_id)?
        .ok_or_else(|| anyhow!("workflow run {run_id} vanished mid-loop"))?;
    let phase_states = run.phase_states.clone();
    let child_run_ids = run.child_run_ids.clone();

    // Cancellation check between phases.
    if cancel.load(Ordering::SeqCst) {
        log::debug!(
            target: LOG_TARGET,
            "[workflow_run_engine] loop.cancelled run={run_id}"
        );
        session.abort_all().await;
        persist(
            config,
            &run,
            phase_states,
            child_run_ids,
            WorkflowRunStatus::Interrupted,
            None,
            false,

View on GitHub (pinned to 7491200858)