Skip to content

Conversation

@ewilderj
Copy link

Problem

When ACP sends tool_call updates, agent-shell stores the command (from rawInput.command) but never displays it in the UI. Only the title, status, and output are shown. This means users don't see what command was executed—just the result.

Compare to Copilot CLI which shows:

○ Find files with prime-length filenames
  $ find ~/.emacs.d -type f | while read f; do...
   └ 12 lines...

agent-shell currently shows only the title and output, missing the $ find... line.

Root cause

In agent-shell.el, the command is stored at line 813:

(cons :command (map-nested-elt update '(rawInput command)))

But in the tool_call_update handler (~line 974), only the body text is passed without the command:

:body (string-trim body-text)

The :command is used only for transcript logging (line 955), not UI display.

Fix

Prepend the command to the body when rendering tool_call_update fragments:

:body (concat
       (when-let ((cmd (map-nested-elt state \`(:tool-calls ,.toolCallId :command))))
         (unless (string-empty-p cmd)
           (propertize (format "$ %s\n\n" cmd) 'font-lock-face 'font-lock-comment-face)))
       (string-trim body-text))

Testing

Tested with Copilot CLI via ACP. Tool calls now display the command above the output, styled as a comment.

When ACP sends tool_call updates, the command from rawInput.command is
stored but only used for transcript logging. This change prepends the
command to the body when rendering tool_call_update fragments, so users
can see what command was executed.

Before: Only title, status, and output shown
After:  Shows '$ <command>' above the output (styled as comment)
xenodium added a commit that referenced this pull request Jan 28, 2026
1. Show command in permission dialogs
2. Upgrade section titles when command is known
@xenodium
Copy link
Owner

Thanks for the PR!

When ACP sends tool_call updates, agent-shell stores the command (from rawInput.command) but never displays it in the UI.

Ah interesting. Looks like Copilot isn't including the command in the title (also noticed missing from permission dialog), which I've found in some of the other agents. Couple of examples:

Gemini

Screenshot 2026-01-28 at 07 30 57

Gemini ACP traffic

Screenshot 2026-01-28 at 07 32 56

Claude

Screenshot 2026-01-28 at 07 23 56

Claude ACP traffic

Screenshot 2026-01-28 at 07 18 59

Copilot

Screenshot 2026-01-28 at 07 40 01 Screenshot 2026-01-28 at 08 45 39

Copilot ACP traffic

Screenshot 2026-01-28 at 07 45 00

Copilot fix (please try)

I've submitted a fix for Copilot in ded0a5e so it displays commands in permission dialogs as well as promotes section titles to include command. Could you give that a try and see if that works for you? You'll need to update to v0.31.3.

This is what it should look like

Screenshot 2026-01-28 at 08 47 21 Screenshot 2026-01-28 at 08 46 59

@ewilderj
Copy link
Author

Thanks I'll try tomorrow. BTW I work at GitHub and am currently submitting a PR to enhance the title fields Copilot sends, so there might be clashing behavior :)

@xenodium
Copy link
Owner

am currently submitting a PR to enhance the title fields Copilot sends, so there might be clashing behavior :)

Great! The bit I added attempts to include the command if not already in title, so hopefully no clashing, but please shout if that's not the case.

BTW I work at GitHub

Lovely! Any chance you can get your employer to sponsor this project so I can make the work sustainable? It's taken quite a bit of effort to get agent-shell to where it is today (including dependencies like acp.el and shell-maker). More specifically, I've been adding and improving Copilot support (1, 2, 3, 4, 5).

Lastly, as an indie dev, I have more flexibility/time to bring these tools to felllow emacsers, but sponsorships are an important piece to me to make this kind of work sustainable.

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