Skip to content

Conversation

joaopluigi
Copy link
Contributor

Before After
before after

@Copilot Copilot AI review requested due to automatic review settings September 5, 2025 19:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ToolCallRunning type 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")
Copy link
Preview

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

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
Copy link
Preview

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.

@joaopluigi joaopluigi merged commit 8e69b71 into main Sep 5, 2025
3 checks passed
@joaopluigi joaopluigi deleted the tool-call-running branch September 5, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants