Skip to content

Config tool_call: false does not disable tools #35432

Description

@tobwen

Description

tool_call: false in model config is ignored by the prompt loop. The code unconditionally resolves SessionTools and sends them in the LLM request body, with tool_choice defaulting to "auto". Providers that serve models without tool-call support (e.g. morphllm without --enable-auto-tool-choice) reject the request with a 400 error.

Root cause

In packages/opencode/src/session/prompt.ts, the SessionTools.resolve() call and the toolChoice parameter in handle.process() both ignore model.capabilities.toolcall. Setting tool_call: false in model config correctly sets capabilities.toolcall to false in packages/opencode/src/provider/provider.ts:1216, but the prompt loop never reads that field.

Why this is bad

The user explicitly opts out of tool calls via tool_call: false, expecting a model-safe request with no tools sent. Instead the prompt loop sends a full tools array with tool_choice: "auto", which providers reject if they do not support tool calling at all. There is no workaround at the session or request level -- the config field is effectively a no-op.

Steps to reproduce

  1. Configure a model with tool_call: false:

    {
      "provider": {
        "morphllm": {
          "models": {
            "morphllm/Qwen3-30B-A3B": {
              "tool_call": false
            }
          }
        }
      }
    }
  2. Start a session with that model and send a message.

  3. The prompt loop calls the provider API with "tools": [...] and "tool_choice": "auto", even though tool calls are disabled.

  4. Providers that require --enable-auto-tool-choice and --tool-call-parser flags return HTTP 400.

Expected

With tool_call: false, the LLM request body should contain neither tools nor tool_choice keys. The prompt loop should skip SessionTools.resolve() entirely.

OpenCode version

dev (current)

Operating System

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