mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-01 21:20:44 +00:00
When a model (e.g. Ollama qwen3.5:9b) returns a response with reasoning/thinking content but an empty text body, the assistant message was constructed with `content: null`. Some OpenAI-compatible providers (e.g. Ollama) reject such requests with HTTP 400 when reasoning_content is also present. Fix: in processContent(), when assistantTextContent is empty but reasoningParts is non-empty, use '' instead of null. Tool-call-only messages (no reasoning) retain `content: null` to stay spec-compliant. Adds three regression tests covering: - reasoning-only → content is '' - tool-call-only → content is null (OpenAI spec) - reasoning + text → content is the actual text Fixes #3421 |
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| vendor | ||
| index.ts | ||
| package.json | ||
| test-setup.ts | ||
| tsconfig.json | ||
| vitest.config.ts | ||