Repository navigation
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Veld101
force-pushed
the
empty-length-failure
branch
from
October 12, 2026 14:30
5df55bb to
013ecd4
Compare
This was referenced Oct 14, 2026
This branch has not been deployed
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.
Issue for this PR
Closes #50949
Type of change
What does this PR do?
A provider can finish a Step normally with
finish_reason: "length"while streaming no text, no reasoning, and no tool call, and with zero output tokens. The publisher settled that Step as a success, so the turn ended with no message, no error, and a successful exit — indistinguishable from a valid empty answer, and impossible to diagnose from the TUI/CLI.Mirroring the existing
content-filterhandling, a normalizedlengthfinish with no streamed output now fails the Step with a visible error:Partial output is unaffected: a
lengthfinish that streamed any content keeps its normal settlement and visible text, and alengthfinish with tool calls still continues.specs/v2/session.mdis updated alongside.The error uses a new
provider.incompletetype.SessionError.Error.typeis a free-form string, so no schema change or client regeneration is required; the failure surfaces through the existing Step failure path with the finish reason in its message.How did you verify your code works?
bun test test/session-runner-tool-events.test.ts— 28 pass (3 new cases: emptylengthfails the step;lengthwith streamed text settles normally;lengthwith a tool call keeps continuation)bun test test/session-runner.test.ts test/session-step.test.ts test/session-runner-tool-events.test.ts— 252 pass / 0 fail (1 new end-to-end scenario asserting a visible terminal failure and nosession.step.ended)bun typecheckinpackages/core, andbun turbo typecheck --filter=@opencode/corebun run lint— 0 warnings / 0 errorsNote:
bun run checkcould not complete in my environment becausepackages/app/src/custom-elements.d.tsis a git symlink (mode 120000) that my Windows checkout materialized as a plain text file (core.symlinks=false), so@opencode/app#typecheckfails with TS1128. That is unrelated to this change and passes on a normal checkout;@opencode/coretypecheck passes.Screenshots / recordings
Not applicable; this is not a UI change.
Checklist