opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[ACP] Opencode sets rawInput back to empty

Open r1bilski opened this issue 1 week ago • 4 comments

Description

Here is an example tool call when using opencode acp (removed irrelevant fields):

[
  {
    "update": {
      "kind": "execute",
      "rawInput": {},
      "sessionUpdate": "tool_call",
      "status": "pending",
      "title": "bash",
      "toolCallId": "id1"
    }
  },
  {
    "update": {
      "rawInput": {
        "command": "echo 'foo'",
        "description": "Print 'foo'"
      },
      "sessionUpdate": "tool_call_update",
      "status": "in_progress",
      "toolCallId": "id1"
    }
  },
  {
    "toolCall": {
      "kind": "execute",
      "rawInput": {},
      "status": "pending",
      "title": "bash",
      "toolCallId": "id1"
    }
  },
  {
    "update": {
      "rawInput": {
        "command": "echo 'foo'",
        "description": "Print 'foo'"
      },
      "sessionUpdate": "tool_call_update",
      "status": "in_progress",
      "toolCallId": "id1"
    }
  }
]

As you can see, we:

  1. Get the initial SessionUpdate for the tool call
  2. Get an update with command and description
  3. Get a permission request that sets rawInput back to {}
  4. Get an update for the status that sets rawInput back to the state from before the permission request.

This is unfortunate, because that means when we display the details of the tool call to the user, they have nothing to base their decision on except the title and kind, which didn't get overwritten.

Plugins

None

OpenCode version

1.1.4

Steps to reproduce

  1. Set up an ACP session
  2. Get the agent to request a permission

Screenshot and/or share link

No response

Operating System

Alpine Linux

Terminal

st

r1bilski avatar Jan 08 '26 19:01 r1bilski