Skip to content

fix(acp): include shell command in permission request - #28734

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

fix(acp): include shell command in permission request#28734
bcdady wants to merge 2 commits into
anomalyco:devfrom
bcdady:fix/acp-write-text-file-capability

Conversation

@bcdady

@bcdady bcdady commented May 21, 2026

Copy link
Copy Markdown

Issue

Closes #4240 (partial — the writeTextFile gap is addressed separately in dev)

Type of change

  • Bug fix

What does this PR do?

When opencode asks for permission to run a shell command in ACP mode (e.g. inside Zed), the permission prompt showed only bash or nothing at all — giving no indication of what command would actually be executed.

Two fields were missing:

  1. tool/shell.ts: ask() always passed metadata: {} — the command string was never included in the permission request
  2. acp/agent.ts: requestPermission used the tool name (bash) as the title regardless; it now prefers metadata.command when present

With this fix, the Zed permission prompt shows the actual command (e.g. git status) as the title, and includes it in rawInput for the expanded detail view.

How did you verify your code works?

Tested locally in Zed with opencode-pr28734 custom agent. Permission prompts for bash commands now display the command string instead of just bash.

Checklist

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

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found a related PR:

Related PR:

Why it's related: According to your PR description, PR #22674 is the original submission of this exact fix. You mention: "This is a re-submission of the same fix from PR #22674, which addressed the same issue but went stale. The diff is functionally identical; it has been rebased onto the current dev HEAD."

Since PR #22674 went stale and you're resubmitting the rebased fix as PR #28734, ensure PR #22674 is closed/marked as superseded before merging this one.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@bcdady
bcdady force-pushed the fix/acp-write-text-file-capability branch from b85a1bd to 3a0c73f Compare May 22, 2026 18:29
@bcdady bcdady changed the title fix(acp): emit writeTextFile for file edits when client advertises fs.writeTextFile fix(acp): include shell command in permission request May 22, 2026
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 22, 2026
@github-actions github-actions Bot closed this May 22, 2026
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