fix(commandcode): force params.stream=true for non-streaming requests#1843
Open
0xSkybreaker wants to merge 1 commit into
Open
fix(commandcode): force params.stream=true for non-streaming requests#18430xSkybreaker wants to merge 1 commit into
0xSkybreaker wants to merge 1 commit into
Conversation
fix(commandcode): force params.stream=true for non-streaming requests
The CommandCode /alpha/generate API requires stream=true unconditionally.
While chatCore.js already forces stream=true for commandcode provider,
the executor transformRequest only set body.stream (top-level), missing
body.params.stream in already-translated CommandCode-native bodies.
This caused HTTP 400 ("expected true at params.stream") or ECONNRESET
for ~58% of CommandCode requests where stream was explicitly false.
Closes decolua#1840
Co-Authored-By: Claude <noreply@anthropic.com>
@
bloodf
pushed a commit
to bloodf/9router
that referenced
this pull request
Jun 19, 2026
…am=true for non-streaming requests
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.
Summary
Fixes #1840 — CommandCode handler fails on all non-streaming requests.
Root Cause
The CommandCode
/alpha/generateAPI requiresstream=trueunconditionally. When requests arrive withstream: false, the API returns HTTP 400 ("expected true at params.stream") or ECONNRESET.While
chatCore.jsalready forcesstream=truefor the commandcode provider, the executor'stransformRequestonly setbody.stream = true(top-level field). In already-translated CommandCode-native bodies, the stream flag lives atbody.params.stream, which was left asfalse.Fix
Updated
transformRequestinCommandCodeExecutorto also setbody.params.stream = truewhen the body has aparamswrapper — covering both OpenAI-format and CommandCode-format bodies.Testing
The fix is defensive:
params.streamis set totrueregardless of which body format arrives at the executor, ensuring the CommandCode API always receivesstream: true.🤖 Generated with Claude Code