Skip to content

[BUG] Ollama integration: Invalid maxOutputTokens error #21858

@domidambrosiog-dotcom

Description

@domidambrosiog-dotcom

Description

Problema

Quando si usa OpenCode con Ollama come provider locale, ottengo l'errore:
"Invalid argument for parameter maxOutputTokens: maxOutputTokens must be >= 1"

Configurazione

  • OpenCode version: 1.4.2
  • Ollama version: 0.20.4
  • Modello usato: qwen2.5:1.5b
  • Sistema: Windows 10 (8GB RAM)

Passi per riprodurre

  1. Avviare Ollama con ollama serve
  2. Configurare OpenCode per usare Ollama come provider locale
  3. Avviare OpenCode con opencode
  4. Inviare un messaggio

Errore dal log

ERROR service=session.processor error=Invalid argument for parameter maxOutputTokens: maxOutputTokens must be >= 1

Note

  • Il modello funziona correttamente con chiamate dirette API a Ollama
  • La versione online di OpenCode funziona perfettamente

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

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