Skip to content

📦 refactor: Move the Generation Run Atoms Into the Chat Package - #17140

Merged
berry-13 merged 1 commit into
devfrom
refactor/chat-generation-atoms
Oct 15, 2026
Merged

berry-13 merged 1 commit into
devfrom
refactor/chat-generation-atoms

Conversation

@berry-13

Copy link
Copy Markdown
Collaborator

Pull Request

Before submitting, please review the Contributing Guide.

Documentation changes belong in the LibreChat documentation repository.

Summary

The pane run atoms (submissionStartFamily for the elapsed indicator, showStopButtonByIndex, abortScrollFamily) are already Jotai, but they live in the app store (client/src/store/generation.ts), so every chat hook and component that reads them still imports from ~/store, which the chat package is meant to stop doing.

This moves them into the chat package's React entry (packages/chat/src/react/generation.ts, exported from @librechat/chat/react) with their spec, and points every consumer at it: the SSE and chat hooks, useClearStates, ChatForm, Elapsed and their specs. jotai becomes a peer (and dev) dependency of @librechat/chat, as the React bindings need. The abort-scroll latch drops its debug log line, since the package has no access to the app logger; nothing else changes.

Type of change

  • Refactor

Testing

Tested environments/configuration:

Not applicable: same atoms, same defaults, same writes; only where they are declared moves.

Automated tests:

  • generation.spec.ts moved to packages/chat/src/react/__tests__/ unchanged (3 pass).
  • In client: hooks/SSE, hooks/Chat, hooks/Config, Elapsed and the ChatForm specs: 64 suites, 1,661 tests pass.
  • npx tsc --noEmit in packages/chat and client, eslint, prettier, sort-imports: clean. The lockfile change is the two jotai entries for @librechat/chat only, with no internal registry URLs.

Screenshots / recordings

No user-facing change.

Risk / compatibility

#17121 adds the same jotai peer and dev entries to @librechat/chat; the lines are identical, so whichever lands second merges cleanly or keeps one copy.

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors

Copilot AI balanced review requested due to automatic review settings October 15, 2026 07:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T17:21:29.108488Z 0a83da8 New commits
🔒 Security Review ✅ Completed 2026-10-15T07:45:52.527475Z 72b0962 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codegraph-librechat codegraph-librechat Bot added the 🗺️ Chat State codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) label Oct 15, 2026
@berry-13
berry-13 force-pushed the refactor/chat-generation-atoms branch from 72b0962 to 956c7ab Compare October 15, 2026 16:09
@berry-13
berry-13 force-pushed the refactor/chat-generation-atoms branch from 956c7ab to 0a83da8 Compare October 15, 2026 17:19
@berry-13
berry-13 merged commit 25ecf9e into dev Oct 15, 2026
39 checks passed
@berry-13
berry-13 deleted the refactor/chat-generation-atoms branch October 15, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗺️ Chat State codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants