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
BUG: exit code when an invalid model is passed #15558
Following and example of the bug, and the reasoning of the AI model as it replied
$ opencode run --model "invalid-model-123" "test" 2>/dev/null ; echo "EXIT: $?"
EXIT: 0
Thinking: So opencode is returning exit code 0 even when it prints an error message! This is a bug in opencode itself (it prints errors to stderr but exits with 0).
The fix for the harness should be to check if stderr has error content, not just exit code. Let me modify the runner to check stderr for error patterns:
The issue is that opencode returns exit code 0 even when it prints an error message. I need to modify runner.ts to check stderr for errors, not just exit code.
The description contains what appears to be AI-generated internal reasoning/thinking text ("Thinking: So opencode is returning exit code 0...", "The fix for the harness should be...", "I need to modify runner.ts..."). Please replace this with a clear, human-written description of the bug.
Required fields are empty: OpenCode version, Steps to reproduce, Operating System, and Terminal — these help us reproduce and fix the bug.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be related to an existing issue. Please check:
Thanks for updating the issue with your system info — that helps a lot.
However, the Description field still contains AI-generated internal reasoning text that was not removed:
Thinking: So opencode is returning exit code 0 even when it prints an error message! This is a bug in opencode itself...
The fix for the harness should be to check if stderr has error content...
I need to modify runner.ts to check stderr for errors...
Please edit the Description to remove that text and replace it with a plain description of the bug in your own words — something like: "When passing an invalid model via --model, opencode prints an error to stderr but still exits with code 0 instead of a non-zero exit code."
The needs:compliance label will remain until this is addressed.
Thanks for updating the issue! It now meets our contributing guidelines — the bug description, steps to reproduce, and system information are all present and clear. We appreciate you taking the time to improve it.
Activity
github-actions commentedon Mar 1, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be related to an existing issue. Please check:
opencode runnot exiting properly on errors (hangs instead of non-zero exit code)If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Mar 1, 2026
Thanks for updating the issue with your system info — that helps a lot.
However, the Description field still contains AI-generated internal reasoning text that was not removed:
Please edit the Description to remove that text and replace it with a plain description of the bug in your own words — something like: "When passing an invalid model via
--model, opencode prints an error to stderr but still exits with code 0 instead of a non-zero exit code."The
needs:compliancelabel will remain until this is addressed.github-actions commentedon Mar 1, 2026
Thanks for updating the issue! It now meets our contributing guidelines — the bug description, steps to reproduce, and system information are all present and clear. We appreciate you taking the time to improve it.
fix(run): exit with non-zero code on session error in run command
github-actions commentedon May 1, 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.