Propagate tool errors to code mode (#15075)

Clean up error flow to push the FunctionCallError all the way up to
dispatcher and allow code mode to surface as exception.
This commit is contained in:
pakrym-oai
2026-03-18 13:57:55 -07:00
committed by GitHub
parent 392347d436
commit 88e5382fc4
10 changed files with 153 additions and 138 deletions
+3 -2
View File
@@ -4557,7 +4557,7 @@ async fn fatal_tool_error_stops_turn_and_reports_error() {
.expect("tool call present");
let tracker = Arc::new(tokio::sync::Mutex::new(TurnDiffTracker::new()));
let err = router
.dispatch_tool_call(
.dispatch_tool_call_with_code_mode_result(
Arc::clone(&session),
Arc::clone(&turn_context),
tracker,
@@ -4565,7 +4565,8 @@ async fn fatal_tool_error_stops_turn_and_reports_error() {
ToolCallSource::Direct,
)
.await
.expect_err("expected fatal error");
.err()
.expect("expected fatal error");
match err {
FunctionCallError::Fatal(message) => {