Skip to content

🧷 refactor: Split useResumeOnLoad by Responsibility - #17134

Open
berry-13 wants to merge 1 commit into
refactor/chat-resumable-bindingsfrom
refactor/chat-resume-on-load
Open

berry-13 wants to merge 1 commit into
refactor/chat-resumable-bindingsfrom
refactor/chat-resume-on-load

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

useResumeOnLoad.ts (1,087 lines) did four things in one hook: tracking runs the server owes a conversation (queued-turn receipts, the active-job list and the quiet-window latch), re-arming the resume check when such a run is announced or resumeStream asks, settling what a run that ended while the pane was away left behind, and building the resume submission itself. It also carried its own copies of the steer-chip seed and settle callbacks that useResumableSSE already had.

This splits it by responsibility in client/src/hooks/SSE/: useOwedSuccessor (the owed-run latch), useResumeAnnouncements (the re-arm on announcements and resume requests), and finished.ts (settling a finished run), with the steer chips taken from the shared useSteerChips instead of the duplicated callbacks. useResumeOnLoad.ts keeps the resume decision and is now 437 lines. No behavior changes. Stacked on #17133.

Type of change

  • Refactor

Testing

Tested environments/configuration:

Not applicable: the logic is moved, not changed; the two removed steer callbacks were line-for-line the shared ones.

Automated tests:

  • useResumeOnLoad.spec.tsx (3,100 lines) and the rest of the hooks/SSE and hooks/Chat specs plus data-provider/SSE, unchanged: 1148 pass.
  • npx tsc --noEmit in client, eslint, prettier and sort-imports on the changed files: clean.

Screenshots / recordings

No user-facing change.

Risk / compatibility

None.

Checklist

  • I reviewed my own changes
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors

@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-16T19:40:00.255446Z b860d82 New commits
🔒 Security Review ✅ Completed 2026-10-15T07:14:39.137101Z 6b607ba 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-resume-on-load branch from 6b607ba to e48fa80 Compare October 15, 2026 15:47
@berry-13
berry-13 added this pull request to stack #17153 October 15, 2026 16:13
@codegraph-librechat codegraph-librechat Bot added the 🗺️ Async Run Streaming codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) label Oct 15, 2026
Copilot AI balanced review requested due to automatic review settings October 16, 2026 19:38
@berry-13
berry-13 force-pushed the refactor/chat-resume-on-load branch from e48fa80 to b860d82 Compare October 16, 2026 19:38

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.

This branch has not been deployed

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

Labels

🗺️ Async Run Streaming codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) 🗺️ 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