Skip to content

fix: stop empty unknown provider response loop (#51290) - #89

Open
kvnloo wants to merge 1 commit into
devfrom
fix/stream-empty-unknown
Open

kvnloo wants to merge 1 commit into
devfrom
fix/stream-empty-unknown

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Summary

Port of upstream tip anomalyco/opencode#51290 onto fork dev.

Closes #88

When a provider returns an empty response with finish reason unknown, record Provider returned an empty response, publish Session.Event.Error, and set session idle — no infinite assistant-turn loop.

Proof (fail→pass)

cd packages/opencode
bun test --timeout 30000 test/cli/run/run-process.test.ts -t "empty unknown"
# NEGATIVE (base prompt.ts + tip tests): 1 fail (exitCode was 0)
# GREEN (tip product + tip tests): 1 pass
# restore: 1 fail

Policy

  • github_writes_origin=0 (kvnloo fork only; upstream not touched)
  • Codex promote: parked

When a provider returns an empty response with finish reason unknown,
record an error, publish Session.Event.Error, and return the session to
idle instead of spinning new assistant turns forever.

Origin tip: anomalyco#51290
@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tip: stop empty unknown provider response loop (origin #51290)

1 participant