Skip to content

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

@justindra

Description

@justindra

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions