Add support to ECA "toolCallRunning" protocol message#40
Conversation
joaopluigi
commented
Sep 5, 2025
| Before | After |
|---|---|
![]() |
![]() |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for a new "toolCallRunning" protocol message in the ECA (likely an AI assistant/chat interface). The change enables real-time display of tool calls that are currently executing, providing better user feedback during tool execution.
- Added a new
eca.ToolCallRunningtype definition with optional summary and details fields - Updated the sidebar message handler to process "toolCallRunning" messages and display them immediately
- Refactored tool call display logic to accept content parameter and improved text replacement for better UX
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lua/eca/types.lua | Added eca.ToolCallRunning class definition with type, origin, id, name, arguments, and optional summary/details |
| lua/eca/sidebar.lua | Enhanced message handling to support "toolCallRunning" events and refactored tool call display methods |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| self:_display_tool_call(content) | ||
| elseif content.type == "toolCalled" then | ||
| local tool_text = nil | ||
| local tool_text = (content.summary or "Tool call") |
There was a problem hiding this comment.
This line assumes content.summary exists, but for toolCalled messages, content.summary is optional according to the type definition. This could result in unexpected behavior when content.summary is nil.
| function M:_display_tool_call() | ||
| if not self._current_tool_call then | ||
| function M:_display_tool_call(content) | ||
| if not self._is_tool_call_streaming or not self._current_tool_call then |
There was a problem hiding this comment.
The function now requires a content parameter but doesn't validate that it's not nil before using it on line 1570. This could cause a nil dereference error if called with nil content.
| if not self._is_tool_call_streaming or not self._current_tool_call then | |
| if not self._is_tool_call_streaming or not self._current_tool_call or not content then |

