fix(opencode): exit nonzero when run produces no assistant message - #13832
Merged
Conversation
Surface: the CLI (packages/opencode). `kilo run` exits 0 when the model returns no assistant message, so a caller cannot tell an empty run from a successful one. Reproduce first on a live CLI build: force a run that produces no assistant message and read its exit code. If it already exits non-zero, stop with the evidence and no code change. If it does not, exit non-zero with a clear stderr line, leave the exit code of a normal run unchanged, add a test beside the existing run tests, and show both exit codes in the PR body.
iscekic
marked this pull request as draft
September 6, 2026 17:32
iscekic
marked this pull request as ready for review
September 6, 2026 17:38
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by grok-4.6 · Input: 200.5K · Output: 20.1K · Cached: 841K Review guidance: REVIEW.md from base branch |
marius-kilocode
approved these changes
Sep 7, 2026
This was referenced Sep 8, 2026
This was referenced Sep 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Request
Changelog for users
kilo runnow exits non-zero when the model returns no assistant message, printingrun ended without an assistant message; the model returned no outputto stderr. Previously an empty run exited 0, indistinguishable from a successful run.kilo runthat produces assistant output still exits 0.Changelog for maintainers
--format jsonit emits a finalerrorrecord with the same message instead of stderr.result.error) keeps its own error as the only reported cause; the empty-output diagnostic is suppressed so a failed request does not also claim a silent model.BadRequest, and the empty-output diagnostic must stay absent there.E2E proof