You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenRouter: streamed chunks carry reasoning only as delta.reasoning_content, not delta.reasoning #659
For OpenRouter (/api/v1/chat/completions), a fixture's reasoning is streamed only as choices[].delta.reasoning_content. OpenRouter's streaming API sends it as delta.reasoning. Non-streamed replies already mirror it into message.reasoning (dist/openrouter-chat.js), but streamed chunks don't.
Clients that read only OpenRouter's field miss the reasoning when streaming. For example, langchain-openrouter 0.3.0's ChatOpenRouter reads delta.reasoning.
Seen on 1.48.1 and 1.49.0.
Reproduce
aimock -p 4010 &
curl -s -X POST localhost:4010/__aimock/fixtures -H 'content-type: application/json' -d '{"fixtures": [ {"match": {"userMessage": "t2:", "model": "or"}, "response": {"content": "ANSWER", "reasoning": "I think."}}]}'
curl -sN -X POST localhost:4010/api/v1/chat/completions -H 'content-type: application/json' \
-d '{"model": "or", "stream": true, "messages": [{"role": "user", "content": "t2: hi"}]}'# deltas carry "reasoning_content": "I think." and no "reasoning"
ChatOpenRouter(model="or", base_url="http://localhost:4010/api/v1").stream("t2: hi") yields the answer with no reasoning.
Expected
Streamed OpenRouter chunks carry the reasoning as delta.reasoning, as the non-streamed replies already do in message.reasoning.
Good catch, thanks. Fixed in #663: the OpenRouter route now streams delta.reasoning and reasoning_details like the real API does. reasoning_content is still there, so nothing breaks for anyone reading it.
While we were in there we found recording had the same blind spot and was dropping OpenRouter reasoning from fixtures. That's fixed in #664. Both land in the next release.
Activity
fix(openrouter): stream reasoning as delta.reasoning
jpr5 commentedon Dec 4, 2026
Good catch, thanks. Fixed in #663: the OpenRouter route now streams
delta.reasoningandreasoning_detailslike the real API does.reasoning_contentis still there, so nothing breaks for anyone reading it.While we were in there we found recording had the same blind spot and was dropping OpenRouter reasoning from fixtures. That's fixed in #664. Both land in the next release.