Skip to content

fix(commandcode): force params.stream=true for non-streaming requests#1843

Open
0xSkybreaker wants to merge 1 commit into
decolua:masterfrom
0xSkybreaker:fix/commandcode-non-streaming
Open

fix(commandcode): force params.stream=true for non-streaming requests#1843
0xSkybreaker wants to merge 1 commit into
decolua:masterfrom
0xSkybreaker:fix/commandcode-non-streaming

Conversation

@0xSkybreaker

Copy link
Copy Markdown

Summary

Fixes #1840 — CommandCode handler fails on all non-streaming requests.

Root Cause

The CommandCode /alpha/generate API requires stream=true unconditionally. When requests arrive with stream: false, the API returns HTTP 400 ("expected true at params.stream") or ECONNRESET.

While chatCore.js already forces stream=true for the commandcode provider, the executor's transformRequest only set body.stream = true (top-level field). In already-translated CommandCode-native bodies, the stream flag lives at body.params.stream, which was left as false.

Fix

Updated transformRequest in CommandCodeExecutor to also set body.params.stream = true when the body has a params wrapper — covering both OpenAI-format and CommandCode-format bodies.

Testing

The fix is defensive: params.stream is set to true regardless of which body format arrives at the executor, ensuring the CommandCode API always receives stream: true.

🤖 Generated with Claude Code

@
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
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.

CommandCode handler fails on all non-streaming requests: stream=false causes 400/ECONNRESET

1 participant