ollama - ✅(Solved) Fix `/set think {high|medium|low|true|false}` in the TUI crashes qwen3.5 models [1 pull requests, 4 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#14614Fetched 2026-04-08 00:33:48
View on GitHub
Comments
4
Participants
4
Timeline
7
Reactions
2
Author
Timeline (top)
commented ×4cross-referenced ×1labeled ×1subscribed ×1

Error Message

/set think false Set 'think' mode to 'false'. hey there error: 400 Bad Request: invalid think value: "false" (must be "high", "medium", "low", true, or false) /set think high Set 'think' mode to 'high'. hey there Error: 400 Bad Request: think value "high" is not supported for this model 10:47:16 sammy@neo-bandito ~$

Fix Action

Fixed

PR fix notes

PR #14618: cmd: improve think handling

Description (problem / solution / changelog)

Prevent exit from the CLI by shortening the match string so it also matches the return error think value %q is not supported for this model. There are no other error message that will match.

Do basic validation on the think value so that /set think true and /set think false work as expected.

Fixes: #14612 Fixes: #14614

Changed files

  • cmd/interactive.go (modified, +5/-1)

Code Example

>>> /set think false
Set 'think' mode to 'false'.
>>> hey there
error: 400 Bad Request: invalid think value: "false" (must be "high", "medium", "low", true, or false)
>>> /set think high
Set 'think' mode to 'high'.
>>> hey there
Error: 400 Bad Request: think value "high" is not supported for this model
10:47:16 sammy@neo-bandito ~$

---

there are no relevant logs, as the error seems to happen in the TUI

 
Mar 04 10:47:15 neo-bandito ollama[1594]: [GIN] 2026/03/04 - 10:47:15 | 400 |  146.015127ms |       127.0.0.1 | POST     "/api/chat"
Mar 04 10:47:15 neo-bandito ollama[1594]: [GIN] 2026/03/04 - 10:47:15 | 400 |  146.015127ms |       127.0.0.1 | POST     "/api/chat"
RAW_BUFFERClick to expand / collapse

What is the issue?

setting think to any of the accepted values returns first an error and eventually crashes the application with a 400 Bad Request

>>> /set think false
Set 'think' mode to 'false'.
>>> hey there
error: 400 Bad Request: invalid think value: "false" (must be "high", "medium", "low", true, or false)
>>> /set think high
Set 'think' mode to 'high'.
>>> hey there
Error: 400 Bad Request: think value "high" is not supported for this model
10:47:16 sammy@neo-bandito ~$

this seems to happen with all official versions of qwen3.5

Relevant log output

there are no relevant logs, as the error seems to happen in the TUI

 
Mar 04 10:47:15 neo-bandito ollama[1594]: [GIN] 2026/03/04 - 10:47:15 | 400 |  146.015127ms |       127.0.0.1 | POST     "/api/chat"
Mar 04 10:47:15 neo-bandito ollama[1594]: [GIN] 2026/03/04 - 10:47:15 | 400 |  146.015127ms |       127.0.0.1 | POST     "/api/chat"

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

ollama version is 0.17.5

extent analysis

Fix Plan

The issue seems to be related to invalid think mode values. To fix this, we need to validate and sanitize the input values.

Step-by-Step Solution

  • Validate the input think value to ensure it matches one of the accepted values: "high", "medium", "low", true, or false.
  • Sanitize the input value to prevent crashes.

Example Code

def validate_think_mode(think):
    accepted_values = ["high", "medium", "low", True, False]
    if think not in accepted_values:
        raise ValueError("Invalid think value. Must be one of: {}".format(accepted_values))

def set_think_mode(think):
    try:
        validate_think_mode(think)
        # Set the think mode
        print("Set 'think' mode to '{}'.".format(think))
    except ValueError as e:
        print("Error: {}".format(e))

# Example usage
set_think_mode("high")  # Set 'think' mode to 'high'.
set_think_mode("invalid")  # Error: Invalid think value. Must be one of: ['high', 'medium', 'low', True, False]

Verification

To verify the fix, test the set_think_mode function with different input values, including valid and invalid ones. The function should print an error message for invalid values and set the think mode correctly for valid values.

Extra Tips

  • Always validate and sanitize user input to prevent crashes and ensure the application's stability.
  • Consider adding more robust error handling and logging mechanisms to diagnose and fix issues more efficiently.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING