Skip to content

Local Ollama models silently excluded from SDD phase picker β€” missing tool_call flag not documentedΒ #934

Description

@bmKaio

Pre-flight Checklist

  • I have searched existing issues and this is not a duplicate
  • I understand that PRs will be rejected if the linked issue does not have status:approved

πŸ“ Bug Description

When a local Ollama provider is correctly defined in opencode.json, its models do not appear in
the SDD phase model picker. The TUI only lists ollama-cloud (a paid cloud service), with no
indication that local models are supported or why they are not shown.

Related to #375 (LM Studio, v1.23.0). Unlike that report, in v1.40.2 opencode.json IS already
read via LoadConfigProviders + MergeCustomProviders β€” that part is fixed. The remaining
friction is a different, undocumented requirement.

πŸ”„ Steps to Reproduce

  1. Configure a local Ollama provider in ~/.config/opencode/opencode.json:

"provider": {
"ollama": {
"name": "Ollama (local)",
"npm": "@ai-sdk/openai-compatible",
"options": { "baseURL": "http://localhost:11434/v1" },
"models": {
"qwen3-coder:30b": { "name": "Qwen3 Coder 30B" }
}
}
}

     
  2. Run gentle-ai β†’ OpenCode SDD Profiles β†’ Create new profile
  3. Reach the provider selection screen
2. 
3. 


### βœ… Expected Behavior

The "ollama" provider appears in the picker with the configured local models available for assignment to SDD phases.

### ❌ Actual Behavior

"ollama" does not appear. Only "ollama-cloud" is shown (a separate cloud provider requiring OLLAMA_API_KEY). The local models are silently excluded with no error or warning.

### Gentle AI Version

1.40.2

### Operating System

Linux (Ubuntu/Debian)

### AI Agent / Client

OpenCode

### πŸ“‹ Affected Area

TUI (terminal UI)

### πŸ’‘ Logs / Error Output

```shell
No error output β€” the exclusion is silent.

Additional Context

Root cause found in internal/opencode/models.go:

    func FilterModelsForSDD(provider Provider) []Model {
        var models []Model
        for _, m := range provider.Models {
            if m.ToolCall {   // false by default in Go β†’ all custom models excluded
                models = append(models, m)
            }   
        }
        return models
    }   

    type ConfigModel struct {
        Name     string `json:"name"`
        ToolCall bool   `json:"tool_call"`   // not mentioned in any docs
    }

The ConfigProvider struct only reads "name" and "tool_call" per model. Since "tool_call"
defaults to false, any model in opencode.json without that field is invisible to the SDD picker.


Workaround:
add "tool_call": true to each model entry in opencode.json that supports tool calling.
This immediately fixes the issue β€” the provider and models appear in the picker on the next
gentle-ai run.

Suggested fix options (in order of effort):

A. Docs: add a "Local Ollama / LM Studio" section to docs/opencode-profiles.md explaining the
tool_call requirement with a minimal example.

B. TUI warning: when a provider has models but none pass FilterModelsForSDD, show a hint
instead of silently omitting the provider.

C. Auto-detect: query GET /v1/models on local providers at startup and infer tool_call support
from model family (Qwen, Llama, Gemma β†’ true; embedding/OCR β†’ false).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus:needs-reviewAwaiting maintainer review

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions