{"record":{"id":"6ae103a92c0160d1","repo":"tinyhumansai/openhuman","slug":"workflow-fan-out-expected-expected-outcomes-res","errorCode":null,"errorMessage":"workflow fan-out: expected {expected_outcomes} result(s), got {}","messagePattern":"workflow fan-out: expected (.+?) result\\(s\\), got (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/orchestration/workflow_runs/engine.rs","lineNumber":728,"sourceCode":"                return Ok(PhaseExecOutcome::Terminated);\n            }\n            Err(err) => return Err(anyhow!(\"workflow fan-out failed: {err}\")),\n        };\n\n        let mut outcomes = Vec::with_capacity(expected_outcomes);\n        for item in outcome.outcomes {\n            match item.result {\n                Ok(value) => outcomes.push(value),\n                Err(err) => {\n                    return Err(anyhow!(\n                        \"workflow fan-out: worker {} failed: {err}\",\n                        item.index\n                    ));\n                }\n            }\n        }\n        if outcomes.len() != expected_outcomes {\n            return Err(anyhow!(\n                \"workflow fan-out: expected {expected_outcomes} result(s), got {}\",\n                outcomes.len()\n            ));\n        }\n\n        // Aggregate worker outcomes in phase order: record every spawned\n        // child id, collect completed outputs, and surface the first failure.\n        for outcome in outcomes {\n            if let Some(oid) = outcome.orchestration_id {\n                spawned_this_phase += 1;\n                child_run_ids.push(oid);\n            }\n            match outcome.output {\n                Some(out) => phase_outputs.push(out),\n                None => {\n                    if phase_failed.is_none() {\n                        phase_failed = outcome.error;\n                    }","sourceCodeStart":710,"sourceCodeEnd":746,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/orchestration/workflow_runs/engine.rs#L710-L746","documentation":"After fan-out, the number of result outcomes did not match the expected worker count for the phase. An invariant violation of the orchestration session's fan-out contract (lost or extra outcomes) — defensive guard so a miscounted result set is never silently iterated with missing/extra worker outputs. Indicates a harness bug or API drift rather than a user input fault.","triggerScenarios":"Thrown at src/openhuman/agent/orchestration/workflow_runs/engine.rs:728 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Capture the expected vs got counts alongside the session's fan-out response for a bug report","Check for tinyagents version drift where wait/fan-out semantics changed","Retry the run; if deterministic, the session's outcome aggregation is broken and needs upstream investigation"],"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"}