Repository navigation
🧱 refactor: Read Message Content Siblings Through the Parts Host - #17171
Merged
Merged
Conversation
berry-13
marked this pull request as ready for review
October 15, 2026 17:54
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. |
5 tasks done
berry-13
added this pull request to stack #17183
October 16, 2026 13:03
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
The message part components read the app only through
MessagePartsHost, but their siblings incomponents/Chat/Messages/Contentstill reached for Recoil,~/store,useMessageContextanduseToastContextdirectly: 16 of 115 files. A sibling that reads app state that way cannot move into@librechat/chatwith the parts, and it ignores whatever host the view supplied.This routes nine of them through the host.
MarkdownComponents,SiblingHeader,MessageContent,Markdown,BackgroundTaskCardandhydrationread the message, user, toast, user-text preferences and LaTeX setting fromuseMessagePartsHost(). For that,MessagePartMessagegains the optionalconversationIdandpartIndexthe app's message context already carries,MessagePartsUsergainsid, and the host gainsuseLaTeXParsing.ApprovalContextreads the ephemeral agent fromChatSettings, which already exposes the same Recoil reader. The two benches only swap their inlineRecoilRootfor anAppStoreswrapper inclient/test/harness.tsx; that is a harness-only change.The remaining siblings follow in two stacked PRs, and
ActivityPhaseGroupwaits for #17138.Type of change
Testing
Tested environments/configuration:
Local jest and typecheck; no runtime configuration matters for this change.
Automated tests:
cd client && npx jest src/components/Chat/Messages src/components/Chat/Input src/hooks/Input src/components/Chat/Subagents src/components/Share src/Providers: 201 suites, 3,729 tests pass.cd packages/chat && npx jest: 36 suites, 388 tests pass; every host fixture carries the new member.npx jest --runInBand --coverage=false --testMatch '**/ContentParts.bench.tsx', and the same forMarkdownBlocks.bench.tsx): 2 and 3 cases pass.npx tsc --noEmitforclientandpackages/chat, and the package build, are clean. ESLint, Prettier and import sorting are clean on every changed file.parts-context.shoverMessages/Contentreports 7 of 115 files (from 16), and 0 of 44 underParts.Screenshots / recordings
No user-facing change.
Risk / compatibility
Low. Each new read is the same store or context the component read before, through the app's host.
useResumeSubmitnow takesgetEphemeralAgentfromChatSettings, which every caller has above it underroutes/Root.tsx.Checklist