Skip to content

[BUG] Ollama integration: Invalid maxOutputTokens error #21858

Closed as not planned

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

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 10, 2026
  2. github-actions commented on Apr 10, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of an existing issue. Please check:

    Please review that issue and check if the fix there resolves your problem. If your issue is different or the fix did not work for you, please add more details explaining how your situation differs.

  3. Jedeiah commented on Apr 11, 2026

    @Jedeiah

    @rekram1-node I'd like to work on this fix. Can I take this?

  4. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions