mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user