[GH-ISSUE #15134] x/tools: add a no-op think tool for structured reasoning before action #56202

Open
opened 2026-04-29 10:25:26 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @harshitgavita-07 on GitHub (Mar 29, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/15134

I'd like to propose a small addition to the agent/tooling layer: a built-in think
tool in x/tools that gives models a structured no-op reasoning step before taking
an external action.

Why

The current tool loop supports acting (bash, web/search-style tools, etc.), but
there doesn't appear to be a built-in reasoning primitive for cases where a model
should explicitly plan before choosing its next tool call.

For local/smaller models, this can help reduce bad tool selection and malformed
arguments by encouraging a plan-first pattern:

  1. think
  2. choose tool
  3. act

Proposed behavior

  • Tool name: think
  • Input schema: { "thought": string }
  • Execution: validates input and returns "ok"
  • Side effects: none
  • Optional opt-out via env var, e.g. OLLAMA_AGENT_DISABLE_THINK=1

Scope

This would be intentionally small:

  • x/tools/think.go
  • tests
  • registry wiring
  • human-readable display name in approval UI

If this direction fits the roadmap, I can open a focused PR with tests.
@jmorganca

Originally created by @harshitgavita-07 on GitHub (Mar 29, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/15134 I'd like to propose a small addition to the agent/tooling layer: a built-in `think` tool in `x/tools` that gives models a structured no-op reasoning step before taking an external action. ## Why The current tool loop supports acting (`bash`, web/search-style tools, etc.), but there doesn't appear to be a built-in reasoning primitive for cases where a model should explicitly plan before choosing its next tool call. For local/smaller models, this can help reduce bad tool selection and malformed arguments by encouraging a plan-first pattern: 1. think 2. choose tool 3. act ## Proposed behavior - Tool name: `think` - Input schema: `{ "thought": string }` - Execution: validates input and returns `"ok"` - Side effects: none - Optional opt-out via env var, e.g. `OLLAMA_AGENT_DISABLE_THINK=1` ## Scope This would be intentionally small: - `x/tools/think.go` - tests - registry wiring - human-readable display name in approval UI If this direction fits the roadmap, I can open a focused PR with tests. @jmorganca
GiteaMirror added the feature request label 2026-04-29 10:25:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#56202