Skip to content

fix(openai): read vllm reasoning deltas#2354

Merged
pgrayy merged 1 commit into
strands-agents:mainfrom
he-yufeng:fix/openai-vllm-reasoning
May 28, 2026
Merged

fix(openai): read vllm reasoning deltas#2354
pgrayy merged 1 commit into
strands-agents:mainfrom
he-yufeng:fix/openai-vllm-reasoning

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

Fixes #2182.

OpenAI-compatible vLLM streams can emit reasoning text on delta.reasoning instead of the older delta.reasoning_content field. The OpenAI adapter now accepts both fields and still prefers the existing reasoning_content path when present.

Changes

  • Read non-empty string reasoning from delta.reasoning_content or delta.reasoning.
  • Keep existing text/tool streaming behavior unchanged.
  • Add regression coverage for a vLLM-style delta.reasoning stream.

To verify

Run from strands-py:

uv run pytest tests/strands/models/test_openai.py -q --basetemp .tmp/pytest-2182 -p no:cacheprovider
uv run ruff check src/strands/models/openai.py tests/strands/models/test_openai.py
python -m py_compile src/strands/models/openai.py tests/strands/models/test_openai.py
git diff --check

Local result on Windows: 96 passed.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread strands-py/src/strands/models/openai.py
@pgrayy pgrayy merged commit 5c22068 into strands-agents:main May 28, 2026
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] OpenAIModel ignores vLLM reasoning field (delta.reasoning / message.reasoning)

3 participants