Remove the redundant tool dispatch wrapper (#33866)

## What changed

- Remove `ToolRegistry::dispatch_any`, which always forwarded a missing terminal outcome.
- Update registry and dispatch trace tests to call `dispatch_any_with_terminal_outcome` with `None` explicitly.

GitOrigin-RevId: aa3acb2ed480fd452bc25301a351f46e759bbfab
This commit is contained in:
jif authored and copyberry committed 2026-07-17 16:21:04 +00:00
1 parent 7c4aaf28c2
commit 908fe8ccc9
3 files changed
+78 -66

No files matched your search

+18 -12
View File
@@ -399,20 +399,26 @@ async fn dispatch_notifies_tool_lifecycle_contributors() -> anyhow::Result<()> {
let turn = Arc::new(turn);
registry
.dispatch_any(test_invocation(
Arc::clone(&session),
Arc::clone(&turn),
"ok-call",
ok_tool.clone(),
))
.dispatch_any_with_terminal_outcome(
test_invocation(
Arc::clone(&session),
Arc::clone(&turn),
"ok-call",
ok_tool.clone(),
),
/*terminal_outcome_reached*/ None,
)
.await?;
let err = match registry
.dispatch_any(test_invocation(
Arc::clone(&session),
Arc::clone(&turn),
"failing-call",
failing_tool.clone(),
))
.dispatch_any_with_terminal_outcome(
test_invocation(
Arc::clone(&session),
Arc::clone(&turn),
"failing-call",
failing_tool.clone(),
),
/*terminal_outcome_reached*/ None,
)
.await
{
Ok(_) => panic!("failing handler should return an error"),