Finding: LibreChat-AI#16547, local review L-001 (local:7ee31e1:L-001).
useToolAutoExpand in client/src/components/Chat/Messages/Content/disclosure.ts reads the app-global autoExpandTools preference from ~/store via Recoil. The Client State Ownership rule in AGENTS.md says a feature that only consumes a shell preference should receive it through props or a host-supplied context.
This is not new reach. On canary, seven tool cards (ToolCall, WebSearch, RetrievalCall, CodeAnalyze, AskUserQuestionCall, useToolCallState, Wakeup) plus ToolCallGroup each call useRecoilValue(store.autoExpandTools) directly. PR 16547 folds the card reads into one hook and leaves the group-level reads alone.
Proposed change: supply the preference from the message host (for example next to SoleToolContext) and have useToolAutoExpand read it from context, then migrate Wakeup and ToolCallGroup the same way. Touches every tool card and MessageParts, so it does not belong in a single-tool-group bug fix.
Depends on the root PR because useToolAutoExpand only exists on its branch.
Finding: LibreChat-AI#16547, local review L-001 (local:7ee31e1:L-001).
useToolAutoExpandinclient/src/components/Chat/Messages/Content/disclosure.tsreads the app-globalautoExpandToolspreference from~/storevia Recoil. The Client State Ownership rule in AGENTS.md says a feature that only consumes a shell preference should receive it through props or a host-supplied context.This is not new reach. On canary, seven tool cards (ToolCall, WebSearch, RetrievalCall, CodeAnalyze, AskUserQuestionCall, useToolCallState, Wakeup) plus ToolCallGroup each call
useRecoilValue(store.autoExpandTools)directly. PR 16547 folds the card reads into one hook and leaves the group-level reads alone.Proposed change: supply the preference from the message host (for example next to
SoleToolContext) and haveuseToolAutoExpandread it from context, then migrate Wakeup and ToolCallGroup the same way. Touches every tool card andMessageParts, so it does not belong in a single-tool-group bug fix.Depends on the root PR because
useToolAutoExpandonly exists on its branch.