Skip to content

fix(acp): resolve Gemini shell command tool display showing "Ran Tool"#387

Merged
CSRessel merged 2 commits intomainfrom
fix-gemini-acp-tool-parsing
Mar 20, 2026
Merged

fix(acp): resolve Gemini shell command tool display showing "Ran Tool"#387
CSRessel merged 2 commits intomainfrom
fix-gemini-acp-tool-parsing

Conversation

@CSRessel
Copy link
Copy Markdown
Collaborator

@CSRessel CSRessel commented Mar 20, 2026

Summary

Generated with Nori

  • Fix Gemini shell commands showing "Ran Tool" instead of actual command names (e.g., "Ran echo hello") by capturing tool call metadata from permission requests and seeding the shared pending_tool_calls map
  • Add extract_command_from_permission_title() to strip Gemini compound title format (command [cwd path] (description)) to just the command
  • Add ToolCallMetadata struct on ApprovalRequest to bridge permission request path and event translation path

Test Plan

  • 4 unit tests for extract_command_from_permission_title (full format, no description, no cwd, brackets in command)
  • 2 integration tests for metadata resolution (title on completion, execute classification)
  • All 16 existing ACP tests pass
  • Manual test with Gemini agent: shell commands should display actual command names

Share Nori with your team: https://www.npmjs.com/package/nori-skillsets

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.
@CSRessel CSRessel force-pushed the fix-gemini-acp-tool-parsing branch from e38a5dc to 70adc2d Compare March 20, 2026 21:30
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)).
@CSRessel CSRessel merged commit fe87885 into main Mar 20, 2026
3 checks passed
@CSRessel CSRessel deleted the fix-gemini-acp-tool-parsing branch March 20, 2026 22:13
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.

1 participant