Skip to content

fix(acp): include shell command and file path in permission prompts#28921

Open
bcdady wants to merge 6 commits into
anomalyco:devfrom
bcdady:fix/acp-write-text-file-capability
Open

fix(acp): include shell command and file path in permission prompts#28921
bcdady wants to merge 6 commits into
anomalyco:devfrom
bcdady:fix/acp-write-text-file-capability

Conversation

@bcdady
Copy link
Copy Markdown

@bcdady bcdady commented May 22, 2026

Human note

Yes, I had AI help with this PR, as a follow-up to the investigation and development of the fix.
I used opencode with Claude Sonnet via Amazon Bedrock, in the Zed IDE (ACP).

Issue for this PR

Closes #4240

Type of change

  • Bug fix

What does this PR do?

Improve permission request prompt messages in ACP mode. These previously showed only the tool name (bash, edit, write) with no context about what was actually being requested for approve/reject. This change makes it vastly more useful to interact with OpenCode Agent in an ACP context (such as in Zed IDE agent threads).

Two fixes:

  1. tool/shell.ts: ask() was passing metadata: {} — neither the command string nor the description were included. Now passes metadata: { command, description } so Zed can display them.

  2. acp/agent.ts: Added toPermissionTitle() helper that picks the most useful field from permission metadata (descriptioncommandfilepathpatternurlrepository → tool name). Used for both the permission request title and tool call update titles (pending/in_progress/failed).

Also fixed toLocations() which used input["filePath"] (camelCase) for edit/write but permission metadata uses input["filepath"] (lowercase), so file locations were never shown in edit prompts.

  1. acp/agent.ts: The "Always allow" button label now includes the scope pattern (e.g. Always allow: git * for a git command, Always allow: * for edit/write). Previously there was no indication of what future requests would be auto-approved.

How did you verify your code works?

Tested locally in Zed with a custom dev build.
I've manually run mut=ltiple agent thread including responding to numerous bash, edit/write prompts.
Approval prompts for shell commands now show the LLM-provided description / full command. Edit/write prompts show the file path. All 13 ACP unit tests pass.

Screenshots / recordings

Before
image

After:
image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.

acp, zed: does not support native changes review

1 participant