SIGN IN SIGN UP

fix(transform): stream reasoning correctly on the OpenRouter managed path (#111)

Now that managed wallet inference routes through OpenRouter, its reasoning
must actually stream. OpenRouter emits reasoning via its unified
`reasoning`/`reasoning_details` fields, but only when a `reasoning` object
is requested. Three gaps left managed reasoning blank:

- options() only set `reasoning:{effort}` for gemini-3. Request it for
  every reasoning-capable OpenRouter model (medium effort; gemini-3 high),
  so Claude/GPT/etc routed through OR stream their traces. A selected
  effort variant still overrides via mergeDeep in llm.ts.
- An OR-routed gpt-5 fell into the OpenAI-Responses block and got
  reasoningEffort/reasoningSummary/include — keys OR ignores — so it
  requested no reasoning in OR's shape and streamed an empty trace.
  Exclude the OR npm from that block.
- smallOptions() returned the OpenAI `reasoningEffort` key for OR gpt-5
  small calls (the gpt-5 check ran before the openrouter branch, which was
  therefore dead code). Check OpenRouter first and disable reasoning via
  OR's unified shape so title/summary/compaction don't reason or bill.

Direct OpenAI (BYOK and the openai-via-proxy edge) is unchanged.
A
Aayam Bansal committed
b91a212456d3a8eec552dcce3c4f5b455f9bfb88
Parent: 959eee4
Committed by GitHub <noreply@github.com> on 7/6/2026, 3:54:58 PM