Skip to content

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

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

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

Conversation

@bcdady

@bcdady bcdady commented May 22, 2026

Copy link
Copy Markdown

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

@nokt0

nokt0 commented May 27, 2026

Copy link
Copy Markdown

I really hope this mr will be merged and that I will be able to fully use acp in zed

@Joeyqiu233

Copy link
Copy Markdown

please merge

@bcdady bcdady force-pushed the fix/acp-write-text-file-capability branch from ceee60b to 270b275 Compare June 20, 2026 00:48
 - fix(acp): use tool description as title in permission prompts and tool call updates
 - fix(acp): surface file path and tool context in permission prompt titles
@bcdady bcdady force-pushed the fix/acp-write-text-file-capability branch from 270b275 to 45f2ded Compare June 20, 2026 19:18
@bcdady

bcdady commented Jun 25, 2026

Copy link
Copy Markdown
Author

Closing in favor of a fresh, narrowly-scoped replacement PR.

When I opened this back in May, it covered three fixes across tool/shell.ts, acp/agent.ts, and acp/permission.ts. Upstream merges since then have absorbed the first two areas, leaving only the permission.ts title-fallback change still unique to this branch. The body and screenshots above describe scope that's no longer accurate, and Closes #4240 was for the broader file-write capability work - not what remains.

Re-opening as a clean, template-compliant PR against a more accurate issue. Will link here when it's up.

@bcdady bcdady closed this Jun 25, 2026
@bcdady

bcdady commented Jun 25, 2026

Copy link
Copy Markdown
Author

Replacement opened: #33950 (links #33949).

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

3 participants