fix(orchestration): include tool definitions in inline task execution#1509
Merged
fix(orchestration): include tool definitions in inline task execution#1509
Conversation
RunInline task execution used provider.chat() without tool definitions, causing the LLM to describe actions instead of actually executing them. Replace provider.chat() with a new run_inline_tool_loop() method that: - builds tool definitions from the current tool executor - runs chat_with_tools() with a fresh isolated message history - implements the tool_use -> execute -> tool_result loop - caps iterations at tool_orchestrator.max_iterations Fixes #1494. Related: #1463, #1467.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SchedulerAction::RunInlineusedprovider.chat()without tool definitions, so the LLM could only produce text responses — no tools were ever executed during inline task executionrun_inline_tool_loop()method onAgent<C>with a fresh isolated message history and a fulltool_use → execute → tool_resultlooptool_orchestrator.max_iterationsTest plan
text_only_response_returns_immediately— no tool round-trips, returns text immediatelysingle_tool_iteration_returns_final_text— one ToolUse round, verifies tool executed and final text returnedmultiple_tool_iterations_before_text— two consecutive ToolUse rounds before Textloop_terminates_at_max_iterations— provider always returns ToolUse, verifies loop captool_error_produces_is_error_result_and_loop_continues— executor failure is surfaced in tool result, loop continuesprovider_error_is_propagated—chat_with_toolserror propagated up asErrcargo +nightly fmt --checkpassescargo clippy --workspace --features full -- -D warningspassescargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins— 4976 passedFixes #1494. Related: #1463, #1467.