Fix TUI tool call visibility during recursive execution#42
Conversation
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
|
@copilot fix checks error |
…calls and run cargo fmt Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Fixed in commit 4d48616. The compilation errors were caused by adding an Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Run cargo clippy -- -D warnings error: could not compile |
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Fixed in commit aceb4f3. Removed the unused Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Fix TUI Tool Call Display Issue ✅
The TUI only shows the first tool call, then goes silent until completion. This is because
execute_streaming_tool_callsrecursively handles tool calls internally without output.Root Cause
execute_streaming_tool_callswith the first batch of tool callshandle_response()recursively executes MORE tool calls (line 1130)Solution Implemented ✅
execute_streaming_tool_callsmethodhandle_response_with_callbackthat propagates callbacks through recursive callschat_stream_with_toolsfor consistencyHow It Works
execute_streaming_tool_calls<F>now accepts a closure called before each tool executionhandle_response_with_callback: Private method that propagates the callback through recursive tool executions[tool_name: detail]for each tool as it startsFiles Changed
crates/core/src/agent/mod.rs: +90 lines (callback parameter, new method, formatting)crates/cli/src/cli/chat.rs: +13 lines (callback implementation, formatting, removed unused import)crates/server/src/http.rs: +1 line (fix chat_stream_with_tools call)crates/server/src/telegram.rs: +1 line (fix chat_stream_with_tools call)crates/cli/src/desktop/worker.rs: +1 line (fix chat_stream_with_tools call)crates/core/src/agent/test/unit/openaiprovider_tool_test.rs: +4 lines (test fix)Testing ✅
Security Summary
No security vulnerabilities introduced. Changes are minimal and surgical:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.