Skip to content

⬆️ chore: Refresh Dependencies Within Their Majors and Clear the Fixable Audit Findings - #189

Merged
danny-avila merged 3 commits into
mainfrom
pr/deps-refresh
Oct 28, 2026
Merged

danny-avila merged 3 commits into
mainfrom
pr/deps-refresh

Conversation

@danny-avila

@danny-avila danny-avila commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request Template

⚠️ Before Submitting a PR, Please Review:

  • Please ensure that you have thoroughly read and understood the Contributing Docs before submitting your Pull Request.

⚠️ Documentation Updates Notice:

  • Kindly note that documentation updates are managed in this repository: librechat.ai

Summary

Brings every dependency up to the newest release inside its current major and clears every bun audit finding that can be fixed in this repo: 33 findings drop to 1. The one left is zod 3 inside librechat-data-provider, which only a new data-provider release can fix (see Held back).

The PR has two commits:

  1. ⬆️ the dependency refresh: package.json, bun.lock and three small source changes the new versions call for.
  2. 🎨 Prettier 3.9's formatting of src (bun run format). It only reformats; reviewing commit 1 on its own is enough.

What moved

Direct dependencies:

Package Before After
vite (and its override pin) 8.0.16 8.3.5
vitest, every @vitest/* 4.1.9 4.1.12
zod 4.4.3 4.6.7
react, react-dom 19.2.7 19.3.1
@types/react / @types/react-dom 19.2.17 / 19.2.3 19.3.0
tailwindcss, @tailwindcss/vite, @tailwindcss/node 4.3.1 4.3.3
@radix-ui/react-dialog (and override) 1.1.15 1.3.1
@tanstack/react-devtools (and override) 0.10.0 0.10.13
input-otp 1.4.2 1.5.0
styled-components 6.4.2 6.6.0
dayjs 1.11.21 1.11.23
i18next-browser-languagedetector 8.2.1 8.2.2
lodash (and lodash/lodash-es overrides) 4.18.0 4.18.1
mongoose (and override) 8.24.1 8.24.7
eslint 10.5.0 10.13.0
@typescript-eslint/eslint-plugin, @typescript-eslint/parser 8.61.1 8.72.0
eslint-plugin-import-x 4.16.2 4.17.1
eslint-plugin-tailwind-canonical-classes 1.3.3 1.6.0
prettier 3.8.4 3.9.10
prettier-plugin-tailwindcss 0.7.4 0.8.1
@playwright/test 1.61.0 1.64.1
@axe-core/playwright 4.11.3 4.14.0
@testing-library/dom / react / jest-dom 10.4.1 / 16.3.2 / 6.9.1 10.4.2 / 16.3.3 / 6.10.0
@types/node (stays on 22.x) 22.20.0 22.20.5
@types/bun 1.3.14 1.4.4

prettier-plugin-tailwindcss is the one 0.x package that leaves its minor. Its only breaking change is that it needs Prettier 3.7 or newer, and this PR moves Prettier to 3.9.10.

Override pins:

  • Moved with their packages. @radix-ui/react-dismissable-layer 1.1.11 → 1.2.1, so dialog and dismissable layer still resolve to one copy. @tanstack/devtools 0.11.0 → 0.15.0 and @tanstack/devtools-ui 0.5.1 → 0.7.1 follow react-devtools.
  • Moved to their newest patch. postcss 8.5.23 → 8.5.31 (Vite 8.3 requires ^8.5.30), browserslist 4.28.7 → 4.29.4, baseline-browser-mapping 2.11.0 → 2.11.32, katex 0.18.2 → 0.18.11, nanoid 3.3.18 → 3.3.20, ws 8.21.0 → 8.22.0 and yaml 2.8.3 → 2.9.1.
  • Dropped. undici: no package in the tree depends on it.
  • Unchanged. The TanStack router/start set stays at 1.169.4's versions, along with seroval, srvx and solid-js.

The tree was resolved with a one-day release-age floor (bun install --minimum-release-age=86400), so nothing published in the previous 24 hours came in. That held i18next-browser-languagedetector at 8.2.2, baseline-browser-mapping at 2.11.32, follow-redirects at 1.16.1 and the transitive unplugin at 3.4.0. Since then, i18next-browser-languagedetector 8.2.3 and @typescript-eslint/* 8.72.1 have come out inside their ranges. They aren't taken here; the next refresh will pick them up.

Audit, before and after

Findings Packages
main 33 (1 critical, 17 high, 14 moderate, 1 low) shell-quote (critical), launch-editor, follow-redirects, tmp, brace-expansion 1.x and 5.x, @humanfs/node, vite 8.0.16, vitest / @vitest/mocker 4.1.9, zod 4.4.3 and 3.25.76
this PR 1 high zod 3.25.76 under librechat-data-provider (GHSA-mrhx-c7xc-m3w5)

None of the fixes needs a new override. launch-editor 2.14.2, shell-quote 1.12.0, follow-redirects 1.16.1, tmp 0.2.7, brace-expansion 1.1.21 / 5.0.12 and @humanfs/node 0.16.8 all fall inside the ranges their parents declare, so the lockfile resolves them without pins. That also leaves them free to take later security fixes. bun audit lists the remaining advisory as zod@4.6.7, 3.25.76, but only the 3.25.76 copy is affected. The panel's own zod and TanStack's (deduped to the same copy) are on the patched 4.6.7.

Source changes in commit 1

  • src/components/InputOTP.tsx: has-[:disabled]:opacity-50 becomes has-disabled:opacity-50. The new canonical-classes rule flags the old form. Both compile to the same :has(:disabled) CSS on Tailwind 4.3.3.

  • vite.config.ts: __dirname becomes import.meta.dirname. Vite 8.3 warned about it three times per build, and the warning is gone.

  • src/components/__tests__/AuthCard.test.tsx: input-otp 1.5 clears its selection re-sync timers (0, 10 and 50 ms) on unmount. The fake clock that kept those timers from firing into a torn-down jsdom is no longer needed, so it is removed along with its comment. The teardown test now guards against them directly: it fails with input-otp 1.4.2 and passes with 1.5.0.

  • e2e/login.spec.ts: TanStack Devtools 0.15 adds a resize handle with role="separator" to the page vite dev serves, so the 2FA test's [role="separator"] matched two elements. The test now looks for the separator inside the OTP input ([data-input-otp-container] [role="separator"]).

Lockfile and Bun version

bun.lock stays at "lockfileVersion": 1 ("configVersion": 1), like main. Bun 1.2.0 or newer reads it:

  • A frozen dry-run install passes on Bun 1.2.0, 1.2.23, 1.3.0, 1.3.1, 1.3.2, 1.3.14, 1.4.0, 1.4.3 and 1.4.4.
  • Bun 1.1.45 fails with "Unknown lockfile version".
  • A real frozen install on Bun 1.2.0 produces the same node_modules tree as Bun 1.4.0: 988 packages, all at the same versions.

Both places that install from the lockfile already read it, so ci.yml is unchanged:

  • CI: oven-sh/setup-bun@v2 runs without a bun-version, so it installs the latest Bun. The most recent CI run got 1.4.4.
  • Docker: the image builds on oven/bun:1.4.3-alpine.

Bun 1.4 writes "lockfileVersion": 2 whenever it resolves the whole tree from scratch, and Bun 1.3 and older can't read version 2: 1.3.14 stops with UnknownLockfileVersion, while 1.4.0 and 1.4.4 read it. Updating an existing version-1 lockfile keeps it at 1. If a later refresh does a from-scratch resolve, either set the label back to 1 or declare Bun 1.4 as the minimum, through a packageManager field and bun-version in CI.

Held back

  • zod 3.25.76 (GHSA-mrhx-c7xc-m3w5). librechat-data-provider 0.8.524, the newest on npm, requires zod ^3.22.4, and no patched 3.x release exists. Only signed-in admins can reach it: importing YAML and saving configuration both validate admin input with data-provider's zod-3 configSchema.
  • @librechat/data-schemas stays at 0.0.74. 0.0.75, 0.0.76 and now 0.0.77 import runtime values that data-provider 0.8.524 doesn't export (31 in 0.0.77, such as AUTH_USER_DOC_CACHE_TTL_MS and chatProjectsConfigSchema), so loading their main entry throws. 0.0.77 also imports zod at runtime without declaring it as a dependency.
  • Follow-up: the Zod v4 migration. LibreChat dev merged "Migrate to Zod v4" (⬆️ feat: Migrate to Zod v4 LibreChat#17442). The data-provider on dev is now 0.8.530 with zod ^4.6.7, but npm hasn't published it yet. Once it is published, bump librechat-data-provider and @librechat/data-schemas together in their own PR. That clears the last audit finding, and it needs a few panel changes:
    • The config schema walker reads zod-3 internals (_def.typeName).
    • Validation messages read zod-3 issue shapes: invalid_union's unionErrors, invalid_enum_value and received.
    • AuditAction grows from 4 to 39 actions in data-schemas 0.0.76 and later, so the audit-log tab's Record<AuditAction, …> maps need to narrow to the actions they render.
  • Majors not taken: dotenv 18, i18next 26, react-i18next 17, js-yaml 5, mongoose 9, lucide-react 1.x, @testing-library/jest-dom 7, @types/node 26, @vitejs/plugin-react 6, jsdom 30, lint-staged 17, typescript 7 and vitest 5.
  • 0.x minors not taken: @clickhouse/click-ui 0.9 → 0.15. @tanstack/devtools-vite stays pinned at 0.3.12 rather than moving to 0.8, and the launch-editor / shell-quote fixes reach it inside its ranges.
  • @tanstack/react-query 5.105.0: the TanStack query set is pinned exactly and moves as one set, so it isn't in this PR.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

All checks were run on the final branch, rebased on current main, and each exited 0:

  • bun install --frozen-lockfile. The react-movable patch still applies, and a plain bun install leaves bun.lock untouched.
  • npx tsc --noEmit
  • npx eslint src/ e2e/ --max-warnings 0
  • bun run format:check (Prettier 3.9.10).
  • bun run test:lint-rules: 19 of 19 pass.
  • npx vitest run: 154 files and 3338 tests pass, with no unhandled errors.
  • bun run build, with no __dirname warning.
  • bun audit before and after, as in the table above.
  • The lockfile check across Bun versions described above.

Live click-through of the production build against a LibreChat backend:

  • Sign-in: worked.
  • Configuration:
    1. Changed OpenAI's stream rate and saved it through the review drawer. The drawer showed 25 (librechat.yaml) → 33.
    2. Reloaded: the new value was still there.
    3. Set it back, saved and reloaded.
  • Access: the role dialog's Details, Permissions and Members tabs work, and so does the Groups tab.
  • Grants:
    • The grant dialog toggles a switch and cancels without saving.
    • The audit log lists entries, and the entry drawer opens and closes.
  • Shell: the settings dialog closes with Escape and the sidebar link still navigates afterwards. The command menu navigates on Enter.

Every dialog and drawer closed with the page's pointer events restored. All 75 server-function calls answered 200 (73 GET, 2 POST), with no console or page errors. The only failed requests were two model-list fetches that the test's own reloads cancelled while they were in flight.

Earlier, on the same lockfile before the rebase:

  • The dev server (vite dev) rendered TanStack Devtools 0.15, with the Router and Query panels, without console errors.
  • AuthCard.test.tsx was green on repeated runs.

Playwright e2e (not run by CI), the whole suite against e2e/mock-backend.mjs, on this branch and on main:

After rebasing onto main (#188 to #202 merged): the full mock e2e suite gives 86 passed and 5 failed. Three are the Grants axe tests that also fail on main. The other two are the Access page axe scans. They now fail because @axe-core/playwright 4.14 checks Label in Name (label-content-name-mismatch, WCAG 2.5.3), and two shell controls already break it on main:

  • the header's search button is named "Command menu", but its visible text is "Search";
  • the user-menu avatar is named "User menu, ", but its visible text is the initials.

The app is unchanged by this PR. A follow-up a11y PR fixes both controls, along with the Grants axe failures.

Test Configuration:

  • Bun 1.4.0 locally. Bun 1.1.45 through 1.4.4 for the lockfile check.
  • Production build (bun run build + bun run start) with SESSION_COOKIE_SECURE=false over plain HTTP.
  • LibreChat backend from dev, before the Zod v4 merge.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

…ble Audit Findings

Moves every direct dependency to the newest release inside its current major, and the override
pins with them: vite 8.3.5, vitest 4.1.12 (every @vitest/* package follows), zod 4.6.7, eslint
10.13.0, react/react-dom 19.3.1 with @types/react and @types/react-dom 19.3.0, tailwindcss,
@tailwindcss/vite and @tailwindcss/node 4.3.3, @radix-ui/react-dialog 1.3.1 (its dismissable-layer
dedupe pin moves to 1.2.1, so one copy remains), @tanstack/react-devtools 0.10.13 (devtools
0.15.0, devtools-ui 0.7.1), input-otp 1.5.0, styled-components 6.6.0, lodash and lodash-es
4.18.1, mongoose 8.24.7, prettier 3.9.10, @typescript-eslint/* 8.72.0, eslint-plugin-import-x
4.17.1, eslint-plugin-tailwind-canonical-classes 1.6.0, @playwright/test 1.64.1,
@axe-core/playwright 4.14.0, the @testing-library patches, @types/node 22.20.5 and @types/bun
1.4.4. 0.x packages stay inside their minor, except prettier-plugin-tailwindcss 0.7.4 -> 0.8.1,
whose one breaking change is requiring Prettier 3.7 or newer. The override pins for postcss
(vite 8.3 needs ^8.5.30), browserslist, baseline-browser-mapping, katex, nanoid, ws and yaml move
to their newest patch. The undici pin is dropped: nothing in the tree depends on undici. TanStack
router and start stay at 1.169.4's set, with seroval, srvx and solid-js.

bun audit goes from 33 findings (1 critical, 17 high, 14 moderate, 1 low) to 1. launch-editor
2.14.2, shell-quote 1.12.0, follow-redirects 1.16.1, tmp 0.2.7, brace-expansion (1.1.21 and
5.0.12) and @humanfs/node 0.16.8 are resolved inside the ranges their parents declare, so none of
them needs an override. The remaining finding is zod 3.25.76 under librechat-data-provider
(GHSA-mrhx-c7xc-m3w5), which requires zod 3 and has no patched 3.x release.

The tree was resolved with a one-day release-age floor, so i18next-browser-languagedetector stays
at 8.2.2, baseline-browser-mapping at 2.11.32, follow-redirects at 1.16.1 and unplugin at 3.4.0.

bun.lock keeps "lockfileVersion": 1, which Bun 1.2.0 and newer read; CI (latest Bun) and the
Docker image (1.4.3) both install it frozen. Bun 1.4 labels a from-scratch resolve 2, which only
Bun 1.4 and newer read.

@librechat/data-schemas stays at 0.0.74: 0.0.75 through 0.0.77 import runtime values that
librechat-data-provider 0.8.524, the newest on npm, does not export.

input-otp 1.5 clears its selection re-sync timers on unmount, so AuthCard's tests drop the fake
clock that kept them from firing into a torn-down jsdom; the teardown test now fails if they leak
again. The canonical-classes rule rewrites has-[:disabled]: to has-disabled: (same CSS), and the
Vite config uses import.meta.dirname in place of __dirname. TanStack Devtools 0.15 adds a resize handle
with role="separator" to the dev server's page, so the 2FA e2e test looks for the OTP separator
inside the OTP input. A separate commit applies Prettier
3.9's formatting to src, with no other changes.
@danny-avila

Copy link
Copy Markdown
Contributor Author

@codex review

Pass 1. Head: 4e129c9

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-27T06:12:31.272710Z 4e129c9 Manual request
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 4e129c98e9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# Conflicts:
#	bun.lock
#	package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant