qwen-code/packages
Gordon Lam 309b25d256
fix(openai): when samplingParams is set, pass it through verbatim (#3458)
Previously pipeline.ts always hardcoded max_tokens as the output-token parameter name on the OpenAI-compatible path, falling back from samplingParams.max_tokens to request.config.maxOutputTokens to provider defaults. This broke GPT-5 / o-series on OpenAI and Azure OpenAI, which require max_completion_tokens and reject max_tokens with a 400 error.

Fix: when the user provides samplingParams explicitly, treat it as the complete source of truth for the wire shape and pass its keys through verbatim. No client-injected defaults, no request fallbacks, no hardcoded parameter names. The user describes what the provider wants; the client trusts them.

When samplingParams is absent, the historical default behavior (request fallback through temperature/top_p/.../max_tokens plus provider defaults) is preserved unchanged — existing users see no difference.

Concretely, users can now set any of:

  samplingParams: { max_tokens: 4096 }                # GPT-4 / Qwen / DeepSeek

  samplingParams: { max_completion_tokens: 4096 }    # GPT-5 / o-series

  samplingParams: { reasoning_effort: 'medium' }     # future knobs

without waiting for a qwen-code release that adds model-specific branches.

Signed-off-by: Gordon Lam (SH) <yeelam@microsoft.com>
2026-04-21 21:47:36 +08:00
..
channels fix(weixin): check full 4-byte PNG magic signature (#2970) 2026-04-18 09:32:58 +08:00
cli fix(editor): detect Zed.app on macOS when CLI is not in PATH (#3303) 2026-04-21 17:06:58 +08:00
core fix(openai): when samplingParams is set, pass it through verbatim (#3458) 2026-04-21 21:47:36 +08:00
sdk-java Fix typo in class name (#2189) 2026-04-18 11:59:36 +08:00
sdk-typescript fix(sdk): settle pending next() promise in Stream.return() to prevent hangs (#2981) 2026-04-18 09:46:56 +08:00
vscode-ide-companion fix(cli): rework session recap rendering and add blur threshold setting (#3482) 2026-04-21 14:39:13 +08:00
web-templates fix: display (#2766) 2026-04-19 15:25:29 +08:00
webui feat(webui): render markdown in generic and web-fetch tool outputs (#3469) 2026-04-21 15:53:32 +08:00
zed-extension chore(zed-extension): update package version to 0.10.0 2026-02-06 14:26:01 +08:00