Repository navigation
fix(console): terminate converted chat streams - #43707
dajiaohuang wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #40210: fix(console): emit complete Responses-API SSE lifecycle for converted streams Why it's related: This PR addresses a similar issue with the Responses-to-Chat stream converter, specifically handling the SSE lifecycle for converted streams. Both PRs focus on properly terminating and completing chat stream conversions, though this one (PR #40210) appears to be an earlier or related attempt at fixing stream termination behavior. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #43379
Type of change
What does this PR do?
The Responses-to-Chat stream converter emitted a final Chat Completions chunk with finish_reason null when the upstream Responses stream ended with response.completed, then closed without the Chat SSE [DONE] terminator.
This change treats that explicit completion event as terminal, preserving known provider stop reasons and otherwise choosing tool_calls when the completed response contains a function call or stop for text output. It appends [DONE] only for completed OpenAI Responses streams converted to OpenAI-compatible Chat Completions. It does not infer completion from a bare EOF.
How did you verify your code works?
Screenshots / recordings
N/A - server-side streaming fix.
Checklist