{"record":{"id":"efbef185f8860137","repo":"tinyhumansai/openhuman","slug":"definition-no-longer-exists","errorCode":null,"errorMessage":"definition {} no longer exists","messagePattern":"definition (.+?) no longer exists","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/orchestration/workflow_runs/engine.rs","lineNumber":300,"sourceCode":"/// Resume an interrupted (or otherwise incomplete) workflow run.\n///\n/// Reloads the run, clears any stale cancellation flag, flips the row back to\n/// `Running`, and spawns a fresh engine loop. Phases already `completed` in\n/// `phase_states` are skipped; the loop continues from the first incomplete\n/// phase whose dependencies are satisfied. Returns the run row (now `Running`),\n/// or an error if the run is unknown / already terminal-complete / its\n/// definition no longer exists.\npub async fn resume_workflow_run(config: &Config, id: &str) -> Result<WorkflowRun> {\n    log::debug!(target: LOG_TARGET, \"[workflow_run_engine] resume.entry run={id}\");\n    let run = get_workflow_run(&config.workspace_dir, id)?\n        .ok_or_else(|| anyhow!(\"unknown workflow run: {id}\"))?;\n\n    if matches!(run.status, WorkflowRunStatus::Completed) {\n        return Err(anyhow!(\"workflow run {id} is already completed\"));\n    }\n\n    let definition = definition_by_id(&run.definition_id)\n        .ok_or_else(|| anyhow!(\"definition {} no longer exists\", run.definition_id))?;\n\n    // Clear any prior cancellation intent and re-register a fresh flag.\n    clear_cancel_flag(id);\n    register_cancel_flag(id);\n\n    let resumed = upsert_workflow_run(\n        &config.workspace_dir,\n        WorkflowRunUpsert {\n            id: run.id.clone(),\n            definition_id: run.definition_id.clone(),\n            parent_thread_id: run.parent_thread_id.clone(),\n            input: run.input.clone(),\n            phase_states: run.phase_states.clone(),\n            child_run_ids: run.child_run_ids.clone(),\n            status: WorkflowRunStatus::Running,\n            summary: run.summary.clone(),\n            started_at: Some(run.started_at),\n            completed_at: None,","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/orchestration/workflow_runs/engine.rs#L282-L318","documentation":"resume_workflow_run reloads the run's definition by id and it no longer resolves — the definition registry changed since the run was created (workflow removed, renamed, or its registration gate changed between versions). An interrupted run cannot be resumed against a definition that no longer describes its phase_states, so it fails rather than executing against a mismatched graph.","triggerScenarios":"Thrown at src/openhuman/agent/orchestration/workflow_runs/engine.rs:300 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restore/re-register the workflow definition this run was created from","Start a fresh run of an available equivalent definition","If the rename was intentional, provide a migration alias for the old definition id"],"exampleFix":null,"handlingStrategy":"validation","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"}