Repository navigation
Description
Description
When using a Qwen3-family model that streams thinking tokens via a non-standard delta.reasoning SSE field, Docker Agent's stream processor terminates in < 1ms and produces an empty response (tool_calls=0, content_length=0, stopped=true). The agent never executes any tool calls and returns no output.
Expected Behavior
The agent calls list_directory and returns the result.
Actual Behavior
The stream completes in < 1ms with no output:
level=DEBUG msg="OpenAI chat completion stream created successfully" model=Qwen3.5-397B-A17B
level=DEBUG msg="Processing stream" agent=root model=ovhcloud/Qwen3.5-397B-A17B
level=DEBUG msg="Stream processed" agent=root tool_calls=0 content_length=0 stopped=true
level=DEBUG msg="Skipping empty assistant message (no content and no tool calls)" agent=root
level=DEBUG msg="Conversation stopped" agent=root
Steps to Reproduce
Detailed steps to reproduce the bug:
- create a reproducer.yml file:
providers:
ovhcloud:
api_type: openai_chatcompletions
base_url: https://oai.endpoints.kepler.ai.cloud.ovh.net/v1
token_key: OVH_AI_ENDPOINTS_ACCESS_TOKEN
models:
ovh-qwen:
provider: ovhcloud
model: Qwen3.5-397B-A17B
temperature: 0.6
agents:
root:
model: ovh-qwen
instruction: |
You are a helpful assistant.
toolsets:
- type: filesystemℹ️ This is reproducible without an API key, OVHcloud AI Endpoints offers free access to this model at 2 req/s. ℹ️
- run
docker agent run reproducer.yml "List the files in the current directory"
Environment
- Docker Agent version: v1.79.0
- OS: macOS Darwin 25.5.0
- Provider: api_type: openai_chatcompletions (OVHcloud AI Endpoints)
- Model: Qwen3.5-397B-A17B
Error Output
level=DEBUG msg="OpenAI chat completion stream created successfully" model=Qwen3.5-397B-A17B
level=DEBUG msg="Processing stream" agent=root model=ovhcloud/Qwen3.5-397B-A17B
level=DEBUG msg="Stream processed" agent=root tool_calls=0 content_length=0 stopped=true
level=DEBUG msg="Skipping empty assistant message (no content and no tool calls)" agent=root
level=DEBUG msg="Conversation stopped" agent=root
Screenshots
N/A
Additional Context
Qwen3-family models in thinking mode stream reasoning tokens via a non-standard delta.reasoning field before producing any content or tool calls:
{"choices":[{"index":0,"delta":{"role":"assistant","reasoning":"The user wants...","name":"assistant"}}]}
Confirmed via curl: the model correctly outputs standard delta.tool_calls eventually, but only after all delta.reasoning chunks are done. Docker Agent's stream processor appears to fail silently on the unknown delta.reasoning field, terminating the stream before any tool calls or content is produced.
The standard delta.tool_calls format produced by the model is correct:
{"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"chatcmpl-tool-xxx","type":"function","function":{"name":"list_directory","arguments":""}}]}}]}
Activity
fix(providers): consume delta.reasoning in chat-completions stream ad…
philippart-s commentedon Jun 25, 2026
Hi,
I think the issue is not fixed, with the simple reproducer I have posted, issue is still here with 1.86 version.
Here is a log analyze (by AI):
And some logs:
aheritier commentedon Jun 25, 2026
@Sayt-0 can you check please?
Sayt-0 commentedon Jun 25, 2026
It worked for me when I applied the fix, but np I'll check !
Sayt-0 commentedon Jun 25, 2026
@philippart-s @aheritier
Dug into this. Breakdown:
reasoning_contentdropped on parsereasoning_content+reasoningsince v1.82+WithNoThinking()was a no-op for third-party thinking models, so title-gen burned its 20-token budget on reasoningThe empty main turn comes from the model/provider, not from docker agent. It happens when:
length)[DONE]stream)In all three the response is genuinely empty on the wire, so there's nothing for docker agent to turn into a reply. It now shows a warning instead of stopping silently.
The fix we did do (title-gen):
chat_template_kwargs.enable_thinking=false+ floors max_tokensTested with Qwen3 locally:
qwen3:4B) via Docker Model Runner end-to-end, and replayed the exact title-gen request against local llama.cpp (returns a non-empty title)enable_thinking=false, max_tokens floored, sampling opts kept, nothing injected on a normal turncontentinstead ofreasoning_contentCan open a PR for the title-gen fix if this looks right.
aheritier commentedon Jun 26, 2026
@philippart-s do want to have a call to demo the issue on your side ?
philippart-s commentedon Jun 26, 2026
@aheritier Yes, for sure! Shall we discuss it via DM?
fix(runtime): treat whitespace-only turns as no-output to avoid re-en…
Merge pull request #3327 from docker/fix/3145-surface-empty-reasoning…
fix(runtime): surface empty/reasoning-only turns instead of failing s…
fix(openai): merge consecutive system messages on the chat-completion…
feat: add OVHcloud AI Endpoints provider support
feat: add Together AI as a supported model provider
fix(runtime): stop content-only turns that end with a bare EOF