🧹 refactor: Keep Store Imports Out of the Chat Hooks - #16620
Merged
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. |
berry-13
force-pushed
the
berry-13/chat-store-free-hooks
branch
from
October 1, 2026 14:14
23f6bcb to
16292ae
Compare
berry-13
added this pull request to stack #16629
October 1, 2026 15:23
The app's message parts host reads the stores, so it moves from hooks/Chat/parts to Providers/MessagePartsHostContext, beside ChatSettingsContext. The PTC trace types move to common, and PendingSteer joins the queue types in hooks/Chat/queue, so the chat contract names no store module.
berry-13
force-pushed
the
berry-13/chat-store-free-hooks
branch
from
October 1, 2026 15:47
16292ae to
71b25a9
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
#16591 put the app's message-parts host implementation in
client/src/hooks/Chat/parts.tsx. That implementation reads the Recoil and Jotai stores. #16591 also made the chat contract import two types from~/store. Together they added two files to the chat-hook store-import count that the audit tracks as chat criterion C1 (25 to 27 files).This PR moves the host implementation to
client/src/Providers/MessagePartsHostContext.tsx, besideChatSettingsContext, where host-side code that reads the app store already lives. The parts import it from the new path. The PTC trace types move fromstore/ptctocommon/ptc.PendingSteerjoins the queue types inhooks/Chat/queue, because it is chat-owned steer state. The chat contract now imports no store module, and C1 is back to 25. Runtime behavior is unchanged.Third link of the
chat-ownersstack, on top of #16604.Type of change
Testing
Tested environments/configuration:
reviewctl verify(desktop light, desktop dark, mobile).Automated tests:
npx jest --findRelatedTests <changed files> --maxWorkers=2: 500 suites, 6653 tests.npx tsc --noEmit -p client/tsconfig.json: clean. ESLint and Prettier: clean.parts-context.shstays at 1 of 46.Screenshots / recordings
No user-facing change.
Risk / compatibility
These are type and module moves only.
store/familiesimportsPendingSteertype-only from the chat feature, which is erased at build time, so no runtime cycle forms.Checklist