Skip to content

[upstream #16547] 16547: Supply autoExpandTools to tool cards through a host context instead of the Recoil store #213

Description

@berry-13

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: clientreviewctl followups statereadyreviewctl followups staterefactorreviewctl followups state

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions