tinyhumansai/openhuman · error

workflow run vanished mid-phase

Error message

workflow run {run_id} vanished mid-phase

What it means

execute_phase re-read the run row to refresh phase state and found it missing mid-phase — the run vanished while a phase was executing. Same external-interference class as the mid-loop vanishing guard: concurrent deletion or ledger fault; the phase aborts rather than persisting progress to a nonexistent run.

Solutions

  1. Identify what removed the run row (concurrent stop/delete, ledger reset) and prevent concurrent mutation during execution
  2. Check ledger read logs for SQLite failures
  3. Recreate/restart the run if the deletion was unintended
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

/// cancellation landed mid-phase (the terminal status is persisted first).
#[allow(clippy::too_many_arguments)]
pub(super) async fn execute_phase(
    config: &Config,
    run_id: &str,
    definition: &WorkflowDefinition,
    session: &crate::openhuman::agent::orchestration::AgentOrchestrationSession,
    cancel: &Arc<AtomicBool>,
    model_override: Option<String>,
    phase: &WorkflowPhase,
    total_spawned: u32,
) -> Result<PhaseExecOutcome> {
    use crate::openhuman::agent::orchestration::{
        AgentStatus, SpawnAgentRequest, WaitAgentOptions,
    };

    // Reload so the phase state we mutate + persist is the latest projection.
    let run = get_workflow_run(&config.workspace_dir, run_id)?
        .ok_or_else(|| anyhow!("workflow run {run_id} vanished mid-phase"))?;
    let mut phase_states = run.phase_states.clone();
    let mut child_run_ids = run.child_run_ids.clone();
    // Children launched *this* phase (the reducer delta added to `total_spawned`).
    let mut spawned_this_phase: u32 = 0;

    log::debug!(
        target: LOG_TARGET,
        "[workflow_run_engine] phase.start run={run_id} phase={} agents={} spawned_so_far={}",
        phase.name,
        phase.agent_ids.len(),
        total_spawned
    );
    set_phase_status(&mut phase_states, &phase.name, PHASE_RUNNING, None);
    persist(
        config,
        &run,
        phase_states.clone(),
        child_run_ids.clone(),

View on GitHub (pinned to 7491200858)