Files
OmniRoute/open-sse/executors
Diego Rodrigues de Sa e Souza 3c3dcadd4c fix(executors): strip stream_options for qwen non-streaming / thinking Claude Code requests (port from 9router#663) (#4374)
Claude-Code-compatible providers force the executor-level `stream` flag on
via `upstreamStream = stream || isClaudeCodeCompatible`
(open-sse/handlers/chatCore.ts), but the outgoing body keeps the caller's
original `stream: false`. The shared `stream && targetFormat === "openai"`
branch in DefaultExecutor.transformRequest then injected
`stream_options: { include_usage: true }` onto a body that still said
`stream: false`, and qwen upstream rejected the request with
`400 "'stream_options' only set this when you set stream: true"`. The same
rejection surfaced when the body carried `thinking` / `enable_thinking`.

The qwen branch now skips the injection (and strips any client-sent
`stream_options`) when the body explicitly says `stream: false` or
requests thinking, leaving regular qwen streaming requests with the
include_usage injection intact. Other providers are unaffected.

Adds a TDD regression with 4 cases covering both opt-out paths and the
normal-streaming positive control.


Inspired-by: https://github.com/decolua/9router/pull/663

Co-authored-by: anuragg-saxenaa <anuragg.saxenaa@gmail.com>
2026-06-20 11:05:24 -03:00
..
2026-06-10 13:49:08 -03:00
2026-06-20 07:09:43 -03:00
2026-06-17 02:43:21 -03:00
2026-06-17 19:26:32 -03:00
2026-06-17 19:26:32 -03:00
2026-06-07 07:20:02 -03:00
2026-05-23 01:46:59 -03:00
2026-06-10 13:49:08 -03:00
2026-05-29 12:44:29 -03:00
2026-06-20 07:09:43 -03:00
2026-05-24 18:05:58 -03:00
2026-05-29 12:44:29 -03:00
2026-06-10 13:49:08 -03:00
2026-06-20 07:09:43 -03:00
2026-06-19 06:49:01 -03:00
2026-05-29 12:44:29 -03:00
2026-06-11 18:52:29 -03:00
2026-06-20 07:09:43 -03:00
2026-05-24 18:05:58 -03:00
2026-05-29 12:44:29 -03:00
2026-06-20 07:09:43 -03:00
2026-06-20 07:09:43 -03:00
2026-05-26 23:51:47 -03:00
2026-06-17 02:43:21 -03:00
2026-06-17 02:43:21 -03:00
2026-05-29 12:44:29 -03:00
2026-05-29 12:44:29 -03:00
2026-06-20 07:09:43 -03:00
2026-06-10 13:49:08 -03:00
2026-06-12 23:49:22 -03:00
2026-05-24 18:05:58 -03:00
2026-06-09 15:56:24 -03:00
2026-05-29 12:44:29 -03:00
2026-05-29 12:44:29 -03:00
2026-06-10 13:49:08 -03:00
2026-06-16 01:00:40 -03:00
2026-06-16 01:00:40 -03:00
2026-05-26 23:51:47 -03:00