Skip to content

🚚 refactor: Move the Steering Hooks into the Chat Package - #17158

Open
berry-13 wants to merge 2 commits into
devfrom
refactor/chat-steer-move
Open

berry-13 wants to merge 2 commits into
devfrom
refactor/chat-steer-move

Conversation

@berry-13

Copy link
Copy Markdown
Collaborator

Summary

With their state in the package and their app services behind the steer host, the steering hooks no longer need the app. This moves them into @librechat/chat: hooks/Chat/steering/*, useSteering, useSteerCancel, useSteerConvert and useSteerEscalate now live in packages/chat/src/react/steering/ with no ~/ imports, exported from @librechat/chat/react, and every client consumer (the composer, the queue rail, the during-run send button, the pending steers, the chat helpers, the stream binding, composer restore and the specs) imports them from the package. No client re-export is left behind for these hooks.

Package rules shape two small changes: every exported hook now declares its return type (SteeringControls, QueueRows, SteerChips and friends), as the package's isolated declarations require, and the composer's attachment type is a structural ComposerFile the hooks stay generic over, so the app keeps passing its own richer file type. uuid becomes a peer dependency of the package, at the version the app already resolves. Behaviour is unchanged.

Part of the stack that moves the steer hooks into the chat package; base is the previous link. The run-end hooks still blocked on the submitting flag move after #17121.

Type of change

  • Refactor

Testing

Tested environments/configuration:

Local jest and typecheck; no runtime configuration matters for this change.

Automated tests:

  • cd packages/chat && npx jest: 232 tests pass.
  • cd client && npx jest src/hooks/Chat/__tests__ src/components/Chat src/hooks/SSE src/hooks/Input src/routes: 5,065 tests pass. The integration specs stay in the client and exercise the package hooks through the app's steer host; module mocks of the moved hooks now partially mock @librechat/chat/react.
  • npx tsc --noEmit for client and packages/chat, and the package build: clean. ESLint, Prettier and import sorting clean on every changed file; the lockfile change is the two uuid entries and contains no internal registry URLs.

Screenshots / recordings

No user-facing change.

Risk / compatibility

Low. The moved code is the same code with relative imports; ids still come from uuid v4 rather than crypto.randomUUID, which an insecure (plain HTTP) context does not provide.

Checklist

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

@berry-13
berry-13 marked this pull request as ready for review October 15, 2026 15:46
@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-16T13:18:13.425339Z ac50fd7 New commits
🔒 Security Review ✅ Completed 2026-10-15T15:49:29.087847Z 43a343a Draft marked ready
ℹ️ 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-steer-move branch from 43a343a to aee8843 Compare October 15, 2026 16:07
@berry-13
berry-13 added this pull request to stack #17157 October 15, 2026 16:23
@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 15, 2026 17:30
@berry-13
berry-13 force-pushed the refactor/chat-steer-move branch from aee8843 to 3b1331c Compare October 15, 2026 17:30

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.

@berry-13
berry-13 force-pushed the refactor/chat-steer-move branch from 3b1331c to ac50fd7 Compare October 16, 2026 13:14
@github-actions

Copy link
Copy Markdown
Contributor

Lighthouse CI failed. The last 80 log lines contain the measured budgets and assertion failures.


[WebServer] 2026-10-16 13:16:28 info: [GenerationJobManager] Configured with in-memory stores

[WebServer] 2026-10-16 13:16:28 info: HTTP server timeout configuration

[WebServer] 2026-10-16 13:16:28 info: Server listening at http://localhost:3080

[WebServer] 2026-10-16 13:16:28 info: [MCPServersRegistry] Creating new instance

[WebServer] 2026-10-16 13:16:28 info: OAuth reconnect manager initialized successfully.

[WebServer] 2026-10-16 13:16:28 info: Created collection: projects

🤖: global setup has been started
🤖: using baseURL http://localhost:3080
🤖: using E2E user: testuser@example.com
🤖: 🗝  authenticating user: testuser@example.com
🤖: ✔️  localStorage: set Nav as Visible /home/runner/work/LibreChat/LibreChat/e2e/storageState.json
[WebServer] 2026-10-16 13:16:30 info: [agent-triggers] durable delivery engine started

[WebServer] 2026-10-16 13:16:31 info: [schedules] engine started

[WebServer] 2026-10-16 13:16:31 info: Server readiness checks passing.

🤖: ✔️  user successfully registered
[WebServer] 2026-10-16 13:16:35 info: [Login] [Login successful] [Username: [REDACTED_EMAIL]] [Request-IP: ::1] {"requestId":"b97321de-0c48-405f-b9c2-5cad934158ae","request_id":"b97321de-0c48-405f-b9c2-5cad934158ae","request_method":"POST","request_path":"/api/auth"}

🤖: ✔️  user successfully authenticated
🤖: ✔️  authentication state successfully saved in /home/runner/work/LibreChat/LibreChat/e2e/storageState.json
🤖: global setup has been finished

Running 1 test using 1 worker

[1/1] [chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets
[chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets
Lighthouse run 1/3 wrote /home/runner/work/LibreChat/LibreChat/.lighthouse/lhr-1.report.json

Lighthouse run 2/3 wrote /home/runner/work/LibreChat/LibreChat/.lighthouse/lhr-2.report.json

Lighthouse run 3/3 attempt 1 did not complete, retrying: Command failed: /opt/hostedtoolcache/node/24.16.0/x64/bin/node /home/runner/work/LibreChat/LibreChat/node_modules/lighthouse/cli/index.js http://localhost:3080/c/16390000-0000-4000-8000-000000000001 --quiet --preset=desktop --throttling-method=provided --only-categories=performance --chrome-flags=--headless=new --extra-headers={"Cookie":"token_provider=librechat; refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhZDIyM2FmNGEyNDUwYzUzNzA1M2ExZSIsInNlc3Npb25JZCI6IjZhZDIyM2I3NGEyNDUwYzUzNzA1M2E0NSIsImlzc3VlZEF0TXMiOjE3OTIxNTY1OTk1NjgsImlhdCI6MTc5MjE1NjU5OSwiZXhwIjoxNzkyMTYwMTk4fQ.YyT3yJ1zXrV4PH1-Uei7Ss3t93yLk-NJU7V-uJuZ-38; session_hint=1792160199567~%3A6ad223af4a2450c537053a1e"} --output=json --output=html --output-path=/home/runner/work/LibreChat/LibreChat/.lighthouse/lhr-3

  1) [chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets 

    Error: Command failed: /opt/hostedtoolcache/node/24.16.0/x64/bin/node /home/runner/work/LibreChat/LibreChat/node_modules/lighthouse/cli/index.js http://localhost:3080/c/16390000-0000-4000-8000-000000000001 --quiet --preset=desktop --throttling-method=provided --only-categories=performance --chrome-flags=--headless=new --extra-headers={"Cookie":"token_provider=librechat; refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhZDIyM2FmNGEyNDUwYzUzNzA1M2ExZSIsInNlc3Npb25JZCI6IjZhZDIyM2I3NGEyNDUwYzUzNzA1M2E0NSIsImlzc3VlZEF0TXMiOjE3OTIxNTY1OTk1NjgsImlhdCI6MTc5MjE1NjU5OSwiZXhwIjoxNzkyMTYwMTk4fQ.YyT3yJ1zXrV4PH1-Uei7Ss3t93yLk-NJU7V-uJuZ-38; session_hint=1792160199567~%3A6ad223af4a2450c537053a1e"} --output=json --output=html --output-path=/home/runner/work/LibreChat/LibreChat/.lighthouse/lhr-3
    Runtime error encountered: Something went wrong with recording the trace over your page load. Please run Lighthouse again. (NO_NAVSTART)


    attachment #1: screenshot (image/png) ──────────────────────────────────────────────────────────
    e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/test-failed-1.png
    ────────────────────────────────────────────────────────────────────────────────────────────────

    Error Context: e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/error-context.md

    attachment #3: trace (application/zip) ─────────────────────────────────────────────────────────
    e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/trace.zip
    Usage:

        npx playwright show-trace e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/trace.zip

    ────────────────────────────────────────────────────────────────────────────────────────────────


🤖: global teardown has been started
2026-10-16 13:18:56 �[32minfo�[39m: �[32mMongo Connection options�[39m
2026-10-16 13:18:56 �[32minfo�[39m: �[32m{�[39m
�[32m  "bufferCommands": false�[39m
�[32m}�[39m
🤖:  ✅  Connected to Database
🤖:  ✅  Found user in Database
🤖:  ✅  Deleted 1 convos & 2 messages
🤖:  ✅  Deleted user from Database
🤖: global teardown has been started
2026-10-16 13:18:56 �[32minfo�[39m: �[32mMongo Connection options�[39m
2026-10-16 13:18:56 �[32minfo�[39m: �[32m{�[39m
�[32m  "bufferCommands": false�[39m
�[32m}�[39m
🤖:  ✅  Connected to Database
🤖:  ⚠️  User not found in Database
  1 failed
    [chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets 

Open the full run

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