Upstream PR: LibreChat-AI#16547 (local review finding local:12d6bf8:L-002, convention).
The tool cards in client/src/components/Chat/Messages/Content read the app-global autoExpandTools preference straight from the Recoil store (useToolAutoExpand in disclosure.ts, plus ToolCallGroup.tsx and Wakeup.tsx). The client state ownership rule in AGENTS.md asks for app-global preferences to be passed into a feature through props or a host-supplied context instead of reached for through ~/store.
The PR only centralizes the existing read into one hook; it adds no new store consumer. Moving the preference to a host-supplied context (provided by MessageParts.tsx and ContentRender.tsx, which already read it for foldLiveActivity) is a separate refactor that touches both entry points.
Acceptance: no file under Content/ imports ~/store for autoExpandTools; the two hosts supply the value through one context; existing jest suites for ToolCallGroup, ContentParts and LiveParity pass unchanged.
Upstream PR: LibreChat-AI#16547 (local review finding local:12d6bf8:L-002, convention).
The tool cards in client/src/components/Chat/Messages/Content read the app-global
autoExpandToolspreference straight from the Recoil store (useToolAutoExpand in disclosure.ts, plus ToolCallGroup.tsx and Wakeup.tsx). The client state ownership rule in AGENTS.md asks for app-global preferences to be passed into a feature through props or a host-supplied context instead of reached for through~/store.The PR only centralizes the existing read into one hook; it adds no new store consumer. Moving the preference to a host-supplied context (provided by MessageParts.tsx and ContentRender.tsx, which already read it for foldLiveActivity) is a separate refactor that touches both entry points.
Acceptance: no file under Content/ imports
~/storefor autoExpandTools; the two hosts supply the value through one context; existing jest suites for ToolCallGroup, ContentParts and LiveParity pass unchanged.