Skip to content

opencode run exits with status 0 for invalid model when prompt is provided #26509

@vedantnaik19

Description

@vedantnaik19

Description

Description

Running opencode run with an invalid model and a prompt/message argument produces a ProviderModelNotFoundError, but the process exits with status code 0.

This only appears to happen when a prompt/message is provided.

Command

opencode run -m invalid-model "some message"
echo $?

Plugins

No response

OpenCode version

1.14.41

Steps to reproduce

  • Run: opencode run -m invalid-model "build"
  • Notice it prints ProviderModelNotFoundError / Model not found
  • Run: echo $?
  • Notice the exit code is 0
  • [Optionally] Compare with: opencode run -m invalid-model without a prompt/message

Screenshot and/or share link

No response

Operating System

macOS 26.4

Terminal

Mac Terminal

Metadata

Metadata

Assignees

Labels

No labels
No labels

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