feat(chat): render reasoning parts - #7139
Merged
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 42 |
TIP This summary will be updated as you push new changes.
More templates
algoliasearch-helper
instantsearch-ui-components
instantsearch.css
instantsearch.js
react-instantsearch
react-instantsearch-core
react-instantsearch-nextjs
react-instantsearch-router-nextjs
vue-instantsearch
commit: |
|
Size Change: +6.29 kB (+0.53%) Total Size: 1.2 MB 📦 View Changed
ℹ️ View Unchanged
|
anjola-adeuyi
marked this pull request as ready for review
July 27, 2026 09:26
anjola-adeuyi
requested review from
a team,
FabienMotte,
Haroenv and
afrencalg
and removed request for
a team
July 27, 2026 09:26
anjola-adeuyi
force-pushed
the
feat/fx-3831-chat-reasoning-rendering
branch
from
July 27, 2026 17:19
b39f438 to
6423637
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.
Summary
Adds opt-in rendering for Chat reasoning parts.
showReasoningdefaults tofalse. When enabled, reasoning keeps its original position among tool calls and answer text, collapsed by default. Only the active reasoning part shows progress.This PR does not change reconnect or reducer behavior.
Result
Enable reasoning in React:
Or InstantSearch.js:
Covered behavior:
parseMarkdownapplies consistently to text and reasoning partsReasoning parts
Each reasoning part is rendered as an independent, uncontrolled
<details>disclosure. It is collapsed by default, including while that part is still streaming; activity is signaled byaria-busyand the pulsing label. Nothing opens or closes it automatically, so a reader's choice survives reasoning ending, the answer starting and the response completing. This matches the shipped Agent Studio accordion, which is uncontrolled for the same reason.Additional behavior changes
getTextContentpreviously matched any part with a top-leveltextfield, including reasoning. Copy could therefore include reasoning text even whenshowReasoningwasfalse. It now includes text parts only and reasoning-only messages no longer show Copy.messagesProps.assistantMessagePropsormessagesProps.userMessagePropspreviously replaced the values assembled from the dedicated top-level leading and footer component props. They now merge key by key, so nested values override only matching keys while omitted dedicated components remain in effect.Scope
This narrows #7105 to the rendering required by FX-3831. It does not add summaries, PII heuristics, loading captions, additional visibility modes or a custom chat implementation.
vue-instantsearchhas no Chat component, so the cross-flavor suite runs JavaScript and React and skips Vue as it does for the rest of Chat.Known limit
Demo
Real Agent Studio stream using reasoning → Algolia Search tool → reasoning → final response.
reasoning.pr.mov