OpenCode breaks in Zed if asked to use the AskUserQuestion tool #8080

Closed
opened 2026-02-16 18:09:06 -05:00 by yindo · 4 comments
Owner

Originally created by @yeskunall on GitHub (Jan 30, 2026).

Description

We’ve gotten at least one report so far of Zed breaking for a user if they asked a question which prompted the LLM to use the AskUserQuestion tool. As mentioned in my comment on that issue:

However, Zed doesn’t really support interactive inputs (needed for asking questions) as of now, so we effectively do not support that tool. OpenCode -- if they are open to it -- should disable that tool if they detect the request is coming from Zed.

I quickly asked Opus 4.5 to go through both our codebases and it suggested 3 solutions and I only really liked one of them. So for now, here’s the suggestion I liked (because it seems the most straight-forward to me):

Zed already sends some info about itself here, maybe we can use that in initialize?

In other words, IIUC, OpenCode already receives client info from Zed with name: "zed". You’d just have to check it somehow:

// Check if running under a known ACP client that doesn’t support question tool
const disableQuestionTool = clientInfo?.name === "zed"
...(!disableQuestionTool && ["app", "cli", "desktop"].includes(Flag.OPENCODE_CLIENT) ? [QuestionTool] : []),

If this sounds like an OK change, happy to send a PR. If not, do you guys have a better solution? Would really like to see OpenCode working in Zed!

Plugins

N/A

OpenCode version

1.1.42

Steps to reproduce

  1. Open Zed (grabbing Nightly is optimal: curl https://zed.dev/install.sh | ZED_CHANNEL=nightly sh)
  2. Install OpenCode from the ACP registry (open the command palette and do zed: acp registry)
  3. Ask the agent something that would prompt the use of the AskUserQuestion tool
  4. Zed will forever keep spinning (see screenshot below or in the original issue on our repo)

Screenshot and/or share link

Image

https://github.com/zed-industries/zed/issues/48038#issuecomment-3825013402

Operating System

macOS 15.7.3

Terminal

No response

Originally created by @yeskunall on GitHub (Jan 30, 2026). ### Description We’ve gotten at least [one report](https://github.com/zed-industries/zed/issues/48038) so far of Zed breaking for a user if they asked a question which prompted the LLM to use the `AskUserQuestion` tool. As mentioned in [my comment](https://github.com/zed-industries/zed/issues/48038#issuecomment-3825013402) on that issue: > However, Zed doesn’t really support interactive inputs (needed for asking questions) as of now, so we effectively do not support that tool. OpenCode -- if they are open to it -- should disable that tool if they detect the request is coming from Zed. I quickly asked Opus 4.5 to go through both our codebases and it suggested 3 solutions and I only really liked one of them. So for now, here’s the suggestion I liked (because it seems the most straight-forward to me): Zed already sends some info about itself [here](https://github.com/zed-industries/zed/blob/b029238af25632c745d430b9a090d36075f280a3/crates/agent_servers/src/acp.rs#L298-L301), maybe we can use that in [`initialize`](https://github.com/anomalyco/opencode/blob/e9ef94dc4d2d386ee1f452b4af337a91ad6bcd1c/packages/opencode/src/acp/agent.ts#L414-L458)? In other words, IIUC, OpenCode already receives client info from Zed with `name: "zed"`. You’d just have to check it somehow: ```ts // Check if running under a known ACP client that doesn’t support question tool const disableQuestionTool = clientInfo?.name === "zed" ...(!disableQuestionTool && ["app", "cli", "desktop"].includes(Flag.OPENCODE_CLIENT) ? [QuestionTool] : []), ``` If this sounds like an OK change, happy to send a PR. If not, do you guys have a better solution? Would really like to see OpenCode working in Zed! ### Plugins N/A ### OpenCode version 1.1.42 ### Steps to reproduce 1. Open Zed (grabbing Nightly is optimal: `curl https://zed.dev/install.sh | ZED_CHANNEL=nightly sh`) 2. Install OpenCode from the ACP registry (open the command palette and do `zed: acp registry`) 3. Ask the agent something that would prompt the use of the `AskUserQuestion` tool 4. Zed will forever keep spinning (see screenshot below or in the original issue on our repo) ### Screenshot and/or share link <img width="3464" height="2250" alt="Image" src="https://github.com/user-attachments/assets/2fc4b09c-2e87-4abc-bc29-28f38dd646be" /> https://github.com/zed-industries/zed/issues/48038#issuecomment-3825013402 ### Operating System macOS 15.7.3 ### Terminal _No response_
yindo added the bug label 2026-02-16 18:09:06 -05:00
yindo closed this issue 2026-02-16 18:09:06 -05:00
Author
Owner

@rekram1-node commented on GitHub (Jan 30, 2026):

Yeah it shouldn't be present when using acp

@rekram1-node commented on GitHub (Jan 30, 2026): Yeah it shouldn't be present when using acp
Author
Owner

@yeskunall commented on GitHub (Jan 30, 2026):

Hopefully I didn’t misunderstand you -- so ya’ll will look to fix it on your end? No action needed on my part, then? If so, I’ll wait for your PR.

@yeskunall commented on GitHub (Jan 30, 2026): Hopefully I didn’t misunderstand you -- so ya’ll will look to fix it on your end? No action needed on my part, then? If so, I’ll wait for your PR.
Author
Owner

@rekram1-node commented on GitHub (Jan 30, 2026):

Yes correct

@rekram1-node commented on GitHub (Jan 30, 2026): Yes correct
Author
Owner

@rekram1-node commented on GitHub (Jan 30, 2026):

will be fixed in next release

@rekram1-node commented on GitHub (Jan 30, 2026): will be fixed in next release
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8080