fix(flows): an errored Composio tool_call fails the run instead of reporting Completed (B6)#4659
Conversation
…porting Completed (B6) A Composio 200-with-successful:false (e.g. Slack's 400 "Invalid request data" on SLACK_SEND_MESSAGE) sailed through OpenHumanTools::invoke as Ok, so the engine recorded StepStatus::Success and the run reported green "Completed" — even though the tool FAILED. invoke did serde_json::to_value(response?) without ever inspecting response.successful. - reject_unsuccessful_composio_response(slug, resp): passes through successful:true; for successful:false returns Err(EngineError::Capability) naming the slug + provider error. Wired into invoke after client dispatch, before the audit block — so the audit row now records Failure automatically (it already branched on response.is_ok()). Native oh: tool_calls untouched; genuinely-successful responses unaffected. - Engine now assigns StepStatus::Error -> degrade_completed_status (tinyhumansai#4587) degrades the run to failed, so a failed tool no longer shows green "Completed". cargo check/fmt clean; tinyflows:: 95 pass (+3 new); tinyhumansai#4587 degrade tests still green (composes). 1 pre-existing unrelated failure (on_error=route, repro'd on base).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a helper function ChangesComposio error mapping
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant OpenHumanTools
participant Composio
participant reject_unsuccessful_composio_response
participant Engine
OpenHumanTools->>Composio: execute tool_call
Composio-->>OpenHumanTools: ComposioExecuteResponse
OpenHumanTools->>reject_unsuccessful_composio_response: check successful flag
alt successful == false
reject_unsuccessful_composio_response-->>OpenHumanTools: Err(EngineError::Capability)
OpenHumanTools-->>Engine: propagate error
else successful == true
reject_unsuccessful_composio_response-->>OpenHumanTools: unchanged response
OpenHumanTools-->>Engine: return JSON result
end
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
The bug (hit live)
A
tool_callthat fails at the provider — e.g.SLACK_SEND_MESSAGEreturning 400 withsuccessful:false— showed step[success]and the run reported green "Completed."OpenHumanTools::invokedidserde_json::to_value(response?)and never inspectedresponse.successful, so a 200-with-successful:falsesailed through asOk→StepStatus::Success→ nothing fordegrade_completed_statusto degrade.Fix
reject_unsuccessful_composio_response(slug, resp): passessuccessful:truethrough; forsuccessful:falsereturnsErr(EngineError::Capability(...))naming the slug + the provider error. Wired intoinvokeafter client dispatch, before the audit block → the audit row now records Failure automatically.StepStatus::Error→degrade_completed_status(feat(flows): completed_with_warnings run status (run honesty) #4587) degrades the run to failed. No more false green. Nativeoh:tool_calls untouched.Verification
cargo check/fmtclean · tinyflows:: 95 pass (+3 new: provider-failure→Err, empty-error fallback, success pass-through) · #4587 degrade tests still green (composes). 1 pre-existing unrelated failure (on_error=route, repro'd on base).Summary by CodeRabbit