bug: Ollama and custom provider models always registered with reasoning: false, breaking thinking level support #208

Open
opened 2026-03-19 02:11:58 +00:00 by jason.woltje · 0 comments
Owner

Summary

Both registerOllamaProvider() and registerCustomProvider() in ProviderService hard-code reasoning: false for every model. If a user has a thinking-capable custom endpoint (e.g. a self-hosted Claude-compatible API or Ollama with a reasoning model), thinking levels will never be available regardless of what the model actually supports.

Root Cause

apps/gateway/src/agent/provider.service.ts:

// registerOllamaProvider — all Ollama models hard-coded to reasoning: false
models: modelIds.map((id) => ({
  id,
  reasoning: false,   // ← hard-coded, no way to override
  ...
})),

// registerCustomProvider — defaults to false with no documentation
models: config.models.map((m) => ({
  id: m.id,
  reasoning: m.reasoning ?? false,   // ← silently defaults to false
  ...
})),

getAvailableThinkingLevels() in the Pi SDK checks model.reasoning:

supportsThinking() {
  return !!this.model?.reasoning;
}
getAvailableThinkingLevels() {
  if (!this.supportsThinking()) return ["off"];
  ...
}

When reasoning is false, available levels = ["off"]. No amount of set:thinking requests can escape this.

Steps to Reproduce

  1. Configure MOSAIC_CUSTOM_PROVIDERS with a model that supports thinking but without setting reasoning: true
  2. Start the CLI TUI
  3. session:info reports availableThinkingLevels: ["off"]

Expected Behaviour

  • Ollama provider registration should read a OLLAMA_REASONING_MODELS env var (comma-separated list of model IDs that support reasoning), defaulting to false
  • Custom provider docs/types should prominently document reasoning: true as required for thinking support
  • Consider adding a startup warning when the default model has reasoning: false

Affected File

  • apps/gateway/src/agent/provider.service.tsregisterOllamaProvider() and registerCustomProvider()
## Summary Both `registerOllamaProvider()` and `registerCustomProvider()` in `ProviderService` hard-code `reasoning: false` for every model. If a user has a thinking-capable custom endpoint (e.g. a self-hosted Claude-compatible API or Ollama with a reasoning model), thinking levels will never be available regardless of what the model actually supports. ## Root Cause `apps/gateway/src/agent/provider.service.ts`: ```ts // registerOllamaProvider — all Ollama models hard-coded to reasoning: false models: modelIds.map((id) => ({ id, reasoning: false, // ← hard-coded, no way to override ... })), // registerCustomProvider — defaults to false with no documentation models: config.models.map((m) => ({ id: m.id, reasoning: m.reasoning ?? false, // ← silently defaults to false ... })), ``` `getAvailableThinkingLevels()` in the Pi SDK checks `model.reasoning`: ```ts supportsThinking() { return !!this.model?.reasoning; } getAvailableThinkingLevels() { if (!this.supportsThinking()) return ["off"]; ... } ``` When `reasoning` is `false`, available levels = `["off"]`. No amount of `set:thinking` requests can escape this. ## Steps to Reproduce 1. Configure `MOSAIC_CUSTOM_PROVIDERS` with a model that supports thinking but without setting `reasoning: true` 2. Start the CLI TUI 3. `session:info` reports `availableThinkingLevels: ["off"]` ## Expected Behaviour - Ollama provider registration should read a `OLLAMA_REASONING_MODELS` env var (comma-separated list of model IDs that support reasoning), defaulting to `false` - Custom provider docs/types should prominently document `reasoning: true` as required for thinking support - Consider adding a startup warning when the default model has `reasoning: false` ## Affected File - `apps/gateway/src/agent/provider.service.ts` — `registerOllamaProvider()` and `registerCustomProvider()`
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#208