opencode run hangs when model attempts to use question tool #8394

Open
opened 2026-02-16 18:09:51 -05:00 by yindo · 1 comment
Owner

Originally created by @justindra on GitHub (Feb 3, 2026).

Originally assigned to: @rekram1-node on GitHub.

Bug Description

When using opencode run, if the model attempts to use the question tool, the command hangs indefinitely. This happens because the question tool waits for user input that can never come in non-interactive mode.

Root Cause

run.ts correctly sets session permission rules to deny the question permission, but LLM.resolveTools only checked agent.permission when filtering disabled tools - it ignored session permissions. This allowed the question tool to remain available to the model.

Expected Behavior

The question tool should be excluded from the tools list in non-interactive mode, preventing the model from calling it.

Actual Behavior

The model can call the question tool, which then hangs waiting for a response.

Environment

  • opencode version: 1.1.49
  • OS: Linux
Originally created by @justindra on GitHub (Feb 3, 2026). Originally assigned to: @rekram1-node on GitHub. ## Bug Description When using `opencode run`, if the model attempts to use the question tool, the command hangs indefinitely. This happens because the question tool waits for user input that can never come in non-interactive mode. ## Root Cause `run.ts` correctly sets session permission rules to deny the `question` permission, but `LLM.resolveTools` only checked `agent.permission` when filtering disabled tools - it ignored session permissions. This allowed the question tool to remain available to the model. ## Expected Behavior The question tool should be excluded from the tools list in non-interactive mode, preventing the model from calling it. ## Actual Behavior The model can call the question tool, which then hangs waiting for a response. ## Environment - opencode version: 1.1.49 - OS: Linux
Author
Owner

@github-actions[bot] commented on GitHub (Feb 3, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #11891: subprocess.Popen hang issues on "opencode run message --json format"? - While this issue also involves opencode run hanging, it may have a different root cause related to subprocess stdout handling vs. the question tool permission filtering described here.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 3, 2026): This issue might be a duplicate of existing issues. Please check: - #11891: subprocess.Popen hang issues on "opencode run message --json format"? - While this issue also involves `opencode run` hanging, it may have a different root cause related to subprocess stdout handling vs. the question tool permission filtering described here. Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8394