Back Home

GitHub Repo

Ollama Community Reports OpenCode v2 Startup Failure; Fix Discussion Reveals Model-Selection Bias

An October 26 report in the Ollama community says a model argument passed by the launcher causes OpenCode v2.1.4 to exit immediately. A candidate fix has been proposed, but subsequent testing suggests a shared background service may also disregard the selected model, so the issue cannot yet be considered fully resolved.

Mattruffoni · CC BY-SA 4.0 · Image source
zh-Hant

A compatibility issue has been reported in the integration between Ollama and the terminal coding agent OpenCode. On October 26, a user said that with Ollama 0.40.11 and OpenCode 2.1.4, running ollama launch opencode after selecting a model causes the program to exit with code 1 because it does not accept the --model argument. The report describes an environment running Ubuntu on WSL2 and using a cloud model connected through a local Ollama service; the impact in other environments remains unconfirmed. Issue report

The report traces the trigger to argument injection by the launcher: when no other arguments are passed and a model has been selected, the program constructs --model ollama/<model name>. The community therefore proposed PR #19298, which removes this injection and instead passes the model configuration through the existing OPENCODE_CONFIG_CONTENT, while preserving arguments passed by the user. The proposal lists Go tests and static checks, but had not been merged at the time of review. Proposed fix

Follow-up discussion surfaced another boundary that needs verification. The original reporter said that after restarting OpenCode's shared background service, inline configuration alone could still leave the global default model in use. The same non-interactive request used the model selected by the launcher only after adding --standalone and switching to a private service. This suggests that correcting the argument error may not restore the intended model routing; so far, this result comes from participant testing and has not been confirmed by a maintainer. Follow-up testing

The official documentation also leaves a point to clarify. Ollama's documentation says the launcher specifies the model through inline configuration and does not overwrite an existing configuration file. However, the OpenCode CLI documentation reviewed still lists --model as a valid argument for the terminal interface. The available evidence is therefore insufficient to generalize removal of the argument as a change common to all OpenCode versions. Ollama integration documentation, OpenCode CLI documentation

For engineers maintaining coding-agent environments, acceptance checks should verify both that the program starts and which model actually handles the request. Based on the reports above, checking only that the process opens could miss a background service continuing to use a different model configuration. Next, track whether the fix covers service modes, model selection, and version differences, and whether a release includes complete comparative tests.

Sources

  1. Ollama issue #19296:OpenCode v2 啟動參數錯誤
  2. Ollama PR #19298:改由行內設定指定 OpenCode 模型
  3. OpenCode — Ollama 整合文件
  4. OpenCode CLI 文件