fix(acp): resolve Gemini shell command tool display showing "Ran Tool"#387
Merged
fix(acp): resolve Gemini shell command tool display showing "Ran Tool"#387
Conversation
Gemini agents route shell commands through the request_permission ACP path instead of emitting standard ToolCall events with populated fields. When the subsequent ToolCallUpdate(completed) arrives with empty title and kind, the event translator had no metadata to resolve a proper command name, falling back to the generic "Tool" display. This fix captures tool call metadata (title, kind, raw_input) from permission requests via a new ToolCallMetadata struct on ApprovalRequest, and seeds the shared pending_tool_calls map in the approval handler. The event translator can then resolve the actual command name (e.g., "echo hello") from accumulated metadata on completion events. Also adds extract_command_from_permission_title() to strip Gemini compound title format (command [cwd path] (description)) down to just the command portion.
e38a5dc to
70adc2d
Compare
The approval overlay showed "Execute: command" for all Gemini shell commands because format_execute_command and extract_reason_from_tool_call only looked at raw_input (which Gemini leaves empty for Execute calls). Add extract_command_from_title() to fall back to parsing the command from the tool call title, which Gemini populates with the actual command in compound format (command [cwd path] (description)).
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
Generated with Nori
pending_tool_callsmapextract_command_from_permission_title()to strip Gemini compound title format (command [cwd path] (description)) to just the commandToolCallMetadatastruct onApprovalRequestto bridge permission request path and event translation pathTest Plan
extract_command_from_permission_title(full format, no description, no cwd, brackets in command)Share Nori with your team: https://www.npmjs.com/package/nori-skillsets