Skip to content

Conversation

@opencode-agent
Copy link
Contributor

@opencode-agent opencode-agent bot commented Jan 8, 2026

The fix looks correct. Let me summarize what the fix does:

Summary

Problem: When a permission request is made in ACP, the rawInput field was being set to permission.metadata, which is typically empty ({}) because tools pass empty metadata when asking for permissions. This caused ACP clients to receive permission requests without the actual tool input parameters, making it impossible for users to make informed decisions about granting permissions.

Root Cause: The ctx.ask() calls in tools (like bash, edit, etc.) pass metadata: {}. The permission request was using this empty metadata instead of the actual tool call input.

Fix: When a permission.asked event is received, the fix now fetches the actual message containing the tool call and extracts the tool's input from part.state.input. This ensures that the rawInput in the permission request contains the actual tool parameters (e.g., command and description for bash).

The fix:

  1. Checks if permission.tool exists (contains messageID and callID)
  2. Fetches the message using the SDK
  3. Finds the matching tool part by callID
  4. Uses part.state.input for the rawInput instead of permission.metadata
  5. Falls back to permission.metadata if any step fails

Closes #7370

New%20session%20-%202026-01-08T20%3A15%3A04.016Z
opencode session  |  github run

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] Opencode sets rawInput back to empty

1 participant