You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode run exits with status 0 for invalid model when prompt is provided #26509
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
Both are closed; if the fix was reverted or the behavior regressed, it may be worth referencing those issues and confirming the version where it was fixed.
Have a small fix for this — setting process.exitCode = 1 in the session.error handler inside run.ts's loop(), which matches the existing pattern in thread.ts and attach.ts. Opening a PR shortly.
For context, prior attempt PR #15787 (same bug as surfaced in #15558 / #17854 / #2489) was auto-closed by the template-compliance bot before any human review.
Activity
github-actions commentedon May 9, 2026
This issue might be a duplicate of existing issues. Please check:
opencode run --model invalid-model-123 "test"exits with code 0Both are closed; if the fix was reverted or the behavior regressed, it may be worth referencing those issues and confirming the version where it was fixed.
cokekitten commentedon May 9, 2026
Have a small fix for this — setting
process.exitCode = 1in thesession.errorhandler insiderun.ts'sloop(), which matches the existing pattern inthread.tsandattach.ts. Opening a PR shortly.For context, prior attempt PR #15787 (same bug as surfaced in #15558 / #17854 / #2489) was auto-closed by the template-compliance bot before any human review.
Happy to defer if anyone's already working on it.
github-actions commentedon Jul 9, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.