Repository navigation
fix(provider): stream gateway reasoning_content as exposed thinking (RR8.2) - #199
Merged
lg2m merged 2 commits intoSep 28, 2026
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f2c0dd4ce4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
lg2m
force-pushed
the
fix/eng-954-rr8-gateway-reasoning
branch
from
September 26, 2026 19:00
f2c0dd4 to
ed8eb49
Compare
lg2m
force-pushed
the
fix/eng-954-rr8-gateway-reasoning
branch
2 times, most recently
from
September 26, 2026 19:55
365de0e to
f555920
Compare
…RR8.2) The Chat Completions codec ignored delta.reasoning_content, the field LiteLLM, OpenRouter, DeepSeek and vLLM use for exposed thinking. An all-thinking turn therefore looked empty to the runtime and the TUI, which is how 16 384-token reasoning turns hid behind 'output token limit' failures. The codec now frames the fragments as one ExposedThinking block (opened on the first fragment; closed by the first visible delta, finish reason, or [DONE]) and bounds the bytes like the Anthropic adapter does. Tests: decodes_gateway_reasoning_content_ahead_of_visible_content, streams_gateway_reasoning_as_one_block_closed_by_visible_output, an_all_reasoning_turn_cut_at_length_closes_its_block_before_incomplete. Linear: ENG-954
…ing (RR8.2 review) OpenRouter's normalized Chat Completions stream carries exposed thinking as `delta.reasoning`, not `delta.reasoning_content`; Serde silently dropped it, so reasoning-only OpenRouter turns still looked empty. Both spellings decode to the same reasoning delta (`reasoning_content` wins if a gateway sends both). Linear: ENG-954
lg2m
force-pushed
the
fix/eng-954-rr8-gateway-reasoning
branch
from
September 28, 2026 05:13
f555920 to
7ad1d6b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RR8.2: Chat Completions codec streams
reasoning_contentSpec: docs/plans/run-reliability.md (RR8) Linear: ENG-954 Stack: 2/4, on ENG-953
What changed
ChatDeltanow decodesreasoning_content(LiteLLM / DeepSeek / vLLM) andreasoning(OpenRouter); both are absent from OpenAI's own responses.ReasoningKind::ExposedThinkingblock: opened on the first fragment, closed by the first visible delta, finish reason, or[DONE]. Bytes count against the output bound like the Anthropic adapter.Incomplete, never an empty turn. This is what made the RR8.1 failure invisible.How verified
decodes_gateway_reasoning_content_ahead_of_visible_contentstreams_gateway_reasoning_as_one_block_closed_by_visible_output(loopback SSE)an_all_reasoning_turn_cut_at_length_closes_its_block_before_incomplete(the audited shape, with trailing usage)Docs
docs/design/providers.md§ reasoning effort.Compatibility
Evidence
Operator store, read-only: two
provider_output_truncatedruns onlitellm/us.anthropic.claude-fable-5-1(2026-09-23, 2026-09-25). Every failing turn persistedassistant_content_json = []withoutput_tokens = 16384; every continuation request hadinput_tokens = 2uncached (byte-identical resend). Route-wide since 09-10: 3 935 turns, 49 truncated, 31 empty, ≈ 671 k output tokens and ≈ 2 h wall producing nothing.Review round (Codex)
delta.reasoning; both spellings decode now.stopbefore[DONE](no observable difference); ledger entry lives on the stack tip (feat(delegation): choose a sub-agent's reasoning effort from its roster role (RR8.4) #201). Live LiteLLM qualification stays a recorded follow-up (cannot run in CI).Gates (run on the stack tip and on this branch's tip)
cargo fmt --all -- --check✅cargo clippy --workspace --all-targets --all-features -- -D warnings✅ (every branch tip)cargo test --workspace✅ all passing at the stack tip; each intermediate tip compiles and passesqq/qq-core/qq-provideron its own.cargo test -p qq-provider --no-default-features --features test-support✅ 184 passed.qq-clientbuild ✅