Commit graph

298 commits

Author SHA1 Message Date
lia-by-librechat[bot]
43aac5246a
🪰 chore: Bump HTTP Dependencies and Scope Security Overrides (#17688)
* 🪰 chore: Bump Axios and Refresh Vulnerable HTTP Dependencies

* 🪰 chore: Scope Patched Glob and Minimatch Overrides to Tested Consumers

* 🪰 test: Await Seed Read Receipts Before Persistence Snapshots

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-11-05 05:35:17 -05:00
Danny Avila
f5fa39c9b2
📦 chore: Update re2js to v2.9.1 and bump @hono/node-server to v2.1.5 (#17652) 2026-10-31 00:34:33 +01:00
lia-by-librechat[bot]
af3840b5fc
🥐 chore: Standardize Bun-First Workspace Typechecks (#17651)
* 🥐 chore: Standardize Bun-First Workspace Typechecks

* fix: Preserve Bun 1.4.3 Checker Compatibility

* chore: Pin Bun 1.4.4 for Local and CI Typechecks

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-30 16:33:52 +01:00
Danny Avila
4cb359682a
🏤 chore: Upgrade API and Test Dependencies, Refresh Bun Lockfile (#17414)
* chore: Update package dependencies across multiple modules

- Upgraded `@azure/identity` to version 4.14.0 in package.json files.
- Updated `multer` to version 2.5.0 and `nodemailer` to version 10.2.1.
- Incremented `undici` to version 7.30.1.
- Updated `@happy-dom/jest-environment` to version 21.0.4.
- Incremented `qs` to version 6.16.1 and `fast-uri` to version 3.1.9.
- Updated `serialize-javascript` to version 7.1.4.
- Updated `zod` to version 4.6.7 in multiple modules.

These updates ensure compatibility with the latest features and security improvements.

* chore: update bun.lock file
2026-10-24 15:30:39 +02:00
Danny Avila
94ae8a4198
🪷 chore: Upgrade DOMPurify and ip-address (#17379)
Some checks failed
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (shard 1/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 10/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 2/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 3/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 4/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 5/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 6/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 7/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 8/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 9/10) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/chat (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Docker Dev Images Build / publish (push) Has been cancelled
Sync Helm Chart Tags / Ignore non-main push (push) Has been cancelled
Sync Helm Chart Tags / Sync chart tags (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
* chore: Update dompurify to version 3.4.17 across all package files

- Bumped dompurify version from 3.4.16 to 3.4.17 in package.json, package-lock.json, and relevant sub-packages.
- Ensured consistency in dependency versions across the project.

* chore: Update ip-address package to version 10.7.4 in package.json and package-lock.json

- Bumped ip-address version from 10.5.1 to 10.7.4 in package.json.
- Updated package-lock.json to reflect the new version and integrity hash.
2026-10-23 07:48:26 +02:00
Marco Beretta
b793ab8bda
📌 chore: Re-Pin the ClickHouse Theme to Click UI v0.15.0 (#17356)
Some checks are pending
Docker Dev Images Build / publish (push) Waiting to run
Sync Helm Chart Tags / Ignore non-main push (push) Waiting to run
Sync Helm Chart Tags / Sync chart tags (push) Waiting to run
2026-10-22 22:34:01 +02:00
Danny Avila
a3ffa4fa6a
🚿 chore: Upgrade sanitize-html, Hono, and MongoDB Memory Server (#17343)
* 🔧 chore: Update sanitize-html and related dependencies in package-lock.json and package.json

- Upgrade sanitize-html from ^2.17.7 to ^2.18.1 across multiple package.json files.
- Update dayjs from 1.11.21 to 1.11.23 in package-lock.json.
- Upgrade is-plain-object from 5.0.0 to 5.1.0 in package-lock.json.
- Upgrade launder from 1.7.1 to 1.7.2 in package-lock.json.
- Update postcss from ^8.3.11 to ^8.5.27 in package-lock.json.

* 🔧 chore: Upgrade mongodb-memory-server to version 11.3.0 across package-lock.json and multiple package.json files

- Update mongodb-memory-server from ^11.0.1 to ^11.3.0 in package-lock.json.
- Reflect the same version change in api/package.json and packages/data-schemas/package.json.

* 🔧 chore: Upgrade hono to version 4.13.13 in package.json and package-lock.json

- Update hono from ^4.13.7 to ^4.13.13 in package.json.
- Reflect the same version change in package-lock.json.

* 🔧 chore: Upgrade follow-redirects to version 1.16.1 in package-lock.json

- Update follow-redirects from 1.16.0 to 1.16.1 in package-lock.json.
2026-10-22 13:04:12 +02:00
lia-by-librechat[bot]
df3adb837a
🐣 chore: Prepare v0.8.9-rc1 Release (#17336)
Co-authored-by: Lia <lia@librechat.ai>
2026-10-22 08:56:53 +00:00
Marco Beretta
de9d46fcd4
🔎 perf: Index-Bound Word-Prefix Search for Users and Groups (#16719)
* perf: Debounce People Picker Search

* perf: Index-Bound Word-Prefix Search for Users and Groups

Principal search and admin user search matched name, email and username
with case-insensitive regexes, which scan the whole users collection.
Users and groups now store lowercase, accent-folded token arrays derived
from each searchable field, indexed with tenantId, and searches match
anchored token prefixes. Schema middleware keeps the tokens in sync on
save, insertMany and update queries. Documents written before the tokens
existed stay findable through a fallback branch until
npm run migrate:search-tokens backfills them; startup warns while any
remain.

* perf: Build Search Token Indexes in the Backfill Migration

* fix: Reconcile Stale Search Tokens and Close Write-Path Gaps

The backfill now compares every document's tokens with its source fields and
repairs stale ones, so writes from an older server during a rolling deploy are
recoverable by rerunning it. Undefined assignments no longer clear tokens,
upsert inserts initialize every token field, every query word is required,
relevance scoring folds accents like the filter does, and the startup check
counts both collections in parallel and owns its error logging.

* perf: Drop the Second People Picker Debounce

SearchPicker already debounces query changes by 500ms; the extra 300ms delay
in UnifiedPeopleSearch stacked on top of it.

* fix: Match Nothing for Queries Over the Word Cap

Dropping the query word cap let one request build an unbounded filter. Restore
a 16 word cap, but a longer query now matches nothing instead of ignoring its
extra words, so a cap never produces a false positive.

* test: Cover Word-Prefix People Search and the Token Backfill End to End

* fix: Tokenize Fields an Upsert Copies From Its Filter

MongoDB copies equality conditions from an upsert's filter into the inserted
document, so their token fields now derive from that value instead of being
initialized empty.

* fix: Rank Accent-Folded User Matches Like the Search Filter

* test: Run the Token Backfill Without Blocking the Playwright Worker

* perf: Index Search Tokens Tenant First for Scoped Searches and Ignore Undefined Unsets

* test: Skip the Module-Scope Index Rebuild When the Scenario Runs the Backfill

* fix: Exit the Search Token Migration When Redis Clients Stay Open

* perf: Probe for Missing Search Tokens at Startup Instead of Counting Them

* test: Explain the Startup Probe the Warning Actually Issues

* fix: Keep Search Token Fields Out of Serialized Users and Groups

* fix: Keep the Admin Search Legacy Fallback Anchored at the Field Start

* fix: Score Groups Only on the Fields Search Matches

* perf: Start the Search Token Probe Alongside the Permission Checks

* fix: Warn at Startup When the Search Token Indexes Were Never Built

* fix: Score People Search Matches With the Filter's Word Separators

* perf: Check the Token Indexes Before Probing for Unmigrated Documents

* test: Drive the Failed Startup Probe Past the Index Check

* fix: Score People Search Matches Independently of Word Order
2026-10-16 22:41:37 +02:00
Dustin Healy
73847f2db5
🔌 feat: Integrate Durable Skill Lifecycle Across Writers and Routes (#17043)
* feat: integrate durable Skill lifecycle across writers and routes

* 🧪 test: Cover Skill Management Deletion End to End

* fix: Queue superseded Skill blobs for durable cleanup

* fix: Reject Skill file storage moves without new identity

* 🧪 test: Cover Skill UI Delete and Cleanup Restart

* 🧪 test: Assert Durable Cleanup for Replaced Skill Files

* fix: release Skill names during account deletion marking

* fix: use reserved Skill blob plans across writers

* fix: hold superseded Skill blobs until sync commits

* test: preserve account deletion retry coverage after restack

* test: verify durable Skill cleanup after account erasure

* fix: complete Skill cleanup leases and avoid historical metadata scans

* fix: bound Skill cleanup manifest processing
2026-10-16 09:05:05 -07:00
Danny Avila
c83af2000a
🔒 chore: Resolve Open Dependabot Security Alerts (#17016)
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/chat (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
- compression ^1.8.2, handlebars ^4.7.10, sharp ^0.35.5 (librsvg 2.63.2),
  @opentelemetry/instrumentation-mongoose ^0.67.0 as direct bumps
- proxy-addr 2.0.8 and source-map-js 1.2.2 as in-range lockfile refreshes
- raise the existing katex overrides from ^0.16.21 to ^0.18.2 (resolves 0.18.10)
2026-10-16 07:01:43 -04:00
Marco Beretta
5fc4371c6a
🪦 refactor: Remove Dead Legacy API Modules and Root Tooling (#17114) 2026-10-15 12:25:24 +02:00
Marco Beretta
c00c776e0e
📦 feat: Scaffold the @librechat/chat Package (#16964)
* feat: Scaffold the @librechat/chat package

Adds packages/chat with core, react and components entries, a tsdown build,
a node-environment jest config, turbo and root build wiring, import boundary
rules, design-lint scope, and core types for the chat transport, stream,
host and status. No code moves yet.

* test: Cover the @librechat/chat boundaries as scenarios

* fix: Run the chat suite in test:turbo and build it for the mock lane

test:turbo now selects @librechat/chat, the mock e2e job builds the package the
chat-package scenarios load, and the synthetic repository in the suppression
scenarios carries the packages/chat/src root lint:design:record names.

* chore: Build the chat package in frontend:ci too

* chore: Run the chat suite in test:all

* fix: Hold core TSX to the chat boundary and scan the package for cycles

* fix: Apply the chat import boundary to JavaScript sources

* fix: Keep nested core files off the components entry

* fix: Close the remaining chat package gates and fence aborts by generation

Blocks imports through the @librechat/frontend workspace name, adds the chat
sources to the i18n scan, the CSS color gate and the client Tailwind content,
and lets ChatAbortRequest carry the generation it means to stop.

* fix: Keep JSX out of the chat core and carry abort and reconnect outcomes

Rejects JSX under the core, copies the chat manifest before the Docker
install, keys the client app build caches on the chat sources, fences
reconnects by generation, and types the abort result the transport returns.

* test: Give the CSS gate's scratch tree the chat root it now scans

* fix: Close the remaining @librechat/chat gates and wiring

Rejects import() and require() across the package boundaries, holds chat
components to the literal-copy rule, compiles TSX in the package's jest
transform, builds the package in Frontend Unit Tests, requires its test job for
main promotion, adds it to the unused-dependency scan, and lists it wherever a
sibling workspace is listed: Dockerfile.multi, the docker smoke paths, the
remaining node_modules caches, the reinstall helper, the bun build chain and
AGENTS.md.

* fix: Tighten the chat boundaries and carry steering and Assistants aborts

Template-literal import() and require() and self-imports through the package
name are rejected, user-facing JSX attributes need localized text, the cycle
scan resolves self-imports, Dockerfile.multi builds the package for the client
stage, and the transport carries steer, cancelSteer, armSteer and the
Assistants abort key.

* feat: Match the chat transport and host contracts to the client's

The transport now reports settled and replaced starts, the stream's protocol
version and resumed flag, reconnect replay, generation status, paused-run
resume with approvals or answers, abort and steer protocol versions, and the
request error shape. The host config and auth carry what the client's
ChatSettings now supplies: rename-while-running, model specs, retention mode
and the user.

* fix: Keep lazy React-entry loads out of the core and type the Assistants stop

Relative import() and require() of the /react entry from core are rejected,
and an abortKey stop resolves to the terminal conversation and run messages the
Assistants route returns.

* fix: Fence start controls by protocol and close extension-bearing entry loads

Settled and replaced start results carry the protocol version, core loads of
the /react or /components entry with a file extension are rejected, and
test:packages:chat builds data-provider first.
2026-10-10 21:00:10 +02:00
Marco Beretta
adb04422bf
🚦 feat: Lint Disabled Dims That Compose No Disabled Recipe (#16907)
* feat: Lint Disabled Dims That Compose No Disabled Recipe

* fix: Catch Bracketed Disabled Variants and Read Recipes From References

* fix: Skip Enabled-State Branches and False-Valued Disabled States

* fix: Read Full-Opacity Recipes, Primitive Recipes and Compound Conditions

* fix: Keep the Suppression Error Wording the Baseline Spec Reads

* test: Add a lint scenario for the disabled-recipe rule

* fix: Leave negated disabled selectors and conditions alone in the disabled-recipe rule

* feat: Judge disabled recipes per branch, by import and by the element they restore

* fix: Trust recipes only from the theme module and only through defaulted cva variants

* fix: Resolve namespaced recipes through their import

* fix: Read cva disabled variants, guarded recipes and trailing important in the disabled-recipe rule

* fix: Read variant dims a disabled condition picks and recipes behind the same ternary

* fix: Follow nested disabled guards and real cva defaults in the disabled-recipe rule

* fix: Trust recipes only through class helpers and string concatenation

* fix: Read cva compound variants only under compoundVariants and guard key lookups

* fix: Require the recipe that can win for the faded element in the disabled-recipe rule

* fix: Judge stacked disabled variants by their most distant element

* fix: Match recipe markers, read || polarity, compound arrays, constant class strings and helper bindings

* fix: Accept spelled recipes, default-imported primitives, inverted props and disabled-guarded recipes

* fix: Check every chosen dim, trusted helper sources, data-disabled, recipe markers and guard identity

* chore: Re-record the disabled-recipe backlog after rebasing onto dev
2026-10-10 01:47:47 +02:00
Marco Beretta
9ff53ba5b5
⚡ perf: Cache Package Builds and Make Client Coverage Opt-In (#16709)
* perf: Cache package builds and make client coverage opt-in

* perf: Add a cached turbo test:ci task and a parallel test:turbo script

* perf: Hash default turbo inputs and live-test env for cached tasks

* perf: Hash live-test credentials in the turbo test cache key

* perf: Hash the ignored backend test env file in the turbo test cache key

* perf: Order test tasks after consumed builds and hash cross-workspace test imports

* test: Cover the cached test runner's keys, build order and client coverage toggle

* perf: Hash the root env file the live responses suite loads

* perf: Stop caching test results and hash the client package's baked env

* fix: Pass every caller variable to test runs and include the shared client suite
2026-10-04 15:53:29 -04:00
Marco Beretta
1e7b4a9bbd 🎨 feat: Check Color Tokens and Class Existence (#16041)
* 🎨 feat: Check Color Tokens and Class Existence

Moves the Tailwind colors out of createTailwindColors() and into
packages/client/src/theme/tokens.css as `@theme inline`, published as
@librechat/client/theme.css and imported by the app's stylesheet. Runtime theme
switching is unchanged: each token still resolves to the custom property
ThemeProvider rewrites, and `@theme inline` is what keeps it out of a frozen
variable. The palette scales are closed, so an undeclared shade is no longer a
color.

Reading the tokens is what lets @shadcn/lint check them, so no-unknown-classes
goes on and no-raw-colors gains undeclared-token detection. Between them they
found dead classes the app has been shipping: 59 `token-`-prefixed color
classes that generate nothing, `transition-color`, `scrollbar-hide`,
`pointer-cursor`, `mt-text-sm`, `dark:gpt-dark-gray`, `-ml-0.9`, `-mt-0.8`,
`transition-width` and `overflow-anchor-none`, all repaired or removed here.

The library's own config gains tailwindcss-animate, since its components write
`animate-in` and the accordion keyframes.

* 🧽 refactor: Delete the Plain `*-token-*` Rules the Tokens Replace

`client/src/style.css` defined `.text-token-text-{primary,secondary,tertiary}`,
`.border-token-border-{light,medium}` and `.bg-token-surface-secondary` as plain rules,
so the 63 call sites this pull request renamed were painting their token rather than
nothing. The rules have no consumer left once the names are gone, and they sat outside
`@layer utilities`, where an unlayered rule beats every utility on the same property:
keeping them would hold that cascade for any class attribute that reintroduced a name.
Deleting them is what lets the variants written beside those classes apply — the entity
avatars take `dark:bg-surface-tertiary` in dark mode, and the two action-header fields
take `hover:border-border-heavy` on hover.

Two files the rename touches carried lint debt the changed-file gate attributes to this
pull request once they appear in the diff: `ActiveSetting.tsx` was an unreferenced mock
component whose hard-coded copy fails `i18next/no-literal-string`, and `Retrieval.tsx`
computed a `vectorStores` value nothing reads. Both are removed. `tokens.spec.ts` takes
its `structuredClone` polyfill and its Tailwind module loader through imports, which
`@typescript-eslint/no-require-imports` requires of a TS file.

* ✅ test: Cover the Token Utilities From a Browser

Whether an element still takes its token color after the plain rules are gone is only
answerable in a rendered page, so the four behaviours this change turns on get a tagged
scenario in the mock harness: the account-menu email resolves `--text-secondary` instead
of inheriting the menu's primary text color, a theme definition installed at load
recolors that same row to its own value (what `@theme inline` exists for), the mention
menu's frame resolves `--border-light` rather than falling back to `currentColor`, and
the login email field transitions `color`/`border-color` for 200 ms instead of `all`,
which is what `transition-color` left it doing. Each reads the theme's custom properties
through the browser rather than restating a hex, so the same assertions hold in light
mode, dark mode and mobile emulation.

* 🩹 test: Settle the Shell Before Locating the Account Button

Probing `nav-user` visibility straight after `goto` reports the desktop sidebar as absent,
because nothing has rendered yet, and the fallback then waited on the mobile-only header
toggle until the test timed out — the two account-menu scenarios failed that way on both
desktop projects while passing on mobile. Waiting for the composer first settles the shell,
and the fallback click carries a timeout so a missing toggle fails fast instead of hanging.

* 🩹 test: Open the Drawer Before Reaching the Account Button

Below `md` the account button renders inside the drawer's own header, off-canvas until
the toggle opens it: a locator calls it visible, a click waits for it to stop moving, and
the two account-menu scenarios timed out on the mobile project. The toggle is `md:hidden`,
so its own visibility is the layout probe — click it when it is there, then the button is
reachable in both layouts.

* 📝 docs: Point the Theme Setup and the Lint Contract at What Ships

The theme README's setup still told a consumer to rebuild the color map in
`theme.extend.colors` — the map this change deletes — and never mentioned the published
stylesheet, so following it leaves the semantic utilities ungenerated. Steps 3 and 4 now
import `@librechat/client/theme.css` and the config keeps only content, dark mode and the
preset, with the removal called out as the breaking change it is.

`CLAUDE.md` said five design rules run and that `no-unknown-classes` stays off because the
repository is on Tailwind 3.4; this change enables it. That section now describes six rules,
what the rule cannot see and therefore what the `allow` list is for, that `no-raw-colors`
also reports an undeclared token, and the distinction a reviewer needs for this diff: a
raised suppression count usually means a new override, but a rule that starts resolving
class names it used to skip reports styling the tree already carried.

* 🩹 fix: Publish the Token Stylesheet as a File, Not a Folder

tsdown's `copy` reads `to` as a destination directory, so `{ from: 'src/theme/tokens.css',
to: 'dist/theme.css' }` produced `dist/theme.css/tokens.css` — a directory where the
package's `./theme.css` export pointed, which makes
`@import '@librechat/client/theme.css'` fail for every consumer of the published package.
The copy now keeps the file's name in `dist` and the export maps `./theme.css` onto
`./dist/tokens.css`; `require.resolve('@librechat/client/theme.css')` answers with that
file after a build. The app is unaffected either way, because `client/src/style.css`
imports the tokens from source so a lint or CI run needs no prior build — which is exactly
why nothing here noticed.

* 🎨 fix: Give the Bash Command Pane the Code Surface Role

Repairing `dark:bg-gray-950` by swapping in this palette's darkest shade kept the pane on a
raw value: `gray-900` is a scale entry, so no theme — custom, high contrast, or a future
one — can recolor a surface that every other code pane takes from `surface-code`
(`DiffView`, the user-turn code bars). It now takes that role in both modes, which also
drops the light/dark split the element carried for no reason.

Appearance moves with it: dark goes to `#212121` instead of `#0d0d0d`, light to `#f7f7f8`
instead of `#ececec`, matching the diff pane directly above it in the same card.

* 🩹 fix: Stop Hand-Copied Tailwind Rules From Outranking Their Utilities

`client/src/style.css` carried a block of Tailwind's own v2/v3 output copied in by
hand — `.hidden`, `.overflow-y-auto`, `.overflow-x-auto`, `.truncate`,
`.text-ellipsis`, `.animate-spin`, `.grow` and a `--tw-*`-based `.transform`. Under
v3 those sat beside the generated utilities and lost to anything later in the sheet.
Under v4 the utilities live in `@layer utilities` and these rules do not, so they beat
every utility for their property, variants included: `hidden sm:flex` and
`hidden md:flex` resolve to `display: none` at every width.

Two surfaces were gone because of it. The welcome screen's disclaimer
(`Chat/Footer.tsx`, `hidden … sm:flex`) never appeared, and the header's right-hand
control cluster (`hidden items-center gap-2 md:flex`) took the bookmark menu and the
temporary-chat toggle with it. `scenarios/welcome-disclaimer.spec.ts`,
`scenarios/temporary-chat-icon.spec.ts` and `bookmarks.spec.ts` fail on the parent
branch's build and pass here; nothing else in the style-sensitive e2e set changes.

Tailwind generates every declaration removed here, so the only behavioural difference
is `overflow: overlay`, which the copies set and which Chrome has aliased to `auto`
for years and other engines never implemented.

* 📝 docs: Load the Documented Tailwind Config From the Documented Stylesheet

v4 reads no config file unless a stylesheet says so, and the setup's step 3 imported the
tokens without an `@config` line, so the config step 4 tells a consumer to write — the
preset, the `content` globs, class-based dark mode — never applied. Both of this
repository's own entries carry the directive (`client/src/style.css`,
`packages/client/src/theme/theme.css`); the example now does too, and step 4 says that the
file only takes effect through it.

* ✅ test: Cover the Token Checks and the Published Stylesheet From a Browser

Two `@scenario`-tagged specs for what this change turned on. The first asks the
flat config, through a stdin probe, what a caller hears for a class Tailwind
cannot generate (`transition-color`) and for a colour token nobody declared
(`bg-surfce-primary`): both rules report, both name the spelling the author
meant, and the correctly spelled neighbours stay silent, which is what makes the
report about those two classes rather than about the probe. The second resolves
the `./theme.css` export the way a bundler does and asserts it lands on a file
that declares the `@theme inline` tokens and ships inside the package's `files`
— the export resolved to a directory once, and a consumer's `@import` is where
that failed.

* 🩹 fix: Record the Backlog the Rebase Brought Into the Enabled Rules

The 28 `dev` commits this stack caught up with added styling to three files the
full-tree sweep lints, and the recorded counts predate them: `ToolApproval.tsx`,
`Chat/Trace/Viewer.tsx` and the `TemplateTable.tsx` mockup reported through the
baseline, which is what the ESLint config regression gate compares. Those
violations are `dev`'s existing styling arriving in the rules' scope, so they
are recorded rather than restyled, and the count in CLAUDE.md follows.

* 🩹 fix: Ship the Animation Plugin With the Preset Consumers Load

The components published here write `animate-in`, `fade-in-0`, `zoom-in-95` and
`slide-in-from-*` — dialogs, popovers and dropdowns — and those are
`tailwindcss-animate` utilities. The plugin was registered only in
`packages/client/tailwind.config.js`, which is neither exported nor in the
package's `files`, so a consumer following the documented setup loaded the
preset and got no CSS for any of them: the surfaces appeared without their
motion and nothing said why.

The preset registers the plugin, `tailwindcss-animate` joins `tailwindcss` and
`tailwind-merge` as a peer dependency, and the consumer contract says so. The
new `@scenario:the-published-preset-generates-the-components-animations`
compiles the preset the way a consumer's build does — no app config — and
requires CSS and keyframes for each of those classes, with `p-4` as the control.

* 🩹 fix: Point the Documented Consumer Globs at the Files That Ship

Step 4 of the theme README handed a consumer
`./node_modules/@librechat/client/dist/**/*.js` as the content glob that reaches
this package. `tsdown.config.mjs` sets `fixedExtension: true`, so `dist` holds
`index.mjs` and `index.cjs` and never a `.js` — the glob matched zero files. A
consumer following the documented setup scanned only their own `src`, so every
utility that appears exclusively in a published component (dialog, menu, button
surfaces) was generated for nobody. The SPA never saw it: `client/tailwind.config.cjs`
scans `../packages/client/src`, the source, not the built package.

The glob now reads `dist/**/*.{js,mjs,cjs}`, and a scenario reads it back out of
the README rather than restating it, so the prose and the shipped file names
cannot drift apart again: it resolves the globs against the built package and
asserts they match every javascript module the export map points into `dist`,
and that those modules really do carry class names to find.

Against the previous README the same glob expansion matches `[]`; against this
one it matches `dist/index.mjs` and `dist/index.cjs`.

* 🩹 fix: Settle the Baseline, the Peer Metadata and the Comment the Rules Left

Three records that disagreed with the code they describe, all of them surfaced
by this pull request's own CI lane on a81c4a3.

`eslint-suppressions.json` recorded 10 `no-restyle` violations for
`client/src/components/Chat/AddMultiConvo.tsx` while the file has 9: the base
branch repaired one (`blur-sm` → `blur-xs` in a3e450de) without re-recording,
and this branch's baseline commit replayed the stale count over it. The
suppressions validator reads the whole baseline once the file is in the diff, so
it failed the Static Checks job with exactly that line. `npm run lint:design:prune`
drops the unused one; the trailing newline the runner strips is restored.

`package-lock.json` never received the two peers `packages/client/package.json`
declares: `tailwindcss` (added on the base branch) and `tailwindcss-animate`
(added here). The resolved tree was already correct — `tailwindcss-animate@1.0.7`
is hoisted — but the workspace entry's `peerDependencies` block disagreed with
its manifest. `npm install --package-lock-only` adds the two lines and changes
nothing else.

`eslint.config.mjs` still explained, four lines above the rule, that
`no-unknown-classes` "is deliberately not enabled" because "this repo runs
tailwindcss 3.4 with a JS preset". It is enabled at error on line 268, and the
comment beside the rule already says why that is now answerable.

* 🩹 fix: Import the Token Stylesheet Where the Consumer Probe Compiles

The standalone-consumer scenario compiled `@import 'tailwindcss'` plus the
package's config and nothing else, which is where the colours used to come from:
`createTailwindColors()` spread them into `theme.extend.colors`. They are
declared in `tokens.css` as `@theme inline` now, so that entry emitted no
`border-border-light` at all — compiled here, the class count is 0 — and the
divider fell back to `currentColor`, failing the e2e lane on shard 3 with the
text ink (`rgb(200, 0, 0)`) where the border role belongs.

The probe now imports the published token stylesheet between Tailwind and the
config, which is step 3 of the theme README and what a consumer following it
writes; the path comes from the package's own `./theme.css` export so it cannot
drift from what ships, and the build guard requires that file too. With the
import the utility compiles as
`border-color: rgb(var(--border-light) / var(--border-light-alpha, 1))`, and the
radius assertions are untouched: `rounded-sm` still resolves
`calc(var(--radius, 0.5rem) - 0.375rem)`.

The scenario joins this change's acceptance contract, because the invariant it
now protects is this one's: a consumer gets the package's colours from the
stylesheet, not from a config block.

* 🧽 refactor: Stop the Dashed Avatar Border From Depending on Emission Order

Both avatar placeholders carried `border-border-medium` and `border-black` on
one element. Same specificity, so the winner is whichever Tailwind emits last,
and compiling this tree's own config puts `.border-black` at line 3021 and
`.border-border-medium` at 3042 — the token wins today, which is why the
placeholders looked unchanged through the rename. Nothing states that order,
so a change in how Tailwind sorts utilities would silently turn the border
black.

`border-black` is deleted at both sites. The border keeps painting
`border-border-medium` exactly as it does now, and the recorded counts do not
move: neither file has a `no-raw-colors` entry, and the suppressions validator
stays green over the 74-file diff.

* 🎞️ fix: Preserve Component Animations When Integrating Canary

* 🎛️ fix: Let Shared Primitives Own Input and Tab Styling

* 🔗 fix: Preserve Auth Link Color Transitions

* 🧪 test: Verify Auth Link Color Transitions

* fix: Preserve Semantic Color Enforcement and Consumer Setup

* fix: Preserve Consumer Tailwind Palettes

* fix: Copy the Compatibility Palette Into the Docker Client Build

---------

Co-authored-by: berry-13 <berry-13@users.noreply.github.com>
(cherry picked from commit 78694f8c1e)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16041
2026-10-01 03:46:16 +00:00
Marco Beretta
4ffe3825ec 📧 feat: add email address change (#14597)
(cherry picked from commit 9ff251dd96)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/14597
2026-10-01 03:46:16 +00:00
Marco Beretta
339a323ff1 🎨 chore: Enforce Design-System Rules With @shadcn/lint (#15981)
* 🎨 chore: Enforce Design-System Rules With @shadcn/lint

Registers @shadcn/lint for client/src and packages/client/src, resolving\n@librechat/client as the design system so a className that overrides what a\nprimitive owns is reported with the variants and sizes to use instead.\n\nFive rules run at error. no-unknown-classes stays off: it needs Tailwind v4.\nContracts record what callers legitimately own (text typography, skeleton\nsilhouette); eslint-suppressions.json records the 3,141 violations the tree\nalready carried, so the rules gate new code without a tree-wide migration.\n

* 🩹 fix: Close the Gaps Review Found in the Design-Rule Gate

Five findings against this pull request, and one that killed its CI:

- The lockfile entries this change added resolved to a private mirror, so every
  job died in `npm ci`. They now resolve from registry.npmjs.org, with each
  integrity hash checked against the tarball npmjs.org serves.
- The pre-commit hook ran ESLint twice and the first run had no
  `--pass-on-unpruned-suppressions`, so it exited 2 on the suppression the fix
  had just made unused and lint-staged never reached the command that tolerates
  it. One invocation now does both; ESLint applies suppressions after fixes, so
  it reports the post-fix state.
- `scripts/static-checks.mts` omitted that same flag, so `npm run static-checks`
  failed locally on a diff the Static Checks lane passes.
- `lint:design:suppress` recorded a moved file's new path and left the old one
  behind, because only `--prune-suppressions` removes it and ESLint refuses both
  flags in one run. The script now chains the prune, and CLAUDE.md documents the
  scoped recipe that does not re-baseline the whole surface.
- The design rules matched only `.ts`/`.tsx`, so the client's `.jsx` entry points
  bypassed all five. Both globs now cover `.js`/`.jsx`; the one violation that
  exposed — an inline `display: none` on App.jsx's silent-audio iframe — is fixed
  at the source rather than recorded.
- A suppressions-only diff started no workflow and nothing read the baseline. It
  is now a trigger path and its own filter group, and a new `suppressions` check
  rejects a shape ESLint cannot load, a count no run can reach, a rule the plugin
  does not define, and a path that no longer exists.

The count-neutral swap two reviewers raised is not closed: ESLint's baseline
format records a count, not violation identities, so replacing one suppressed
violation with another of the same rule in the same file is invisible here.
CLAUDE.md now says that instead of implying detection.

Four `@scenario`-tagged specs cover the developer-facing behaviour: the report a
caller gets on a primitive override, a `.jsx` file being checked, the fixing
commit staying green (with the counter-proof that it exits 2 without the flag),
the move recipe dropping the old path, and every locked tarball being fetchable
from the public registry.

* 🧪 fix: Close the Dormant-Entry and Gate-Trigger Gaps

The suppressions gate did not run when the file that implements it changed, a
count recorded against a path no design-rule lint reaches passed validation, the
documented re-record chain could not run under cmd.exe, and the lockfile
scenario failed a legitimate SheetJS upgrade. The trigger scenarios also ran
four full-tree sweeps inside one test that declared a 180s deadline for work
measured at 100-280s per sweep.

- scripts/static-checks.mts: `scripts/static-checks.mts` joins the suppressions
  filter and the whole-record trigger, and a recorded path ESLint never reports
  on is rejected as dormant.
- package.json/CLAUDE.md: `|| node -e ""` in place of `|| true`, which cmd.exe
  does not define.
- e2e: the whole-record triggers are a matrix over a miniature repository (2-6s
  each instead of 100-280s), the oversized scenario is split into five
  behaviour-shaped ones, scratch baselines live in os.tmpdir(), and the lint
  gate runs in one project because it has no viewport.

* 📏 chore: Re-Record the Counts Dev Moved Under the Backlog

Rebasing onto dev brought #16067, which restyled three files the recorded
backlog speaks for: MarketplaceSidebar.tsx gained one arbitrary value and two
`no-restyle` violations, ToolsMarketplaceDialog.tsx gained one, and SkillsDialog
lost one. Counts above the file fail the lint for whoever edits it next; the one
below leaves capacity a later violation would spend. Scoped re-record and prune
of those three paths, per the recipe in CLAUDE.md.

* 🧭 test: Run the Copied Runner From the Tree It Is Testing

The trigger matrix pointed the copied static-checks runner at a miniature
repository but invoked it from the real one. The runner derives its repository
from its own location and relativizes file arguments against the working
directory, so `eslint.config.mjs` resolved to a path outside the miniature tree,
the suppressions group read as "not affected by this diff", and the scenario
passed a check that never ran (verify recorded it as a failure: exit 0 where a
rejection was expected). `run` now takes a `cwd`, and both synthetic-root probes
use it.

* 🔇 fix: Reject a Disable Comment With Nothing Behind It Yet

Comparing the two ESLint runs finds a directive only while it is silencing
something. A `/* eslint-disable shadcn/no-raw-colors */` over a file with no raw
colour left both runs agreeing, so it landed unseen and then silenced the first
violation anyone added to that file. The configured run now also asks for unused
directives, which is how ESLint names a disable with nothing behind it: a
dormant design-rule disable and a dormant blanket disable are rejected, a
dormant directive for another rule is not. Neither root carries one today (0
reports across 2,241 files), so what this rejects is new ones.

The same pass also has to see the primitives' variants, so `validateSuppressions`
builds `packages/client/dist` before the directive check rather than inside the
capacity scan that follows it; without the metadata both runs report strictly
fewer design diagnostics and a comment silencing a `no-restyle` violation is
invisible to the comparison.

* 🧱 fix: Count the Library's Build Inputs as Sources

`designMetadataIsFresh` compared `packages/client/dist` with `packages/client/src`
alone, so a commit that changed only the library's manifest or its tsdown config
left every source older than the build and the runner skipped the rebuild. The
design rules then classified against output emitted under the old contract —
locally only, since CI always builds before validating, which is the shape of
divergence nobody sees until the lane disagrees with the commit that passed.

Both files already count as design metadata everywhere else (the suppressions
filter, the whole-record trigger); they now count in the freshness comparison
too. The scenario runs the miniature repository with an observable
`build:client-package`: a current build is not rebuilt, and touching either
input asks for one.

* ⏱️ test: Set the Times the Freshness Rule Compares

The rebuild scenario wrote the build output and then the manifest, and node
wrote both inside the same millisecond, so the manifest was not newer than the
build and the runner correctly declined to rebuild — the assertion failed on the
filesystem clock rather than on the rule. The scenario now sets each mtime it
depends on with `utimesSync`, which is what it meant to say.

* 🩹 fix: Restore the Write the Import Edit Dropped

Adding \ to the import list replaced \ instead of joining it, and nothing local caught it: no tsconfig covers e2e/, and the flat config leaves \ to TypeScript there. The mock harness did — every scenario in the file failed with ReferenceError — which is the point of running it. Typechecked the four scenario files directly this time.

* 🚫 fix: Reject Every Inline Escape, Not Only the Ones in Use

Codex found three more ways past the gate, one shape each. A blanket
\ busy silencing an unrelated rule is used, so ESLint's
unused-directive report never names it, and the configured-versus-ignored
comparison sees no design delta — it waits for the file's first design
violation and takes it. Inline \ over a
clean file is invisible the same way. And a nested baseline that drops an entry
for an unchanged source was checked against its remaining keys only, so the
violation it used to speak for went unread.

The directive check now has two halves: ESLint still answers what a comment is
silencing today, and the comments themselves are read out of the parser — not
the text, so a string that reads like a directive is not one — for a disable
naming a design rule, a blanket disable, or inline configuration naming a
design rule, whether or not anything is behind it yet. That supersedes
\, which could only see the unused ones.
Neither design root carries any of the three today.

\ unions the entries a diff removes into a nested baseline's
file list, and \ joins the design metadata: it
carries the \ mapping, the entry emit and the include/exclude that decide
what reaches the bundle the rules read, which is why the repository's own build
caches key on \.

* 🔐 fix: Make the Hook Select What the Lane Selects, and Distrust a Half-Built Bundle

Two more shapes of the same mistake — trusting a proxy for the thing itself.

The pre-commit group listed individual files while the Static Checks lane's
filter also names both design roots, so staging a primitive ran ESLint locally
and the whole-record sweep only in CI: the commit passed and the lane failed on
callers nobody staged. The hook's group is now the lane's filter pattern for
pattern, and the count-edit scenario reads both files and fails when the two
lists differ, so the next path added to one has to reach the other.

Freshness took the newest timestamp under \ as proof of a
finished build. The build empties that directory before it writes, so a build
that failed halfway leaves a recent directory over a bundle with no entry
point, and every later run skipped rebuilding it. The check now also requires
what \ promises inside \ — its entry fields
and every string leaf of \ — to exist.

* 🧾 fix: Give the CDN Exception to xlsx, Not to the Host

The lockfile rule allowed \ for anything and then compared
versions against the base branch, so regenerating the lockfile against that CDN
could move any package off the public registry at the same version and pass.
The exception now belongs to the package — \, at any version, nested or
not — and every other entry has to come from the registry, which drops the
version comparison and the shallow-clone caveat with it.

The rule is a function the scenario applies to the repository's lockfile and to
lockfiles written for the purpose: an xlsx upgrade on its CDN passes, lodash
rewritten onto the same CDN at the same version fails, a new package from a
private mirror fails, and a nested xlsx is still xlsx.

* ↩️ fix: One Local Entry Point, Asked of the Runner

The pre-commit group I added for the backlog and the design metadata was
redundant and slower: \ already ends by running the runner
over the staged diff with \, and that run
selects its groups from the same filters — including both design roots, and
including deletions, which lint-staged never hands to a task. The group made
the whole-record sweep run twice for one commit. It is gone.

The scenario now asserts the property instead of a copy of the list: the hook
still runs the runner over the staged diff, and for every path the lane's
suppressions paths-filter names, the runner reports that check as selected
(\), while a path outside both roots is not affected.

* 🗺️ fix: Assert Where the Rules Are Asked, Not Only What They Found

A report cannot say where the rules were asked. Narrowing the design block over
a subtree that happens to be clean today — \, say —
produces no new diagnostic, no changed count, and no baseline entry to inspect,
so every gate stays green while the styling written there next goes unread.

The new scenario asks the resolved flat configuration instead: for one
representative path of each source extension in every directory under both
roots, all five design rules must be at error in the app and at the library's
own profile inside \ (overriding a primitive is off there;
colour and inline geometry still hold), and server code must carry none of
them. 1,184 paths, answered through ESLint's API in one process in under a
second — \ would have been eleven minutes of subprocesses.

* 🎯 fix: Spend the Budget Once — Reject a Swap Inside the Allowance

The recorded count is a budget per file and rule, and until now it could be
respent: removing one raw colour while adding a different one keeps the total
equal, so ESLint suppresses the new violation inside the old allowance and the
count checks see nothing move. The backlog was documented as unable to tell
that apart, and it was the one hole Codex kept finding its way back to.

What the totals cannot distinguish the diagnostics can. For every design source
a diff touches, the runner now lints that file's version at the base — through
ESLint's API, one process for the whole diff — and reports a design-rule
message the head has that the base did not, naming it. A violation that only
moved keeps its message and is not reported; a file with no version at the base
has no allowance to hide in and the count checks already answer for it.

Measured on the checkout: swapping one `fill="#AFC1FF"` for `fill="#BEEF11"`
in a file recording five raw colours is rejected in 4.9s naming the new one,
and the unchanged file passes. The scenario proves all three states — recorded,
moved, swapped — in a miniature repository with a history of its own, and
CLAUDE.md no longer claims the swap is undetectable.

* 🧰 fix: The Root Manifests Are Build Inputs Too

\ is defined in the root manifest and runs with the
toolchain the root lockfile pins, and both already select the suppressions
check — but neither counted as an input to bundle freshness, so a commit that
changed the build definition could validate locally against output made by the
previous one while CI rebuilt. They count now, beside the library's own
manifest, build config and compiler options, and the rebuild scenario drives
the lockfile case through the miniature repository's observable build.

* 🧭 fix: Read the Base From the Merge Base, and Give a New File No Allowance

Two holes in the swap check, both about what "the base" means.

It read each changed file's prior version from the base branch's tip, while the
changed-file set comes from \. With \ moving under a branch,
that calls a violation dev added since the branch diverged this change's doing,
and forgives one this change added that dev happens to carry. It resolves the
merge base once and reads from there.

And a file with no version at the base was skipped, so adding a source with a
violation and recording it in the same commit passed as "already recorded".
A file the change adds has no allowance to inherit: every design violation in
it is new. Renames are followed (\), so the
documented re-record of a moved path stays green — its violations came with the
file.

The scenario now walks recorded, moved, swapped, added-with-its-own-entry and
renamed through one miniature repository with a history of its own.

* 🔗 fix: One Base Commit, Asked Once

\ resolved the merge base; \ still read
the baseline from the base branch's tip, so the two checks in the same run
disagreed about what "before" meant — and an entry the base branch edited after
the branch diverged entered \ as though this change had edited it.

\ resolves it once and both ask it.

* 🔤 fix: A Suppressed Message Carries Its Text

\ omitted \, and the swap check reads it
— the union of messages and suppressed messages is what a file's diagnostics
are, and what the baseline silences is exactly what that check has to see.
Nothing local caught it: node strips types without checking them and no
tsconfig covers scripts/, so the runner is now typechecked directly
(                                                                               
                This is not the tsc command you are looking for                
                                                                               

To get access to the TypeScript compiler, tsc, from the command line either:

- Use npm install typescript to first add TypeScript to your project before using npx
- Use yarn to avoid accidentally running code from un-installed packages, clean).

* ⚖️ fix: Let the Record Grow, Out Loud

The swap check reported every violation a change added, which also forbade the
one path CLAUDE.md sanctions: add the violation and raise the count, so the
debt arrives as a line in the diff a reviewer reads. What separates that from a
swap is not the violation, it is whether the record said so — a swap keeps the
count still.

The check now charges each new diagnostic against how much that entry's count
grew between the merge base and here, and reports only what the growth does not
cover. Measured: a swap at an unchanged count fails, the same violation with
the count raised passes, and raising nothing fails naming the class. CLAUDE.md
says which of the three is which.

* 🚧 fix: A File the Change Adds Brings No Allowance

Letting the record grow to cover a new violation is right for a file that
already existed — the raised count is the line a reviewer reads — but it also
let a brand-new source arrive with its own entry, which is the backlog
recording what the tree never owed. Growth applies only where there is
something to grow: a file present at the merge base, renamed or not. A file the
change adds owes everything in it, and the message says so.

* ✏️ test: Assert the Wording the Added-File Rule Uses

The scenario still expected "is new here" for a file the change adds, which now
gets its own message — the backlog records what the tree owed, not what a new
file brings. The harness caught it; the assertion follows the rule.

* 🧮 fix: Ask Git What Existed, and Where Its Entry Lived

Three faults in the new swap check, one cause: it inferred from content what
only git can answer.

A tracked empty file at the base reads as absent, so an existing file was
treated as newly added and its recorded growth refused. A renamed file's
growth was measured at the new key, where the base has no entry at all, so the
move itself looked like room to spend. And a base commit missing from the clone
made every changed file look new, silently.

Existence is now \ succeeding, the allowance is read under the name
the entry had (the rename map already resolved the source; it resolves the
entry too), and a base commit that is not in the clone is reported rather than
guessed at. Measured: a rename carrying a new violation with its count raised
at the new key fails, a plain rename passes, a swap at an equal count fails.

* 🗃️ fix: A Deleted Baseline Is a Deleted Baseline, Nested or Not

The root baseline's deletion failed the check; a nested one was quietly dropped
from the target list by the same \ filter that was meant to skip
paths never present. What a nested baseline silences goes back to being
reported — or stops being — and nothing else reads it, so its deletion is the
same failure and now says which file is missing.

* 📚 fix: A Baseline in the Diff Is Read in Full

The comment said a baseline named in the diff is checked in full; the code
checked only the entries the diff moved, because \ made
\ non-empty and the full-record branch required it to be empty. So a
count edit never revalidated the rest of the record — dormant paths and stale
counts in unedited entries went unread. Editing the baseline now reads every
path it records.

And the rename map keyed on git's raw line, so a CRLF checkout left a \ on
the new path and the rename never matched — the file read as added and its
inherited allowance was refused. The lines are trimmed.

* 🧷 fix: Lint the Base Under the Name It Had, and Compare a Commit With Its Parent

Two last seams in the swap check.

A renamed file's base contents were linted under the new path, so moving a
component out of \ — where overriding a primitive is the
library's own business — into \ made the destination's stricter
rules apply to both sides: the diagnostics the move itself introduces looked
inherited, and a matching entry would have hidden them. The base is linted as
the path it had.

And \, the documented single-commit mode, resolved its
comparison to \ — the commit against itself, which forgives everything.
It resolves to the commit's parent.

* 🔖 fix: Quotes Do Not Hide an Inline Rule Configuration

ESLint reads \ exactly as it reads
the unquoted key, but the comment scan required the colon to follow the rule id
directly, so the quoted form passed over a file that does not violate the rule
yet — and then silences the first violation a primitive or config fan-out
creates there. Over a violating file the two-run comparison always caught it;
the dormant case is the one that slipped. The scan accepts either quoting, and
the scenario carries the quoted spelling beside the rest.

* 🧪 perf: A Spec Is Not Component Metadata

Both roots the design rules police are full of specs — every primitive in
`packages/client/src/components` has one — and editing any of them ran the
two-root suppression sweep, because the metadata predicate asked only whether
the path was a lintable source under a metadata root. A spec is neither: the
flat config turns all five design rules off inside it and the library's
tsconfig keeps it out of the bundle the caller rules resolve primitives
through, so it carries no `cva` variant and can report no design diagnostic of
its own.

`packages/client/src/components/Button.spec.tsx` through the runner:
59.7s before, 0.0s after.

The same `DESIGN_TEST_SOURCE` test is applied everywhere the invariant holds:
the freshness input no longer treats a spec as something `dist` is built from
(directory mtimes stay, so an added or deleted source still forces a rebuild),
the directive gate no longer fails a commit over a comment in a file where the
design rules are already off, and the base-vs-head lint no longer fetches a
spec's base version to ask a question with one possible answer.

* 🔎 fix: A Build That Reports Success Is Not a Build

Two gates trusted a signal instead of the condition it stands for.

`buildClientPackage` returned on the build's exit code. A build that exits 0
while leaving `packages/client/dist` incomplete or older than its sources left
`designMetadataIsFresh()`'s answer exactly as it found it, and the suppression
lint that follows then classified callers against a bundle describing something
else — reporting fewer violations than CI, which is the failure the rebuild
exists to prevent, reached through the branch meant to fix it. The freshness
question is now asked again after a successful build, and a bundle still stale
is an error naming `packages/client/dist`.

The workflow's `on.pull_request.paths` named only the root
`eslint-suppressions.json` while the inner `suppressions` filter names
`**/eslint-suppressions.json`. A diff touching only a nested baseline outside
`api|client|config|packages|scripts` — `e2e/fixtures`, say — started no
workflow at all, so `validateSuppressions()` never ran over exactly the nested
baselines it advertises. The trigger carries both spellings now.

The miniature repository's `build:client-package` writes the bundle its
manifest promises instead of only a marker, so the rebuild rows assert a
finished build rather than a claim of one, and a build that writes nothing is
its own row.

* 🧭 fix: Ask the Tool, Don't Reconstruct Its Answer

Four findings on the last head, and three of them were the next variant of a
family this branch had already patched once. The shared cause is one habit:
the gate re-derived a fact from a cheaper proxy instead of asking whatever owns
it, and every round found another case the proxy got wrong.

An inline `eslint` configuration comment was matched by the spelling of its
rule key, so `shadcn/x`, `"shadcn/x"`, `"shadcn\/x"` and `"shadcn\u002fx"` —
one key, four spellings, all of which ESLint honours — needed four regexes.
The key is now decoded before it is compared, which ends the family rather
than adding the fourth.

Bundle freshness reduced a set of outputs to the newest file anywhere under
`dist`. A resolver loads one entry, not a directory, so a build that rewrote
the ESM bundle and left the CJS one or the type declarations behind passed
while `@shadcn/lint` read the stale one. Every declared output is compared
now, which is the same reason their existence was already checked one by one.

Target discovery read `git diff --name-only` with rename detection, which
names one side. `git mv eslint-suppressions.json backlog.json` therefore
selected no group that owns the source, and the baseline's disappearance was
reported by nothing. `--no-renames` at the single funnel makes a rename two
paths; the one caller that wants the pairing asks for it separately.

The fourth was the parity assertion added last round, sitting in the mock
Playwright lane — whose own trigger excludes `.github/workflows` apart from its
own file, so a workflow-only diff never ran the assertion guarding it. The
claim moved into the runner, where the file that can break it already
activates the group, and the scenario now exercises the runner both ways over
a copy of the real workflow instead of reimplementing its parser.

* 📝 docs: Say Which Swaps the Ratchet Misses

The ratchet paragraph claimed a swap arrives as a failure, full stop. Two do
not, and a reader deciding whether to trust the gate needs both.

A swap whose diagnostic message equals the one it replaced is invisible,
because the comparison keys on the message and some rules name the property
without the value — `Inline style sets display.` is one message for `none` and
for `flex`. And a swap the diff itself causes, by changing a primitive or the
config, is invisible because both versions are linted under the head's design
inputs.

Tracked at berry-13/LibreChat#70 and berry-13/LibreChat#69.

* 📏 chore: Re-Record the Count Dev Moved Under the Backlog

`dev` fixed one `shadcn/no-restyle` violation in
`client/src/components/SharePoint/SharePointPickerDialog.tsx`, so the rebased
branch records 8 where the file now has 7. An entry with slack is exactly what
this change added a check for: the unused 1 would silence the next violation
anyone writes there, and the gate says so rather than letting it through.

`npm run lint:design:prune` drops the one count; the trailing newline it strips
is restored by prettier, the way the pre-commit hook's `*.json` group does.

* 📝 docs: Drop a Recorded Count That Dev Keeps Moving

The backlog total moves with every rebase that picks up new violations from
`dev`, so a number written into CLAUDE.md is stale by the next re-record — it
read 3,230 against a baseline holding 3,232. The recipe does not need the
figure; `eslint-suppressions.json` is the record.

* 📏 chore: Re-Record the Counts Canary Moved Under the Backlog

Retargeting onto canary changes the tree the design rules read, so five
files carry different violation counts than the recorded backlog claims:
Wakeup and SubagentConversation shed no-restyle violations and picked up
a require-static-classes one, and Ledger, UnifiedSidebar and ChatRoute
each gained one. Re-recorded those entries and pruned; nothing else in
the baseline moved.

* 🧱 fix: Build the Primitives Before Recording What They Own

`lint:design:record` was the one exposed design script that linted without
building `packages/client/dist` first. The rules read each primitive's `cva`
variants out of that bundle, so a fresh checkout or a primitive change left
the recording run classifying against a library that does not exist yet and
writing counts lower than the ones CI reports.

Moved the build onto the record script, where the other three already have
it, and dropped it from the `lint:design:suppress` wrapper so the wrapper
still pays for exactly two builds. A build failure inside the wrapper is
still loud: the record step cannot rewrite the baseline when the build it is
chained to fails, and the prune that follows does not swallow its own.

* 📏 chore: Re-Record the Counts Canary Moved Under the Backlog

Rebasing onto canary picks up PR #15798, which rewrote the agent marketplace
components, so eighteen recorded entries no longer describe the files they
name: AgentDetail is gone, AgentCard traded its restyle and arbitrary-value
violations for inline styles, AgentDetailContent grew to eighteen restyles,
and CopyLink, GridSkeleton, Marketplace, MineFilterToggle, SortDropdown and
LoadingDots arrived with violations nothing had recorded.

Re-recorded and pruned; every entry that moved belongs to a file that commit
touched, and nothing else in the baseline changed.

* 🧪 test: Assert the Record Asks for a Build Before It Writes

The build-freshness scenario covers the runner. Nothing covered the other
entry point: `npm run lint:design:record`, which writes the budget every
later change is measured against and, until now, linted whatever bundle
happened to be on disk.

The miniature repository's `build:client-package` appends to a log, so the
scenario can ask whether the record built before it wrote, and whether a
build that fails still stops the wrapper now that the wrapper no longer
carries a build of its own.

---------

Co-authored-by: berry-13 <berry-13@users.noreply.github.com>
(cherry picked from commit 8d5e1a75ee)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/15981
2026-10-01 03:46:16 +00:00
Danny Avila
ada91c13b6
📦 chore: npm audit fix + bump agents SDK to v4.0.1 (#16581)
* chore: bump dompurify

* chore: bump agents sdk to v4.0.1
2026-09-30 22:12:41 -04:00
Danny Avila
6a1d30cac3
🚀 v0.8.8 (#15735)
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
2026-09-29 23:55:37 -04:00
lia-by-librechat[bot]
03b89f88c5
🔩 fix: Raise Vulnerable Dependency Floors (#16474)
Co-authored-by: Lia <lia@librechat.ai>
2026-09-28 22:30:45 -04:00
Danny Avila
f13b0eaef4
🚚 chore: Point Repository and Image References at LibreChat-AI (#16005)
Some checks failed
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Docker Dev Images Build / publish (push) Waiting to run
Sync Helm Chart Tags / Ignore non-main push (push) Waiting to run
Sync Helm Chart Tags / Sync chart tags (push) Waiting to run
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Publish `librechat-data-provider` to NPM / pack (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / pack (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Has been cancelled
Update package repository and bugs URLs, GitHub links in docs, templates and comments, and image references (compose files, deployed-update, Helm values and renovate hints) from danny-avila to LibreChat-AI / librechat-ai. Covers the rag-api repository and its images, which moved to the organization. Sponsor links and the sealed star-history chart are unchanged.
2026-09-23 23:08:36 -04:00
Danny Avila
361553f332
🚀 v0.8.8-rc4 (#16147)
Some checks are pending
Publish `@librechat/client` to NPM / pack (push) Waiting to run
Publish `@librechat/client` to NPM / publish-npm (push) Blocked by required conditions
Publish `librechat-data-provider` to NPM / pack (push) Waiting to run
Publish `librechat-data-provider` to NPM / publish-npm (push) Blocked by required conditions
Publish `@librechat/data-schemas` to NPM / pack (push) Waiting to run
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Blocked by required conditions
Docker Dev Images Build / publish (push) Waiting to run
Sync Helm Chart Tags / Ignore non-main push (push) Waiting to run
Sync Helm Chart Tags / Sync chart tags (push) Waiting to run
* 🚀 v0.8.8-rc4

* chore: bump LibreChat chart to 2.0.14
2026-09-22 23:30:28 -04:00
Danny Avila
50d46a38a5
📍 test: Add Deployed Smoke Profile (#16135)
* test: add deployed instance Playwright smoke profile

* test: normalize deployed smoke account state

* test: harden deployed smoke lifecycle

* test: secure deployed smoke cleanup
2026-09-20 12:34:02 -04:00
Dustin Healy
44af4d3789
📖 fix: Verify Agents OpenAPI contracts and disable external reporting (#16028) 2026-09-16 15:17:56 -04:00
Marco Beretta
f077e8c967
🗯️ fix: Give Failed Turns Actionable Guidance (#15896)
* 🧯 refactor: State Failed Turns in Copy a Reader Can Act On

Every client-facing error code now has authored copy, so no failed turn renders
raw JSON, an unresolved `com_error_*` key, or a provider message cut at 512
characters. `client/src/components/Messages/Content/Error.tsx` becomes a module
directory: a dispatcher resolving `json.code ?? json.type`, a registry splitting
one-sentence copy from payload-aware renderers, and shared parts that resolve the
provider, model, user-key ownership and compaction capability behind the failure.

Message-limit violations persist `resetAt`/`retryAfterSeconds`, so the row counts
down to the window's reset instead of naming a window length alone.

* 📸 chore: pin before/after error copy screenshots for the pull request

* 🧹 chore: drop the pinned pull request screenshots from the tree

* 🔻 style: Trail the error disclosure chevron after its label

* ⏱️ refactor: Derive Limiter Resets in packages/api, Stamp Key Expiry as ISO

The message limiter's reset fallback and retry arithmetic move out of the
CJS middleware into `getRateLimitReset` in packages/api, which both the
message and agent-event handlers now call, so /api keeps only the wiring.

`checkUserKeyExpiry` persists `expiredAt` with `toISOString()` instead of
the server's `toLocaleString()`, which a client in another locale could
parse with day and month swapped.

* 🪪 fix: Attribute Failed Turns to the Row, Agent and Payload That Failed

Error content parts render through `Part` without their message, so their
copy named the conversation's current endpoint and model rather than the
ones that failed. The chat, flat-thread and search row renderers now supply
the row's identity through `ErrorSourceProvider`, and the dispatcher reads
it whenever no row is passed directly.

A saved agent's row carries the `agents` endpoint and the agent id as its
model, so identity, key ownership and the key dialog resolve against the
agent's own provider and model; an endpoint named by the payload (an
expired key) outranks both. The agent builder is only suggested where the
side panel would offer it: agents configured, builder not disabled, USE and
CREATE held, and an EDIT grant or administrator role.

Also in the renderers:
- structured refusals read Anthropic's `stop_details.explanation`
- provider bodies nesting their message under `error` keep that message
- upstream model failures name the provider when it is known
- `INVALID_USER_KEY` offers the key dialog on a user-provided endpoint
- an oversized message is never told to compact the conversation
- the countdown is bounded by the limiter's window, not a fixed day, and its
  ticking text is hidden from the assertive live region
- an expiry persisted in a server locale is shown as written
- search rows that failed render through the dispatcher, not as markdown
- the payload type is an explicit JSON value type

* 🧪 chore: Seed Real Refusal, Legacy Expiry and Nested Provider Error Shapes

The gallery's refusal case used a string `info` no producer writes; it now
carries Anthropic's stop metadata and a Bedrock content filter. It also
seeds an expiry stamped in a server locale, an unreadable key on a
user-provided endpoint, and a provider body nesting its message under
`error`, and removes whatever it inserted when a write fails.

* 🧵 fix: Keep the Reason From a Provider Body Embedded in Failed-Run Text

A failed run persists a provider error as `<base message>: <SDK message>`,
and Anthropic's SDK message embeds the response body, so the persisted text
reads `…request: 400 {"type":"error","error":{"message":…}}`. The
fallback renderer dropped that body and kept only the prefix, losing the
reason. It now swaps the body for the message it carries.

* 🔀 fix: Resolve Handoff Agents, URL-Owned Credentials and Nested Error Codes

An error part after an `AGENT_UPDATE` belongs to the agent the run was
handed to. `ErrorSourceProvider` now records where a row's handoffs sit,
and an error part resolves the agent active at its own `partIndex`; search
and shared rows give error parts that position too. A handoff the agents
map cannot resolve names no provider instead of the agent that handed off.

A user-provided base URL makes the reader's own record hold the key as
well, so key failures on such an endpoint offer the key dialog. `NO_BASE_URL`
and `INVALID_BASE_URL`, which only a user-provided URL produces, render
through the same renderer with named copy and an add or update action.

OpenAI-compatible bodies nest `code` and `type` under `error`; when the top
level names neither, the dispatcher reads the envelope, so a nested
`invalid_api_key` reaches the key renderer.

* 🕰️ fix: Keep Unknown Key Ownership Generic, Measure Resets From the Row

A shared link's viewer has no endpoint configuration, so whether the reader
or the deployment owns a key is unknown; key copy there read that as
deployment-owned and told the viewer to ask an administrator. Ownership is
now undefined without a configuration, and the copy stays generic.

The countdown's window bound used this device's clock, so a device running
behind the server could drop a valid reset. The window now runs from the
row's own timestamp, which the server stamped alongside `resetAt`.

* 🗜️ fix: Suggest Compaction Only Where the Compact Action Is Offered

Manual compaction is only reachable from the context usage popover, which
`interface.contextUsage: false` removes. Context errors on such a deployment
suggested compacting anyway; they now fall back to the standard next steps.

* 🧭 fix: Keep Row Identity Authoritative and Every Generation Charge Visible

A row's own endpoint and model now stand even where it lacks them, so a
restored failure no longer borrows whatever the conversation selected since;
only an error rendered with no row reads the conversation, and an agents row
with no stored agent id (the live row of a turn that just failed) still
resolves the conversation's agent.

Also:
- a token-balance row lists every generation instead of the first 20
- search rows re-render when their `error` flag changes
- `AUTH_CROSS_ORIGIN`, added since this branch began, renders the login
  page's copy and has a gallery case, so the seed's completeness check runs;
  a table test now fails for any enum member without authored copy
- upstream model failures keep the provider-neutral sentence the server
  persists as their text, which the e2e suite reads the row by

* 🪞 fix: Resolve Ephemeral Agent Ids and Keep an Agents Row's Model Name

An agents row whose model is a model name, as an ephemeral agent's is,
lost both its provider and its model whenever no saved agent resolved.
Agent ids now resolve the way sibling headers resolve them: a saved agent
through the map without the parallel `____N` suffix, an ephemeral agent
through the endpoint and model its id encodes. A row that still resolves
nothing keeps the model name it recorded; an agent id is never shown.

* 🛤️ fix: Attribute Lane Errors to Their Agent, Count Live Retries Relatively

A parallel run stamps each part with the agent of its lane, and an error
part in one lane was attributed to whichever handoff last preceded it. The
row now records error parts' own agents alongside its handoff positions,
and an error part's own agent comes first.

A live countdown subtracted this device's clock from the server's
`resetAt`, so a device running fast could report the limit already over.
`retryAfterSeconds` is now counted from the row's own timestamp, which the
device stamps on a live row and the server on a restored one.

Search results read a cached startup config but have no compact control, so
compaction guidance now also requires the chat surface.

* 🧷 fix: Resolve an Agents Row From Its Own Model, Never the Current Agent

An agents row that stored a model name, as an ephemeral agent's does, fell
back to the conversation's current agent when no saved agent resolved, so
switching the conversation to a saved agent later rewrote who produced the
old failure. The fallback served no real row: the client's live placeholder
for an agents turn stores the conversation's agent id as `model`, as
persisted rows do. The row's `model` now decides on its own — a saved or
encoded ephemeral id resolves, a model name is kept, and the `ephemeral`
placeholder names nothing; only an error with no row reads the conversation.

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
2026-09-14 10:37:22 -04:00
Danny Avila
e18606e5ce
🚀 v0.8.8-rc3 (#15859)
Some checks failed
Docker Dev Images Build / publish (push) Waiting to run
Sync Helm Chart Tags / Ignore non-main push (push) Waiting to run
Sync Helm Chart Tags / Sync chart tags (push) Waiting to run
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Publish `librechat-data-provider` to NPM / pack (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / pack (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Has been cancelled
* 🚀 chore: prepare v0.8.8

* 🚀 chore: prepare v0.8.8-rc3

* docs: mention Agent workspace defaults
2026-09-13 02:17:48 -04:00
Danny Avila
c79f13b1f1
📦 chore: bump npm audit packages and @librechat/agents to v3.8.5 (#15770)
* chore: bump agents sdk to v3.8.5

* chore: bump nodemailer to v10.0.1

* chore: bump sharp to v0.35.4

* chore: bump js-yaml to v4.3.2

* chore: bump hono to v4.13.7 and @hono/node-server to v2.1.1
2026-09-09 01:33:24 -04:00
Danny Avila
dad20b115e
🛗 fix: Add Tenant Index Upgrade Migration (#15767)
* fix: expose tenant index upgrade migration

* fix: retry tenant migration index builds

* docs: run tenant migration from the image root
2026-09-09 00:10:40 -04:00
Danny Avila
c883e9ef32
🔦 chore: Drop @lhci/cli and Run Lighthouse 13 Directly (#15687)
`@lhci/cli@0.15.1` pins `lighthouse` to an exact `12.6.1`, so the Lighthouse
lane could never move off a release whose `puppeteer-core` still depends on
`extract-zip` — an advisory with no patched version. That pin, not Lighthouse
itself, was holding 8 of the repository's 16 `npm audit` findings open.

LHCI was only ever a subprocess wrapper here: `audit.ts` shelled out to
`@lhci/cli/src/cli.js` for `collect` and `assert`, and LHCI's own node runner
shells out to `lighthouse/cli/index.js` in turn. Call that CLI directly, run
the three navigations in a loop, and assert the median budgets in TypeScript
next to the assertions `load.spec.ts` already makes.

- `npm audit`: 16 findings (7 high, 1 moderate, 8 low) -> 6 low. The remainder
  is the pre-existing `elliptic` chain under `vite-plugin-node-polyfills`,
  which has no fixed version and is unrelated to this lane.
- Lighthouse 13 removed `largest-contentful-paint-element` and moved the LCP
  node into `lcp-breakdown-insight`. Reading it through a `lcpElement` helper
  keeps the "the transcript must be the LCP element" guard working and makes
  the next rename fail loudly in one place.
- Reports move to `.lighthouse/` as `lhr-N.report.{json,html}`; cookie
  redaction, the API timing table and the desktop/provided-throttling settings
  are unchanged. Budgets are now printed as a table immediately before they are
  asserted, so the workflow's 80-line failure comment always contains them.
- `CHROME_PATH` and `LIGHTHOUSE_CHROME_FLAGS` are documented: chrome-launcher
  prefers the Windows Chrome under WSL, whose debugging port Linux cannot
  reach.
2026-09-06 23:20:22 -04:00
Danny Avila
3e97463680
🔭 feat: Tag Browser Diagnostics With Client Build IDs (#15656)
* feat: Attribute browser diagnostics to loaded client builds

* fix: Attribute inline recovery events and automate browser regression
2026-09-06 12:47:34 -04:00
Ravi Kumar L
de888cc362
🎈 ci: Gate Page Loads Under Database Latency (#15646)
Co-authored-by: Danny Avila <danny@librechat.ai>
2026-09-06 12:01:44 -04:00
Danny Avila
f9f1b2fb95
✨ v0.8.8-rc2 (#14845)
Some checks failed
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Publish `librechat-data-provider` to NPM / pack (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / pack (push) Has been cancelled
Docker Dev Images Build / publish (push) Has been cancelled
Sync Helm Chart Tags / Ignore non-main push (push) Has been cancelled
Sync Helm Chart Tags / Sync chart tags (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Has been cancelled
* chore: prepare v0.8.8-rc2 release

* test: satisfy mongo meili static checks

* test: avoid unsafe logger spy assertion

* chore: refresh v0.8.8-rc2 release

* test: restore mongo meili test isolation

* chore: normalize v0.8.8-rc2 versions

* docs: refresh v0.8.8-rc2 release surfaces
2026-09-02 22:18:48 -04:00
Danny Avila
29f738dea8
⏭️ feat: Honor an Interrupt Before the Model Has Answered (#15491)
* ⏭️ feat: Honor an Interrupt Before the Model Has Answered

An interrupt armed while the model is still thinking sat as "Interrupting"
until the entire turn finished, then landed as a terminal continuation. The
cause is upstream: the SDK reads `shouldPreempt` once per streamed chunk, and
its seal gate requires non-empty text — so a silent provider is never polled at
all, and a reasoning-only turn is never sealable.

`@librechat/agents` gains a discard-and-restart path for exactly that window
(`HOOK_PREEMPT_RESTART_CAPABLE`). This wires the host half:

- `GenerationJobManager.subscribePreempt` registers run-scoped wake listeners,
  notified after an ACCEPTED arm — local or cross-replica, since both land in
  `armPreemptIds`. Fenced on `createdAt` like every other preempt entry point,
  and a throwing listener never fails the arm a queued steer depends on.
- `createSteerPreemptPoll` hands that channel to the SDK as
  `StreamPreemption.subscribe`, gated on a new `isSteerPreemptRestartSupported`
  probe so an SDK that cannot act on a wake is never handed one.

The wake is a hint only: `isPreemptRequested` stays the single authority, so
the level-triggered contract the seal path depends on is unchanged.

Inert until `@librechat/agents` publishes the restart contract — the probe
returns false against the pinned 3.7.11 and the run keeps today's behavior.

* 🩹 fix: Replay an Already-Armed Preempt on Subscribe

Preempt requests are level-triggered, and the window between a job becoming
steerable and the SDK installing its model-attempt listener is real. An
interrupt landing there was recorded with no callbacks to notify, and on a
silent or reasoning-only turn no later chunk poll may ever run — leaving the
request to wait out the whole turn, the exact stall this channel removes.

`subscribePreempt` now replays an existing arm to the newly registered listener
only, after registration: waking the whole set would re-notify runs that
already looked, and waking before registration would leave a concurrent arm
with nowhere to land. The `createdAt` fence is unchanged and still gates the
replay.

The SDK also reads the level flag once at each attempt's start, so this is
belt-and-braces rather than the sole cover — but it makes the host correct on
its own terms instead of resting on when the SDK happens to look.

* 🔧 chore: Update @librechat/agents dependency to version 3.7.14 in package-lock.json and related package.json files

* 🔧 chore: Update dependencies in package-lock.json and package.json

- Bump versions for @humanfs/core (0.19.1 to 0.19.2), @humanfs/node (0.16.6 to 0.16.8), @xmldom/xmldom (0.8.13 to 0.8.15), and qs (6.15.2 to 6.16.0).
- Add @humanfs/types (0.15.0) as a new dependency for @humanfs/node.
- Update dependencies for side-channel and side-channel-list to their latest versions.
2026-09-02 13:35:52 -04:00
Danny Avila
0cb1118e08
📱 test: Add Mobile Chat Performance Benchmark (#15510)
* test: add mobile chat performance benchmark

* fix: isolate mobile benchmark measurements
2026-09-02 10:36:33 -04:00
Danny Avila
6d56d3b6fe
🧴 chore: Refresh Sanitizer and Selector Parser Dependencies (#15494)
* 🔧 fix: Update sanitize-html to version 2.17.7 in package.json and package-lock.json

* 🔧 chore: Update postcss-selector-parser to versions 6.1.3 and 7.1.3 in package.json
2026-09-01 21:38:08 -04:00
Danny Avila
52f7251ef7
📦 chore: Bump Packages from LibreChat SCA Audit (#15410) 2026-08-31 08:51:17 -04:00
Danny Avila
e9e77a4b33
🧜‍♀️ chore: Bump mermaid to v11.17.2 and dompurify to v3.4.14 (#15405)
Bumps mermaid 11.16.1 -> 11.17.2, and raises the dompurify override from
3.4.12 to 3.4.14 to clear GHSA-55q2-fjhq-7xh7 (XSS: IN_PLACE hook removal
leaves a detached subtree executable).

The dompurify pin lives under the `monaco-editor` override because monaco
depends on an exact 3.4.8; the override lifts it to match what the rest of
the tree resolves for `^3.4.0`, so a single copy stays hoisted. Bumping it
to 3.4.14 (current latest) keeps that single-copy property — pinning 3.4.13
would have left `^3.4.0` on 3.4.14 and installed two copies.

The mermaid floor moves to ^11.17.2 rather than staying ^11.16.1 because
11.17.0/11.17.1 dropped the `edgePaths` class from rendered SVG, breaking
the flowchart, block and user-journey stylesheets. Restored in 11.17.2.

Lockfile delta is limited to mermaid 11.16.1 -> 11.17.2, @mermaid-js/parser
1.2.0 -> 1.2.1, dompurify 3.4.12 -> 3.4.14, plus new fastdom + strictdom.
katex is unaffected: mermaid raised its floor to ^0.16.47, but the global
`katex: ^0.16.21` override supersedes it, and mermaid only ever calls
`katex.renderToString()`, which 0.16.28 provides.
2026-08-31 08:01:11 -04:00
Danny Avila
d369c649ed
🪥 chore: Run CI's Static Checks on Each Commit's Diff (#15303)
* 🪝 chore: Run Static Checks on Every Commit

Adds `scripts/static-checks.mts`, a local port of the Static Checks CI job
(.github/workflows/static-checks.yml) scoped to the files in a diff. It
resolves the changed-file list, applies the same `dorny/paths-filter` groups
the job uses, and runs whichever checks those paths activate — ESLint,
Prettier, import order, ESLint config validation, package.json validation, and
(behind `--full`) config migration tests, unused i18n keys and depcheck. Like
the job, every selected check runs even after one fails and the failures are
summarized at the end.

The pre-commit hook keeps lint-staged for the per-file layer, which verifies
the exact staged content of partially staged files, then runs the script for
everything lint-staged cannot cover. lint-staged now uses the job's ESLint
invocation, so warnings fail locally the way they fail CI.

The slow gates stay opt-in (`npm run static-checks:full`, or
`STATIC_CHECKS_FULL=1`) to keep commit latency unchanged.

Hooks were never installed: `config/prepare.js` existed but no `prepare` script
called it, so the hook only ran where `core.hooksPath` had been set by hand.
Replaces it with an inline `prepare` — both Dockerfiles run `npm ci` after
copying only the manifests, so a `node config/prepare.js` step would fail the
image build, and husky is absent from `--omit=dev` installs.

The i18n scan is a single pass over the source identifiers rather than one grep
per key, verified to flag exactly the same keys as the CI loop (including the
substring and dynamic-key cases) in 0.5s instead of 14s.

* 🩹 fix: Address Codex Round 1 on the Static Checks Runner

Activate gates from the unfiltered changed-path list. `dorny/paths-filter`
matches deleted paths too, so gating on the `--diff-filter=ACMRTUXB` list the
per-file steps use let a delete-only commit — the last reference to a
translation key, say — slip past the i18n and depcheck gates. The two lists are
now derived separately, the way CI derives them.

Pass `-m` to `git diff-tree` in `--commit` mode. Without it a merge commit
emits no paths at all, so `--commit <merge-sha>` reported "Nothing to check";
a real merge in this repo's history goes from 0 to 97 files.

Build the workspaces the config suite imports instead of skipping when `dist`
is absent. The three `dist` directories are gitignored and `npm ci` does not
produce them, so a fresh checkout reported a pass for a gate that never ran —
and an existing `dist` could be stale. Each is a sub-second tsdown build.

Resolve a global depcheck through a shell on Windows, where npm exposes it as
`depcheck.cmd` and `spawnSync` cannot see the shim.

Skip dot directories when walking for imports. `.claude/worktrees/` can hold a
full checkout per branch — 117 on this machine — and the root-wide scan behind
the depcheck gate walked every one of them.

Records the remaining boundary in the header: the per-file checks see exact
staged content via lint-staged, while the tree-wide gates read the working
tree, as running them by hand would.

* 🩹 fix: Address Codex Round 2 on the Static Checks Runner

Treat an unresolvable checker as a failure. ESLint and Prettier missing meant
the runner printed "All affected static checks passed" without having linted
anything; only depcheck, which CI installs globally and this documents as
optional, may still skip.

Catch per-check exceptions. The runner promises that every selected check runs
even after a failure, but a throw — a malformed translation JSON, say —
escaped and cancelled the checks after it. Each is now recorded as that
check's failure; verified that depcheck still runs after i18n throws.

Restrict `--commit` to the checked-out commit. Paths came from the named
commit while contents came from the working tree, so an older revision was
scored against the wrong file contents: a file added then deleted vanished,
and one modified since was read at its newer contents. It now fails with a
pointer to `--against`.

Reject unknown options. `--ful` silently ran the fast tier and `--commmit HEAD`
treated `HEAD` as a file path, both exiting 0 and implying gates had run.

Cover the runner in CI. `scripts/**` was absent from the workflow's trigger
paths, so a PR touching only the script the pre-commit hook now depends on got
no Static Checks run — and ESLint has no flat-config match for
`scripts/**/*.mts`, so nothing else loads it either. Adds the trigger path, a
`runner` filter group and a step that runs the script against the PR's own diff.

* 🔗 feat: Add Circular Dependency and TypeScript Gates

Both already run in CI as jobs of the Backend Unit Tests workflow; this brings
them to the local runner so they land before a push rather than after.

Circular dependencies (`node config/circular-deps.mjs`) is fast enough at 0.9s
to sit in the per-commit tier, gated on the same paths that trigger the CI job.

TypeScript stays opt-in behind `--full`: the five projects cost between 2.3s
and 20.9s each, which is too much per commit. Each project declares the paths
that can affect it — its own sources plus its upstream packages — so an edit to
data-provider still typechecks data-schemas, api, packages/client and client,
while an `api/**`-only change runs none of them, since no typechecked project
includes that directory. The builds a project's imports resolve through are
made first, mirroring the CI jobs' dependency on the build artifacts, through a
helper the config suite now shares.

Also addresses codex round 3:

Reject conflicting target selectors. `--against origin/dev package.json`
silently checked only the file, and `--against <bad-ref> --commit HEAD` never
resolved the bad base, so a caller could believe a range had been checked.

Require a clean worktree in `--commit` mode. The HEAD-only restriction was not
enough: contents still come from the working tree, so an uncommitted edit was
scored against the named commit — an invalid uncommitted package.json failing a
valid HEAD, or an uncommitted fix masking a defect in it.

The summary now names how many checks were skipped rather than reporting a
bare pass, and a typecheck failure carries the stale-workspace-build hint —
inside a git worktree `librechat-data-provider` resolves to the main checkout,
whose dist can predate the branch and shows up as missing properties.

* 🩹 fix: Address Codex Round 4 on the Static Checks Runner

Diff `--against` from the merge base. A two-dot diff reports the base branch's
own commits in reverse once it advances, so `--against origin/dev` scored 64
files for a branch that changed 7, activating gates for files the branch never
touched. Three dots makes the documented PR-style command mean what it says.

Typecheck on root manifest changes. Both review workflows trigger their
TypeScript jobs on package.json and package-lock.json, because a dependency or
@types bump breaks compilation on its own; the local filter ignored them, so
`static-checks:full` passed where CI would fail.

Validate every workspace manifest. The list mirrored the four the CI step
happens to name, so a malformed packages/api, data-provider or data-schemas
manifest passed validation in the revision modes, which have no lint-staged
pass behind them. Both lists now cover all seven.

Make the runner smoke execute a check. `--list` never runs one, and a
script-only PR activates no group, so the CI coverage added for exactly that
case could pass with the execution path untouched. It now runs against an
explicit target.

* 🩹 fix: Address Codex Round 5 on the Static Checks Runner

Activate the JSON gate for every manifest it validates. Round 4 added the four
workspace manifests to the validation list but not to the filter that turns the
gate on, so a malformed packages/data-provider or data-schemas manifest still
passed when it was the only changed file — the list grew and the trigger did
not. The same two entries also feed the unused-package calculation, reached
through api/package.json's @librechat/data-schemas dependency.

Include the owning workflows in the imported gates' filters. Circular
dependencies and TypeScript come from the review workflows, both of which list
their own YAML in `on.paths` and therefore rerun those jobs when the workflow
changes; locally the gates stayed inactive, so a change to how they are built
or invoked could bypass the local equivalent. Added to the group filters and to
the per-project predicates, since a workflow-only change would otherwise
activate the group and then select no project.

Bound command batches by characters rather than file count. Windows caps a
command line at 32767 characters, far below POSIX ARG_MAX, and a count does not
bound that: 400 of this repository's longer paths already come to 30176
characters before the executable and fixed arguments. Verified that a list
spanning several batches still reports a defect in its final file.
2026-08-28 10:08:37 -04:00
Danny Avila
393742016e
🔀 perf: Swap the Transcript With the URL on Conversation Switch (#15054)
* ⚡ perf: Swap the Transcript With the URL on Conversation Switch

Switching conversations left the PREVIOUS transcript painted under the new
URL. Two things on the critical path caused it, both fixed here.

`RouterProvider` commits location updates inside `React.startTransition` by
default in react-router v7, and a transition keeps the outgoing tree on
screen until the incoming one has fully rendered — so every millisecond the
next thread took to render was time spent looking at the previous one, and
React yields during that render, stretching it well past its CPU cost.
Nothing here reads route data through router loaders, so the transition
bought no pending UI; conversation state also still lives in Recoil, whose
transition-safe reads are gated behind `_TRANSITION_SUPPORT_UNSTABLE` hooks
this app does not use. `useTransitions={false}` puts the route change back
in the click's own task.

`navigateToConvo` also awaited `GET /api/convos/:id` before calling
`navigate()`, so the route did not change until a full server round trip
completed. The clicked row already carries its conversation, so the route
and conversation state now change together and the refetch reconciles
afterwards. The row is a list projection, so any previously fetched full
record underlays it — prompt prefix, sampling params and files survive the
switch, and a send during the reconcile window still carries the real
settings.

Measured on the built client with a 250ms conversation-fetch latency,
switching between two 30-turn conversations:

  before  cold  click→url 527ms  click→paint 931ms  14 stale frames (297ms)
          warm  click→url 474ms  click→paint 838ms  12 stale frames (277ms)
  after   cold  click→url ~190ms click→paint ~450ms  0 stale frames
          warm  click→url ~280ms click→paint ~280ms  0 stale frames

The warm switch now paints the new transcript in the same commit as the URL.
The warm-cache message loading this depends on is untouched.

Adds `e2e/benchmarks-navigation`, a react-scan benchmark that guards the
result: an in-page sampler records the route and the mounted conversation
once per animation frame, so a frame pairing the next URL with the previous
transcript is caught directly. The react-scan harness the reasoning
benchmark had inlined moves to `e2e/perf/scan.ts` and is now shared.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qZJDNkyH5rgCz6KcLjseq

* 🎯 fix: Resolve Sidebar Rows by Their Accessible Button in the Nav Benchmark

The a11y pass on the sidebar moved the conversation row's `role="button"`
and `aria-label` off the `convo-item` container and onto a real `<button>`
that `ConvoLink` renders inside it. The benchmark's click helper required a
single node carrying both the testid and the label, so after merging dev it
found nothing and threw.

Match on whichever node inside a row carries the label and let the click
bubble to the container's handler, which still owns the navigation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qZJDNkyH5rgCz6KcLjseq

* 🛡️ fix: Close Three Navigation Races Found in Review

Codex review of the optimistic-navigation path found three real defects.

Superseded reconciliations were written unconditionally. Selecting B then C
before both records settled let B's response land last and restore B into
conversation state while the route and transcript showed C — and sends read
from that state, so a user could submit into a conversation they were no
longer looking at. Navigations now claim a shared token before any await and
late responses are discarded. The token is module state rather than a ref
because every sidebar row mounts its own hook instance, so a ref cannot see
that a click on a different row superseded this one.

The first visit to a conversation installed the sidebar row as active state.
That row is a projection without prompt prefix, sampling params, tools or
files, so the composer became usable with settings that silently fell back to
defaults. Only a conversation whose full record is already cached now takes
the instant path; the first visit keeps the previous behavior and moves the
route once the record is in hand. Every later switch to it is instant, which
is the case this PR set out to fix.

A failed record fetch removed the target's message cache even though, after
optimistic navigation, that query is already mounted — a transient error
could cancel an in-flight history fetch, or discard one that had succeeded,
with no route change left to remount it. That removal is now limited to a
conversation confirmed gone, and the first-visit path still clears before the
route moves, where a fresh mount follows.

The benchmark's round-trip assertion was also unfalsifiable: nothing delayed
the record request, so an implementation that awaits it still answered inside
the threshold. It now holds that request open and asserts the warm switch
completes while it is unresolved, which no wall-clock bound can fake.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qZJDNkyH5rgCz6KcLjseq

* 🧭 fix: Tie Pending Navigation Work to the Route, Not a Token

Codex found that the navigation token only tracked calls made through this
hook. Every other way out of a conversation — `useNewConvo`, a link, a
redirect, the back button — moves the route without touching it, so a record
still in flight for the conversation being left passed the guard. On the
cached path that overwrote the new route's conversation state; on the
first-visit path it was worse, calling `navigate()` and pulling the user back
into a chat they had already left.

The token was the wrong question. What makes pending work still wanted is not
"was this the last conversation clicked" but "is the user still where they
were when it started" — and only the browser's own location sees every way
that can change. Each async step now captures the route before its request
and re-reads it before writing, which subsumes the superseded-click case the
token was added for and removes the module state entirely.

Reading `window.location` directly rather than `useLocation` keeps this free
of subscriptions: every sidebar row mounts this hook, so subscribing would
re-render all of them on every navigation — the cost this hook exists to
avoid. Comparing pathname against pathname also makes the basename cancel.

The tests move from `MemoryRouter` to a real history, since the mechanism is
now the browser location itself, and cover both bypass paths.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qZJDNkyH5rgCz6KcLjseq

* 🔢 fix: Keep the Last Click Authoritative Across First-Visit Navigations

Codex found that the route guard cannot separate two first-visit clicks from
each other. That path deliberately leaves the route where it is until the
record arrives, so clicking two uncached conversations in quick succession
has both requests capture the same pathname — whichever the network answered
first then navigated, and the later click was discarded. Response order
decided where the user landed instead of click order.

Restores a generation counter alongside the route check. Claiming the last
PR's removal of the token as a subsumption was wrong: the two guards answer
different questions and neither covers the other. The generation says "a
newer intent replaced this one"; the route says "the user left by some means
this hook never saw". Both are needed, and both are cheap.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qZJDNkyH5rgCz6KcLjseq

* 🧹 refactor: Stop Writing Server Snapshots Into User-Owned Conversation State

Four review findings on this branch were all the same defect: navigation
started a background fetch and wrote its result into the conversation atom.
That atom is user-editable — model, endpoint, prompt prefix, sampling params
— and the target chat is interactive from the moment the route changes, so a
late write races the user and every other writer. Each round added another
predicate to the write ("is this still the last click?", "is the user still on
this route?"), and each predicate left one more writer uncovered; the last one
is a setting picked on the same route by the same navigation, which no
ordering or route guard can see.

Remove the write instead of guarding it. The warm path refreshes the React
Query cache and stops there, so the optimistic merge that lands with the route
is the navigation's last word. The refreshed record is consumed by the next
switch to that conversation, which is where a cached record is read anyway.

This also dissolves the queued-focus finding: `applyConversation` (and its
`requestChatFocus`) is now reachable only from paths that navigate, so a focus
intent can no longer outlive the navigation that requested it.

Scope the synchronous route commit to conversation switches. `useTransitions`
on the provider disabled transitions for every route, including the lazily
loaded prompts, skills, insights and project screens, where yielding to input
during a large first render is worth more than an atomic swap. The opt-out
now travels per navigation as `chatNavigation` (`flushSync`), applied in
`useNavigateToConvo` and `useNewConvo`.

Tests: the four behavioural guards fail against an implementation that
restores the background write, including a new case where the user picks a
model while the refresh is in flight.

* 🎯 fix: Decide Route Commit Once, and Keep Refreshed Settings Refreshed

Reverts the per-navigation transition opt-out from the previous commit. Review
asked to scope `useTransitions={false}` to conversation switches, and I scoped
it by passing an option at the call sites I knew about — then immediately
missed one: `finalHandler` promotes `/c/new` to the server-assigned ID and
navigates without it, so the atom identifies the real conversation while the
route and message query still say `new`.

That is not a missed call site, it is the wrong shape. Fourteen call sites
across components, chat hooks and SSE handlers navigate into `/c/*`; an opt-out
carried by each one is a list that rots as call sites are added, and five of the
fourteen were covered. The property is route-shaped, so the decision goes back
to the one place that sees every navigation. Answering the original critique on
its merits: nothing in the app reads route data through router loaders or
renders pending UI from `useNavigation`, so the transition produces no
interstitial on any route — it only defers the commit, which on the chat route
is the bug this PR exists to fix.

Two conversation fixes alongside it:

Sidebar rows no longer reinstate settings the background refresh replaced. The
row projection carries `endpoint`, `model` and `spec`, and the warm path
spreads the row over the cached record — so a row from before an edit made on
another device would undo that edit on every switch until the list refetched.
The refresh now merges the record into the list cache, which is what made
"picked up on the next switch" true rather than merely intended.

Starting a new chat now supersedes a pending first visit. "New chat" from
`/c/new` lands on `/c/new`, so the pathname is unchanged and the record for a
conversation the user just abandoned would land and pull them into it. The
navigation counter is exported as `supersedeNavigation` and called from
`useNewConvo`. Deliberately not called from the stream recoveries in
`useEventHandlers`/`useChatFunctions`: those are the app reacting, not the user
changing their mind, and they should not cancel a conversation the user opened.
Intent is a closed set; navigation is not.

Both new tests fail against the implementation they guard.

* 🧷 fix: Keep the Record Refresh Off List State and Off Background Composers

Three fixes to the previous two commits, all the same underlying mistake in
different places: something that started earlier landing on top of something
the user did later.

The list-cache write added last commit merged the whole fetched record into
every sidebar and pinned row. That response is a snapshot from before the
target was interactive, and the list is where renaming, pinning and sharing
land — so a rename completing while the request was in flight was silently
undone. This is the same stale-snapshot-over-live-state mistake the refresh
had just stopped making against the conversation atom, reintroduced one layer
down. It now writes `endpoint`, `model` and `spec` only, which is what the
staleness it exists to fix is about, and which no list mutation touches.

The route comparison ignored the query string. `/c/new?projectId=A` is a
different conversation scope than `/c/new`, and the landing chip re-scopes a
draft by writing the atom and rewriting search params in place — never through
a conversation hook, so neither the pathname nor the recorded intent moved. A
pending first-visit record would then land on the draft the user had just
re-scoped. The comparison now includes `search`.

Superseding moved from `switchToConversation` into `newConversation`, guarded
by `keepComposerState`. That flag marks a call that re-renders a composer an
earlier call already opened — agent metadata arriving late, for instance. The
user asked for nothing there, so it must not cancel a conversation they clicked
while it was in flight. `switchToConversation` has no callers outside this
hook, so the move loses no coverage.

The first two are covered by tests that fail against the implementation they
guard. The third is verified by inspection: exercising it needs the whole
`useNewConvo` provider tree, which is disproportionate for a one-line guard.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-21 11:28:18 -04:00
Danny Avila
061e4b02a3
🎞️ ci: Fix Playwright ffmpeg Install Hang and Cache the Download (#15065)
Every Playwright job spent a flat 90s on `npx playwright install ffmpeg`,
and none of them ended up with a usable ffmpeg.

The 2.3MB download finishes in under a second; extraction then hangs until
`timeout -k 10 90` reaps it (exit 124, masked by `continue-on-error`). That
is a Node 24.16.0 readable-stream change (nodejs/node#62557) colliding with
yauzl/fd-slicer never firing `close` after EOF, which hangs extract-zip.
It leaves a truncated `ffmpeg-linux` — 5,055,201 bytes against the zip's
declared 5,101,056, segfaulting on exec — and no INSTALLATION_COMPLETE
marker, so Playwright treated ffmpeg as uninstalled. `video: 'on-first-retry'`
has therefore never worked in CI, and every first retry of a flaky test died
in browserContext.newPage: exactly the failure the step existed to prevent.

Upstream fixed it in Playwright 1.60.0 (microsoft/playwright#40747) and Node
reverted it in 24.18.0 (nodejs/node#63834). Node 24.16.0 is pinned in 17
places including the Dockerfiles, so bump Playwright instead — it is a dev
dependency, and `^1.56.1` already permitted 1.62.1; only the lockfile pinned
it. Staying at or above 1.62.1 also avoids the tsconfig-resolution
regressions in 1.62.0.

Caching alone could not have fixed this: a cold cache still hangs, and what
would have been cached is the corrupt binary. So the ffmpeg download is now
restored from cache keyed on the resolved playwright-core version, the
install is skipped outright on a hit, and the cache is only saved once the
binary is verified to actually execute — a partial extraction can never be
promoted into a cache that every later job restores.

Per job: 90s to ~0s on a hit, ~2s on a miss.
2026-08-21 01:36:09 -04:00
Danny Avila
ee21066590
🏎️ ci: Focus Redis E2E Coverage (#14842) 2026-08-14 12:54:30 -04:00
Danny Avila
eaef87fa26
🚀 chore: Prepare v0.8.8-rc1 (#14394)
* 🚀 chore: Prepare v0.8.8-rc1 release

* 📚 docs: Complete v0.8.8-rc1 operator references

* 📚 docs: Mark stateful sessions experimental

* 📚 docs: Clarify background code capability

* 📚 docs: Refresh v0.8.8-rc1 operator guidance

* 📚 docs: Highlight v0.8.8-rc1 features in README

* 📦 chore: Bump publishable packages again

* 📚 docs: Add streaming question progress

* 📦 chore: Bump publishable packages again

* 📚 docs: Refresh v0.8.8-rc1 release highlights

* 📦 chore: Bump publishable packages again

* 📚 docs: Refresh v0.8.8-rc1 release guidance

* 📦 chore: Bump publishable packages again

* 📚 docs: Highlight batched Agent questions

* 📦 chore: Bump publishable packages again

* 📦 chore: Bump publishable packages again

* 📦 chore: Bump publishable packages again

* 📦 chore: Refresh v0.8.8-rc1 package versions

* 📦 chore: Refresh v0.8.8-rc1 package versions

* 📦 chore: Refresh v0.8.8-rc1 package versions

* 📄 docs: Note PowerPoint template support

* 📦 chore: Refresh v0.8.8-rc1 package versions

* 📄 docs: Note latest provider and file support
2026-08-14 03:24:59 -04:00
Marco Beretta
f7d9f36922
🎨 feat: Refine Client Colors and Sharing Dialogs (#14734)
* Refine client colors and settings interactions

* Align dark dialog theme tokens

* Preserve custom hover themes and badge contrast

* feat: redesign sharing dialogs

* fix: preserve theme compatibility and role menus

* fix: address review findings and static checks
2026-08-10 22:43:57 -04:00
Ravi Kumar L
7cf4c3f73f
🧪 test(e2e): add Bombadil property exploration (#14462)
* test(e2e): add Bombadil property exploration

* fix(e2e): address Bombadil review feedback
2026-08-10 02:11:06 +02:00
Danny Avila
b807292997
📉 perf: Bound Early Event Buffering for Detached Generations (#14612)
Some checks failed
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Has been cancelled
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Has been cancelled
GitNexus Index / index (push) Has been cancelled
GitNexus Index / post-index (push) Has been cancelled
* 📉 perf: Bound Early Event Buffering for Detached Generations

A generation streaming with no attached subscriber re-entered buffering
mode on every disconnect and retained each emitted event in
earlyEventBuffer for its remaining duration. A single 26-minute detached
run (~58,800 tool-argument deltas) grew the heap past 2 GiB with GC cost
climbing alongside it, while client reconnects always resume from
durable state and discard that local buffer anyway.

- Close the early buffer after the first attachment drains it in Redis
  mode; the durable chunk log and pub/sub own recovery from then on,
  matching how cross-replica subscribers already attach.
- Enforce hard bounds (5,000 events / 8 MB estimated) in both modes; on
  overflow the buffer is discarded and closed, with recovery falling back
  to the durable chunk log (Redis) or resume snapshot (in-memory).
- Add a generation_stream_early_buffer_overflows_total counter and
  earlyBufferedEvents/Bytes gauges on getRuntimeStats() for visibility.
- Add incident-shaped regression tests and update specs that pinned the
  old post-disconnect re-buffering contract.

* fix: redirect post-overflow first attachments to resume recovery

A buffer discarded by the overflow guard left the initial non-resume
SSE attachment with nothing to replay, silently omitting pre-attach
output until the final event. Track the overflow on the runtime and
close such attachments with the existing reconnect signal instead: the
client already re-attaches with resume=true on transport failure and
its sync frame reconstructs the discarded output from durable/snapshot
state. Adds no per-event work; the check is one boolean per attachment.

* fix: enforce buffer bounds when restoring canceled resume captures

Captured emissions restored by a resume canceled before activation
bypassed the early-buffer hard cap, so one oversized restoration could
persist past the limits with no later emission to trip the guard.
Restoration now applies the same overflow-and-close behavior through a
shared helper, and the restore-cap spec fails before this change
(5 events / ~10MB retained) and passes after.

* chore: add Redis management scripts and update package.json for Redis commands
2026-08-03 19:03:37 -04:00
Danny Avila
2d606a9783
🧹 chore: Migrate Legacy Duplicate Code Files Blocking Dedupe Index (#14593)
Atomic file claiming (#11675) added a unique partial index on
(filename, conversationId, context, tenantId) for execute_code outputs.
Records written before it inserted a new document per regeneration, so
any deployment that re-ran a cell producing the same filename carries
duplicates the index cannot span: Mongo aborts the build with E11000 and
the constraint is silently absent — the claim path still works, but
without its database-level guard against concurrent inserts.

Adds config/migrate-code-file-duplicates.js to normalize that legacy
data, following the existing migration conventions (dry-run default,
--batch-size, runAsSystem for cross-tenant scans).

Renames rather than deletes: each duplicate is a distinct stored object,
typically still referenced by a message attachment, so removing one
would strip a real artifact from a user's history. The newest record
keeps the canonical name — matching the claim path's latest-write-wins
behavior — and older copies gain a ' (n)' suffix that skips names
already taken in the conversation. Attachments embed their own filename,
so rendered history is unchanged.

After a successful apply the script builds the index directly (targeted
createIndex, not syncIndexes) so the operator learns immediately whether
the constraint is now in place.
2026-08-02 06:41:21 -04:00
Danny Avila
52b2ebf948
🧪 test: Run mock E2E against Redis in shards (#14551)
* 🧪 test: Run mock E2E against Redis in shards

* 🧪 test: Isolate local Redis E2E data
2026-07-31 12:10:43 -04:00
Danny Avila
6dae785e31
🌯 chore: Retire Rollup-Era devDependencies After tsdown Migration (#14496)
Removes 26 of the 32 Rollup-era devDependency declarations left behind when
these packages moved to tsdown, plus two stale config references and an
override that went inert in #14483.

- Drop all 8 from `packages/api`, all 8 from `packages/client` (including
  `concat-with-sourcemaps`), and all 10 from `packages/data-schemas`. None of
  their tsdown configs import anything from rollup, and none has a rollup
  script or config file.
- Keep all 6 in `packages/data-provider`. Five of them back the `rollup:api`
  script, which the "Circular dependency checks" CI job runs to surface
  rollup's circular-dependency warnings, and `@rollup/plugin-replace` is
  imported directly by that package's tsdown config.
- Drop `rollup.config.js` (exists nowhere in the repo) and
  `server-rollup.config.js` (real, but never read by the `build` task, so
  listing it only caused spurious cache invalidation) from `turbo.json`.
- Drop the `**/rollup.config.js` glob from `eslint.config.mjs`. It matches
  nothing, and never matched `server-rollup.config.js`.
- Drop the root `svgo` override, dead since #14483 removed
  `rollup-plugin-postcss`, the only thing that pulled svgo into the tree.
2026-07-28 22:08:52 -04:00
Danny Avila
9c95bf445f
🍂 chore: Prune Deprecated Packages From the Dependency Tree (#14483)
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
GitNexus Index / index (push) Waiting to run
GitNexus Index / post-index (push) Blocked by required conditions
Removes three of the eight deprecation warnings emitted on `npm install`.

- Drop `@types/winston` from `packages/api` and `packages/data-provider`.
  The published tarball ships no type declarations at all, so `winston`'s own
  types were already being used. Declare `winston` as a devDependency instead,
  since both packages `import type { Logger } from 'winston'` and were relying
  on hoisting to resolve it.
- Drop `rollup-plugin-postcss` from `packages/client`. It is unreferenced since
  the package moved to tsdown, and pulled in `cssnano -> postcss-svgo -> svgo@2`,
  which is the only consumer of the deprecated `stable`.
- Override `test-exclude` to ^8 so `babel-plugin-istanbul` stops resolving
  `test-exclude@6`, which pins the deprecated `glob@7`.

The remaining five warnings (`ldapjs`, `whatwg-encoding`, `node-domexception`,
and workbox-build's `glob`/`source-map`) are transitive with no non-deprecated
version available upstream.
2026-07-28 09:28:06 -04:00