feat: the thinking channel, stored, streamed and shown (reasoning support Parts A and C) - #423
Merged
Merged
Conversation
…port Parts A and C)
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.
What
The remaining two parts of the owner-approved reasoning design (Part B shipped in #405). Governing principle throughout: thinking is a CHANNEL, not content — displayed live and afterwards, never captured, cited, verified, or evaluated.
Part A — the channel
ModelGateway.completeStreamnow yields channel-tagged deltas ({channel: 'thinking' | 'text', text}). The OpenAI-compatible adapter surfacesreasoning_content/reasoning/thinkingdeltas on the thinking channel (and a thinking delta arms the Part B headroom, so live chat traffic teaches the adapter too); Mistral yields text only; Anthropic mapsthinking_deltaalthough Cogeto never requests extended thinking. The four decorators follow the two approved rulings:A non-reasoning model yields the same bytes it always did, one field deeper, proven by test.
Part C — stored, streamed, shown
chat_message.thinking(nullable text, content-bearing). The answer-redaction cascade nulls it in the same UPDATE that overwrites a citing answer, because reasoning ABOUT an erased memory must not survive the citation that grounded it; row deletion takes it implicitly, receipts unchanged.thinkingSSE event interleaves withtokenevents; the chat UI renders a collapsed Thinking disclosure above the answer — streaming live, expandable, reopenable on stored answers, and rendering NOTHING when there is no thinking. Newchat:reasoning.*keys in all four locales.configurationForEmissionappends--reasoningto the trust-artifact id from the same probe the capability panel uses, in both harnesses identically so the partial-merge guard holds. Appended at emission and nowhere else, because whether a binding reasons is a runtime fact the static resolver cannot know. A Mistral-routed run probes off and emits the unchanged id — every existing artifact, gate and cached fixture is untouched, and no fixture refresh was needed (the eval-gate on this PR replays the committed cache as-is).Validation
Per the owner's instruction, no eval runs: unit and integration suites (1,104 tests green, including the new channel, strip, charge, persistence, cascade and marker tests) plus a live boot — migration 0044 applied, app and worker healthy,
reasoning ON | vision ON, chat streaming verified end-to-end through the SSE path in the integration suite.Docs:
docs/features/reasoning.md(the whole design in one place),capabilities.mdandCLAUDE.mdupdated; the resolver comment now points at the emission-time marker.Closes #420
Closes #421
Closes #422