fix: ensure completion tool output is recorded and all tool results are captured #874
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
This fix addresses a critical bug where the completion tool output was not being properly recorded, and tool call results were being conditionally skipped. The changes ensure all tool call results are captured for proper system functionality, particularly for the compaction process that relies on complete tool call history.
Bug Description
The system was missing completion tool outputs and conditionally skipping tool call result recording when tasks were marked as complete. This caused incomplete tool call history and potentially broken compaction functionality.
Key Fixes
get_all_tool_results
→execute_tool_calls
to better reflect the actual behaviorTechnical Impact
Root Cause
The conditional logic
if !tool_context.get_complete().await
was incorrectly preventing completed tool calls from being recorded, and the completion tool was not returning any output message.Testing