* refactor: Move Tool Disclosure State and Leaf Part Components Into @librechat/chat
Disclosure contexts and atoms, tool intent labels, useRowHandoff and
useFollowScroll move to packages/chat/src/react/parts (exported from
@librechat/chat/react); CancelledIcon, InProgressCall, AuthorHeader, Stdout,
BareStatus and the row class constants move to
packages/chat/src/components/parts (exported from @librechat/chat/components).
Disclosure reads the package host, and ToolContentQuery is declared from
data-provider and react-query types. The AuthorHeader and useFollowScroll specs
move with their modules.
* test: Cover the Author Header That Resumes After a Steer
* test: Keep the Package Entry Intact When Mocking AuthorHeader
* refactor: Move Pure Part Helpers Into @librechat/chat
Tool output parsers (JSON fields, background handles, wakeups, background
tasks, command results) and the small routing, params and rerun helpers move
from client Content/ into packages/chat/src/core/parts, exported from the
package root. Client importers read them from @librechat/chat; parseJsonField
becomes a named export so the root barrel can carry it.
* test: Cover Wake-Up Turns Rendering as Task Cards
* fix: Point the API Background Spec at the Moved Parsers
* fix: Bound outbound HTTP calls that had no timeout
Add timeouts.toolsMs, speechMs and imageGenerationMs to the timeouts block and apply the
existing budgets to the RAG delete paths, built-in tool APIs, TTS/STT providers (TTS also
aborts when the client closes), Stable Diffusion, Firebase reads and Mailgun. Calls made
before app config exists (remote config, RAG health, service key URL, Google refresh) get a
fixed 10 second budget.
* fix: Honor configured budgets for RAG deletes and per-chunk TTS deadlines
* refactor: Share one budget helper between speech and image CJS callers
* test: Cover a stalled RAG delete with a mock scenario
* test: Wait for the RAG embed before stalling the delete
* test: Embed at upload so the stalled delete has a vector to remove
* fix: Close a started TTS response on a late chunk timeout and share the service budget helper
* fix: Fail startup when the remote config fetch times out
* refactor: Move Message Row and Timestamp into @librechat/chat
Add a MessagesHost the message list reads the viewer's clock format and row
slots from, registered by the app at load, and move MessageRow,
MessageTimestamp, the row width helper, the timestamp formatters and the
minute ticker into the package with their specs. The user attachments a row
shows reach it through the host's files slot until they move.
* test: Cover Message Rows on Chat and Shared Routes
* chore: Prepare the Chat Package for Message Components
Give packages/chat a lint-only Tailwind entry so the design rules resolve the
library's theme utilities, allow the app status selectors its components carry,
expose the active language from @librechat/client, and let the locale check
accept keys that resolve through plural forms.
* refactor: Move Message Row Leaves into @librechat/chat
Move the hover style helpers, SubRow, SiblingSwitch, the elapsed timer with its
duration labels, HeaderLabel and the system event header into
packages/chat/src/components/messages, export them from
@librechat/chat/components, and point the client at the package.
* test: Cover Message Row Leaves in the Mock Harness
* chore: Drop the Chat Lint Entry in Favor of components.json
* test: Run the Elapsed Spec Against the Package
* fix: Label Composer Thinking Levels and State the One-Shot Scope
* test: Cover Composer Thinking Labels and One-Shot Scope in E2E
* test: Cover Thinking Focus for Option Lists Without Auto
* test: Wait for the Thinking Popover's Open Focus Before Arrow Keys
* test: Match the High Effort Radio Exactly
* fix: Keep the Composer Thinking Level for the Rest of the Conversation
* fix: Keep a Queued Turn's Picked Level on the Turns Queued After It
* test: Name the Numeric Reasoning Control by Its Thinking Label
* fix: Name the Queued Turn's Level on the Thinking Button
* test: Dismiss the Thinking Tooltip Before Typing on a Phone
* fix: Respect Enforced Specs and Parameters Edits Over the Inherited Thinking Level
* test: Expect the Model Spec Enforcement Flag in Chat Settings
* fix: Keep a Queued Turn Off a Level Its Target No Longer Runs
* fix: Record the Target a Queued Turn's Level Belongs To
* refactor: Inherit the Thinking Level on the Server
* perf: Answer the Branch Level Lookup Without Tree Links When Nothing Was Picked
* fix: Respect the Thinking Switch and Held Queue Rows Over the Inherited Level
* fix: Read the Branch Level Once and Inherit Only on Fresh Turns
* fix: Keep a Parameters Thinking Edit From Turning Thinking On
* fix: Withdraw a Staged Thinking Level When Thinking Is Switched Off
* fix: Scope the Thinking Switch Transition to the Conversation
* test: Drop the One-Shot Thinking Scenario the Conversation Level Replaces
* perf: Parallelize Serial Lookups on Agent Load, Discovery, Skills, and Schedules
* fix: Address Review Findings on Parallel Lookups
Stage same-level discovery results before collecting edges so a shared sibling is initialized once, bound resume snapshot fetches to small chunks so over-budget graphs stop early, and surface the first ordered image failure without waiting on later reads. Update the skill name test for bounded concurrency.
* test: Tag Existing Mock Specs as Acceptance Scenarios for Parallel Lookups
* feat: Make Parallel Lookup Bounds Configurable
Add a concurrency section to librechat.yaml for MCP catalog, skill name, skill file and resume agent lookups. Defaults equal the previous hard-coded values.
* style: Sort Imports for Configurable Lookup Bounds
* test: Match Model Spec Skill Resolution Args With App Config
* test: Close the Builder Drawer Before Chatting on Narrow Viewports
* fix: Surface Fatal Discovery Errors Without Awaiting Later Siblings
* fix: Reject Discovery on the First Fatal Load Regardless of Queue Order
* fix: Keep Image Encoding Fail-Fast With Parallel Reads
* fix: Reject Resume Snapshot Lookups Without Waiting on the Whole Chunk
* feat: Make Connected Agent Discovery Concurrency Configurable
* fix: Keep the Snapshot When the Terminal Write Settled for Reconciliation
* fix: Promote a Reconciled Compaction Snapshot to the Terminal Row
* fix: Anchor and Envelope the Reconciled Snapshot by Its Claim
* test: Cover the Abandoned Compaction Settling After Its Run in E2E
* fix: Withhold the Disconnect Snapshot of Any Durably Settled Turn
* fix: Promote Only a Same-Epoch Reconciled Snapshot and Settle Stopped Compactions
* fix: Plan the Disconnect Snapshot in packages/api and Check the Response Row Before Promoting
* fix: Read the Disconnect Snapshot Rows in the Response Conversation
* fix: Check the Anchor-Derived Error Row Before Promoting a Reconciled Snapshot
* fix: Log a Failed Disconnect Snapshot Plan Instead of Rejecting the Listener
* fix: Let a Reconciled Compaction Promote After an Earlier Live Snapshot
* refactor: Decide the Repeat Disconnect Write in the Snapshot Plan
* refactor: Report Failed Snapshot Row Reads Through the Plan
* fix: Stamp a Promoted Disconnect Snapshot and Read Its Rows Together
* fix: Derive the Compaction Error Row ID Through the Shared Helper
* fix: Plan a Saved Live Compaction Snapshot Again Once Its Turn Settles
* refactor: Queue Disconnect Snapshots and Settle Them in packages/api
* fix: Never Count the Compaction Anchor as Its Own Terminal Row
* fix: Settle Disconnect Snapshots Before Terminal Cleanup Releases the Turn
* refactor: Add the Core Chat Class With a Serial Job Executor and React Query State
* fix: Report an Attachment's HTTP Failure as a Disconnect and the Turn's Conversation on Finish
* fix: Report a Stream That Fails While It Is Read as a Disconnect
* fix: Keep an Attachment Failure a Disconnect When the Host Reducer Throws on It
* fix: Treat a Resumed Start as an Attachment and Drop a Replaced Start's Optimistic Rows
* fix: Undo the Whole Optimistic Write of a Start the Server Replaced
* fix: Give Each Optimistic Write One Rollback Record and Stop a Disposed Chat Writing State
A turn keeps its optimistic write on the active request, so a disposal before the start was sent undoes those rows as a replaced start already did, and a removed row is restored next to its surviving neighbors instead of at its old index. A disposed chat no longer moves the shared status or connection, so a listener that disposes on a rollback notice cannot leave the state reconnecting. A start that fails with ERR_INTERNET_DISCONNECTED is a disconnect like ERR_NETWORK, and the React Query state rechecks a host store that changed between a version read and its subscription.
* fix: Roll Back the Rows a Store Committed, Not the Rows the Chat Handed It
A React Query cache with structural sharing commits a changed row as a copy, so a replaced start compared its rollback record against objects the cache never held and kept the optimistic edit. The record now takes the list as the state reads it back after the write.
* fix: Record the Optimistic Rows a Store Committed Before Telling Subscribers
A listener that writes the shared state when the chat announces its optimistic write no longer lands in that write's rollback record, so a replaced start keeps the listener's rows. The record is taken before anyone is notified, and a store's report of the chat's own write waits for the chat's announcement instead of running inside the write.
* fix: Stop a Stream Event Once a Listener Disposed the Chat on Its Write
A listener that disposes the chat while an event's write is announced no longer lets that event move the shared status to streaming or reach onEvent after teardown.
* fix: Scope Optimistic Rollback to the Rows the Write Itself Changed
The rollback record kept the whole list the store committed, so a row a store subscriber appended while the write was committed was undone with the turn, and a subscriber that disposed the chat inside the write left the turn's rows behind because no record existed yet. The record now holds, by message id, only the rows the write added, replaced or removed, each under the identity the store committed it with; undo restores or drops those and leaves every other row. A dispose inside the write is undone once the record exists.
* fix: Leave a Turn Row a Store Subscriber Edited Inside the Write Out of Its Rollback
A store that notifies its subscribers synchronously can hand back one of the turn's rows already edited by a subscriber, and the rollback of a replaced start then deleted or overwrote that edit. The record now claims a committed row only when it is the written row or a structural copy of it.
* perf: Index Hot Lookups and Make Message Cursor Pagination Stable
Add narrow indexes for session refresh-token deletes, user-only tool call deletes, queued-turn delivery and reconciliation claims, agent code environment references, and updatedAt message pages. Add a TTL index to the KeyvMongo collection. getMessagesByCursor now sorts and pages on a unique (sortField, _id) tiebreaker with a millisecond-precise cursor while still accepting legacy cursors, and GET /api/messages caps pageSize in a TypeScript helper.
* fix: Keep the Message Id for the Cursor Under the Client Projection
* fix: Declare select on the Message Cursor Method Type
* feat: Make the Message Page Size Ceiling Configurable
* fix: Clamp the Default Message Page Size to the Configured Ceiling
* test: Cover Message Cursor Paging and Page Size Cap End to End
* fix: Continue Message Cursors Whose Sort Value Is Empty
* fix: Include Missing Sort Values When Paging Messages Descending
* perf: Resolve the Message Page Ceiling Beside the Ownership Read
* fix: Observe the Ownership Read While the Page Size Resolves
* style: Sort Imports in the Message Page Module
* refactor: Move Page Size Read Observation Into the API Package
* fix: Keep Missing and Empty Sort Values Distinct in the Message Cursor
* fix: Page Past Messages With a Missing Timestamp
* fix: Honor Documented Azure Model Assistants and fileConfig.stt Keys
Read the model-level Azure assistants flag from the group's models entry,
validate and merge fileConfig.stt, drop two never-read image tool env vars
from .env.example and fix the SharePoint scope example.
* test: Cover Model-Level Azure Assistants Through Config Overrides
The mock harness runs without CONFIG_REDERIVE_ENDPOINTS, so override
groups are never resolved there; cover the override path in the
resolution spec instead of e2e.
* fix: Return approved tool and generation error text instead of raw exceptions
* fix: Redact generation error text without the data-schemas helper
* fix: Redact credentials and emails from shown generation errors
* refactor: Move the Wolfram status policy into packages/api
* test: Fix the Wolfram probe constructor and jest summary match
* test: Match the jest pass count through color codes
* fix: Redact credentials a tool input error echoes from its arguments
* fix: Drop free-text fields from typed generation errors under a content policy
* fix: Keep only the code and numeric fields of typed errors under a content policy
* fix: Fence ACL Viewers and Surface Revocation Failures When Removing Shared MCP Servers
Account erasure and server deletion now enumerate users the view ACL names
directly or through a group, so viewers without a personal OAuth token are
fenced and disconnected too. Erasure runs the OAuth teardown in strict mode,
which clears local credentials and then fails when the provider refuses a
revocation, keeping the server as the retry anchor, and holds every user's
teardown fence until the server delete commits.
* test: Type the Revocation Failure Cleanup Fixtures
* fix: Renew Retained OAuth Teardown Fences Before Deleting the Server
A teardown lease lasts 15 minutes, so a large erasure could outlive the
first fences it holds. Leases can now be renewed by their owner, and
erasure renews every retained fence right before the delete, failing
without deleting when one lapsed and another writer took it.
* fix: Report Refused MCP Revocations Without Blocking Account Erasure
A provider that refuses revocation, combined with a viewer who signs in
again between attempts, could keep an erasure failing indefinitely. The
strict teardown now throws a coded MCPOAuthRevocationError after clearing
local state and handing over its fence; server removal collects those as
refusals, logs each user and token type whose grant may remain valid, and
proceeds. Local failures (token delete, fence, ACL) still fail closed.
* fix: Annotate the Revocation Error Code for Isolated Declarations
* perf: Bound client hygiene paths (lodash imports, timeouts, listener cleanup, upload concurrency)
* feat: Make client request timeouts configurable
* test: Cover the configured refresh deadline end to end
* feat: Rename client timeouts to client limits and expose upload concurrency
* fix: Keep the published refresh deadline for the next page load
* fix: Harden Timer Sweeps, SSE Writes, and Violation Counters
Guard SSE writes against ended or destroyed responses through one helper, catch and single-flight the job store and TTL cache cleanup timers, serialize in-process counter updates, cap the violation log, prune stale OAuth failure records, batch the active-job lookup, and count Redis keys with DBSIZE.
* refactor: Drop the redundant violation log entry copy
* refactor: Log single-flight sweep failures from the API package
* test: Cover active generation listing and client disconnect mid-stream
* refactor: Configure violation log retention and move title timeout into the API package
* feat: Configure OAuth failure retention through mcpSettings
* fix: Prune OAuth failures promptly under short retention
* fix: Mark the Escape that closes a Dropdown list as handled
A Headless UI dialog such as Settings closes on any Escape not already
handled, and the Dropdown list closed on Escape without marking it, so
one press closed the list and Settings together. The list now marks the
Escape it handles, so its container stays open until a second press.
* fix: Leave Escape to the container once the Dropdown list is closing
The list closes with a transition and Ariakit keeps it mounted until the
transition ends, so an Escape pressed right after a pick still reached
the list's handler and was marked handled, leaving Settings open.
The drawer collapsed on any Escape that reached the document, including
one a dialog above it had already handled, so a single press closed the
dialog and the drawer and the dialog could not return focus to its
trigger. The drawer now stands down when the Escape was already handled.
* refactor: Restyle Connected Accounts Settings Row
* test: Cover Connected Accounts States in Mock Scenarios
* test: Open Settings Through the Drawer on Mobile
Callers sized and layered Dropdown lists through ad hoc sizeClasses, while
DropdownPopup takes sameWidth, minWidth (capped to the room the list has)
and gutter. Dropdown now takes the same three, and the Settings dropdowns
move onto them and drop z-50 classes the dialog layer already overrides.
* 🪡 style: Separate Attachments from Message Bubbles
* fix: Include Attachments on Structured User Rows
* fix: Normalize Attachment Text Parts Before Trimming
* fix: Preserve Attachments on Protected User Messages
* fix: Keep Message Width Independent of Attachment State
---------
Co-authored-by: Lia <lia@librechat.ai>
Accordion, Breadcrumb, CheckboxButton, FormInput, QuestionMark,
InputWithDropdown and the Radix DropdownMenu had no users in the app or
the package. The account menu's dividers were the DropdownMenu's
separator inside an Ariakit menu; they are now the Ariakit menu's own
separators and draw the same.
The assistant picker, the assistant model field, the assistants endpoint
settings and the dynamic parameter dropdown were the last users of the
HeadlessUI SelectDropDown and its MultiSearch. Dropdown gains a muted
placeholder and an aria-invalid field state, and each field is now named
by its visible label.
* refactor: Remove Legacy Dialog and DialogTemplate from @librechat/client
The assistant delete confirmation was the last consumer of the legacy
Radix Dialog and its DialogTemplate. Move it to OGDialog and
OGDialogTemplate with the shared Button trigger, matching the agent
delete button, then drop both components, their barrel exports and the
spec entries that listed them.
* test: Cover the assistant delete confirmation dialog
* test: Match toast text exactly and clear the delete mock before cleanup
* test: Move the close-target and scrim scenarios off the removed Dialog
* feat: Let Dropdown work inside dialogs and take the field list roles
Inside a dialog the list renders in place, so the dialog's focus trap and
aria-hidden pass no longer cut it off, and it layers above the dialog. A
field Dropdown's list now takes listMinWidth, listMaxHeight and the icon
size role, and is never narrower than its trigger.
* refactor: Move the code tool selects onto Dropdown and remove Select and Combobox
The four code tool settings selects were the last users of the Radix
Select, and Combobox, its only other consumer, had none. Their tests and
the nested popover scenarios now drive the Dropdown.
* refactor: Read the Pane Conversation Through ChatSettings and Drop the Orphan Abort Scroll Atom
* test: Cover Returning to a Running Chat Through the Router
* fix: Close Gaps in the css-colors Triplet Check and the Disabled-Recipe Rule
The triplet check now reads angle channels, and the disabled-recipe rule accepts spelled recipes under the same or fewer enclosing variants, resolves cva and constant class strings, and handles spread strings, per-dim primitive coverage and implied selectors.
* fix: Read Recipe Markers Anywhere in the Variant Stack and Keep Object Spreads
* test: Cover Spelled-Out Disabled Recipes in the Design Lint Scenario
* fix: Keep Stateful Arbitrary Disabled Selectors Unrestored and Order Arbitrary Enclosing Variants
* fix: Order Enclosing Variants Whenever an Arbitrary Selector Is Present
* fix: Pin the Disabled Marker Position When Arbitrary Variants Enclose a Dim
* fix: Order Child Selector Variants Like Arbitrary Ones
* fix: Skip Unplaced Disabled Variants and Read Math Functions by Token
The disabled-recipe rule now skips utilities under arbitrary variants it cannot place instead of guessing how a recipe orders against them, and unwraps TypeScript assertions on spread and class-map recipes. css-colors classifies any innermost math function by its tokens, so rounding strategies and constants no longer hide an angle-led triplet.
* fix: Read Any Fixed Math Function as a css-colors Channel
A math function over numbers and angles is a fixed channel in any position, so unit cancellation (calc(90deg / 1deg)) needs no unit algebra, and trigonometric functions and sign are fixed whatever their arguments (atan2(1px, 1px), sign(90deg)).
* fix: Unwrap Constant Class Strings and Honor Class-Map Overrides
A const initializer under as const or satisfies is read like a plain string, and a class-map recipe entry no longer counts when a later spread or the same key can overwrite it.
* fix: Keep Angle Math Results and Disjoint Spreads Out of Overrides
An angle-valued math result stays an angle, so it reads only as a leading hue, and a later object-literal spread invalidates a class-map recipe only when it sets the same key.
* fix: Place Valued data-disabled Self Selectors in disabled-recipe
* feat: Branch Tool Fold Rails Into Each Row
Draw each open fold's rail as a trunk with a curved branch into every
row, measured from the rows themselves. Hovering a row lights the route
along the tree: out of the previous branch, along the trunk and into the
new one, at a steady pace. Layout changes under a still pointer (folding,
streaming, scrolling) re-hit-test instead of clearing the path.
* fix: Retrace the Fold Path When Its Row Moves Mid-Trip
A row that moved while the lit path was still traveling to it kept the
trip measured to its old position, so the path ran the old distance and
jumped the rest. Start a fresh trip from the path's current position
whenever the destination row moves.
* test: Cover the Tool Fold Tree With Scenario Specs
One tagged Playwright scenario per contract behavior: branches into each
row, the hover route from the header, nested folds, travel along the
tree, a click that unfolds the hovered row, reduced motion, right-to-left
mirroring and touch.
* 🧻 fix: Keep Lighthouse Session Cookies Out of Failure Logs
* ci: Use Lockfile-Pinned Chromium for Lighthouse
* ci: Align Lighthouse Browser Launch With Playwright
---------
Co-authored-by: Lia <lia@librechat.ai>
* 🧾 feat: Admin Config Write Report, Structured Issues and Deployment-Only Paths
Admin config writes dropped what the API never stores (base-only sections, interface
permissions, dedicated sections) with a 200 and no word of it, stored values nothing reads
(boot-time and operator-only settings, overrides of MCP servers librechat.yaml runs as local
processes, tombstones inside arrays), answered most 4xx without a stable code, returned
validation issues without the bound or option that failed, and refused every admin write
once the terms-acceptance modal was on for an admin who had not accepted it, including the
write that turns it off.
PUT, PATCH /fields, POST /fields/tombstone and DELETE /fields now answer with `applied` and
`skipped` (with a reason per location); a whole `interface` PATCH keeps its UI fields;
base-only paths are skipped on every route. A new DEPLOYMENT_ONLY_CONFIG_PATHS list (rate
limits, CloudFront, permission leases, OpenAPI, skill deletion, the tool filters, the agents
and MCP boot settings, `cache`) is skipped on write, kept at librechat.yaml's value by the merge
and published in GET /meta. Writes and tombstones inside a librechat.yaml stdio MCP server
answer 400 PROCESS_MCP_SERVER_OVERRIDE, and a whole-section value leaves those servers out.
GET of a document lists what the merge leaves out of it (`ignored`, `ignoredBasis`).
Validation issues carry allowlisted `params`; each refused allowedAddresses entry is one issue
with a `reason`; agent recursion limits must be whole numbers of at least 1, and the runtime
ignores any other value. The config handlers' 4xx carry a `code`, the capability middleware adds
AUTH_REQUIRED/FORBIDDEN, and the admin config router opts out of the terms gate. PATCH checks a
section manager on every section it names, skipped entries included, as /changes does. New meta
flags: writeReport, issueParams, adminTermsExempt.
* 🧪 test: Expect Issue Params in the Whole-Document Override Validation Scenario
Validation issues now carry `params` (here the expected and received types), so the scenario that
asserts the exact issue list for a rejected PUT expects them too.
* 🧪 test: Cover Merged Read Codes, Tenant-Scoped Read Reports and Deployment-Only Resolution
Profile writes are judged in the tenant partition the profile merges in. For a role, or a
caller inside a tenant, that is the caller's partition. For a group or user profile written by
an admin without a tenant, it is the stored document's tenant: PUT, PATCH and POST …/changes
validate on librechat.yaml as that tenant resolves it with that tenant's __base__ over it, use
the same Base for the recheck after commit and for key binding, tombstones and field deletes
judge re-entry on that tenant's librechat.yaml, and every route reports `ignored` over that
tenant's Base. Each attempt reads the document in that partition only, and a document that
moved partition while the write ran answers 409 CONFIG_VERSION_CONFLICT. The config store's
partition rules are unchanged; another tenant's Base is read in that tenant's context.
Deleting a group, role or user clears the config caches when it removes or restores the
principal's profile (`invalidatingConfigStore`), awaited before the response and broadcast with
Redis as config writes do; a call that rejects clears too, since it may have committed.
POST …/changes lets `unset` remove any part of a top-level section configSchema does not
define; the section's own `unknown_section` issue is no longer blamed on the removal, and every
other op there still answers 400 UNKNOWN_SECTION.
POST /api/admin/config/reload, for an admin without a tenant holding broad manage:configs (a
tenant admin gets 403, since the reload reaches every tenant), runs the config cache clear without
a write, loads librechat.yaml again on the answering instance, and once it loaded publishes the
clear over Redis so every other instance loads the file on its next read. It uses
ConfigCacheInvalidation.reload, which reports the clear, the load and the publish instead of only
logging a failure (writes keep `invalidate`, which leaves the load to the next read). It answers
200 `{ success: true, broadcast }`, `broadcast` false without Redis; 422 CONFIG_RELOAD_INVALID
with each schema issue's location when the loader refuses the file, keeping the last good config
and publishing nothing; 500 CONFIG_RELOAD_FAILED when a clear fails or the config cannot be built
from the file; and 503 CONFIG_RELOAD_BROADCAST_FAILED when this instance reloaded but the publish
failed, since an instance that misses the broadcast keeps its cached librechat.yaml, which never
expires. Every reload that runs is audited as `config.reloaded`, a failed one with outcome
`failure` and its code. The meta reports `features.reloadRoute`. Writes still reload the file.
The e2e content-filter helper uses the route instead of a sentinel profile.
docs/mcp-overrides.md describes the current timing: the awaited clear, the Redis broadcast, what
still waits for a TTL, that a process the clear misses keeps its old librechat.yaml, and hiding
as an access boundary at checkout.
* fix: Theme the Retry Action Radius and the Select Arrow
* fix: Keep the Select Indicator Visible in Forced Colors
* test: Cover the Select Arrow Following the Text Color
* fix: Hide the Scrollbar on the Web Search Source Rails
The three horizontal rails carried a class Tailwind 3 never generated, so they still draw a scrollbar. They now use the app's hide-scrollbar helper; the links inside stay focusable, so the rails stay reachable by keyboard and touch.
* fix: Keep the Source Tab Panel Off the Suppression Backlog
* test: Cover the Web Search Source Rails Scrollbar and Keyboard Reach
* test: Force the Source Rail to Overflow Before Reading Its Scrollbar
* 🫳 fix: Close the Mobile Drawer When Selecting the Current Chat
* test: Date the Current Chat in Populated Drawer History
---------
Co-authored-by: Lia <lia@librechat.ai>
* 🗻 fix: Keep Long Chats Stationary Under the Mobile Drawer
* fix: Preserve Pane Stacking Below the Drawer
---------
Co-authored-by: Lia <lia@librechat.ai>
* 🪜 fix: Base-First Config Precedence, Profile Lifecycle and Role Renames That Keep Their Profile
Config documents merge in one total order (`compareConfigPrecedence`): Base (`role` /
`__base__`) first whatever its priority, then ascending priority, then role < group < user,
then document `_id`. The merge, `getApplicableConfigs` and `listAllConfigs` all use it, so a
tie no longer goes to the newest document whatever its type, and Base no longer outranks a
profile through its priority. A profile that writes fields of a librechat.yaml MCP server
therefore undoes a Base hide of that server for its principals. A write that creates a document
without a priority gives it its principal type's default (role 10, group 20, user 100, Base 0),
and a write that omits the priority keeps the stored one, so a broad PUT no longer resets a
profile to 10. Langfuse writes no longer pass a priority.
Profile writes (PUT, PATCH `/fields`, POST `/changes`) validate on librechat.yaml with the
active Base document resolved over it (`resolveRawConfig`, the fold the merge itself runs), so
a role write that is valid where it lands is accepted and one the merge would strip is refused.
Base still validates on librechat.yaml alone, an inactive Base is ignored, and `/changes` still
judges what librechat.yaml itself defines on the raw YAML.
`PATCH /api/admin/config/:principalType/:principalId/priority { priority, expectedRevision? }`
sets only the priority, for broad `manage:configs`, keeping overrides, tombstones and
`isActive`; it is audited as `operation: 'priority'`. A write that would create a principal's
first document (PUT, PATCH `/fields`, POST `/fields/tombstone`, POST `/changes` including a dry
run or a priority-only batch) answers 404 `PRINCIPAL_NOT_FOUND` unless the role (exact name),
group or user (lowercase ObjectId) exists in the caller's tenant partition, or at platform
level outside a tenant (`principalExists`). Each route checks inside its compare-and-swap
write, against the document the write replaces; the tombstone route now plans its write like
the others, so `AdminConfigDeps` no longer takes `tombstoneConfigField`. A PUT with
`expectedRevision: 'absent'` creates the profile even when it carries no overrides.
Renaming a role moves its config profile, system grants and ACL entries to the new name in the
caller's tenant partition. The profile moves through the store contract (`movePrincipal`: a
create-only copy, then removal at the copied revision). A profile already at the new name
answers 409 `ROLE_CONFIG_CONFLICT`, and any failed step rolls back the users, the role document
and every move (500 `ROLE_RENAME_FAILED`). Profiles, grants and ACL entries that renames made
before this change left at an old name are neither moved nor removed, and a role created under
that name still picks them up. The Base principal id is a reserved role name (400
`ROLE_NAME_RESERVED`), and a legacy role by that name never moves or deletes Base. The admin
config meta reports `deterministicPrecedence`, `priorityRoute`, `principalCheck` and
`roleRenameMovesProfile`.
* 🧪 test: Give the E2E Reload Sentinel a Role of Its Own
Admin config writes now answer 404 PRINCIPAL_NOT_FOUND for a principal that does not exist, so
the content-filter helpers' reload sentinel (a made-up user id) could no longer write and every
spec that reloads librechat.yaml failed. The sentinel is now a role the helper creates once (409
when it already exists) and deletes after its profile in cleanup; no user is a member, so its
empty profile changes no one's config.
* 🛟 fix: Keep a Moved Profile Whose Removal Cannot Be Confirmed, Validate on the Caller's Base and Restore Rolled-Back Descriptions
- `movePrincipal` no longer treats a failed read-back of the source, after its removal
failed, as the source still being there. It keeps the copy, which may be the only one
left, and rethrows the removal's failure instead of deleting the copy.
- Profile writes read the Base validation floor from the caller's tenant partition, so a
caller without a tenant validates on the platform-level Base and never on a tenant's.
- A role rename that rolls back gives a role stored without a description the schema
default back, instead of a `$set` of `undefined` that kept the new description.
* 🧭 fix: Scope Profile Priority Changes to the Caller's Tenant Partition
`setConfigPriority`, behind PATCH `/api/admin/config/:principalType/:principalId/priority`,
read and wrote through the unpartitioned config store. A platform-level admin without a
tenant runs in the default non-strict context, where the tenant-isolation plugin adds no
predicate, so the route could reorder a tenant's profile for the same principal, and answer
with it, when no platform-level profile existed.
It now runs on the partitioned operations that the role rename and the partitioned
`findConfigByPrincipal` use. The read is limited to the caller's partition: that tenant's
document, or without a tenant only a platform-level one (no tenant, `null` or `''`). The
write is pinned to the `_id` of the document that read returned. A tenantless caller
therefore gets 404 `CONFIG_NOT_FOUND` for a profile only a tenant holds. An
`expectedRevision` naming such a profile gets a revision conflict and changes nothing.
Tests: `config.spec.ts` (data-schemas) adds "setConfigPriority in the caller tenant
partition". It covers the platform profile changing alone, a profile that only a tenant holds
being neither changed nor returned, and only the active tenant's profile changing inside a
tenant. The tenant helpers are now shared with the rename suite.
`config.precedence.integration.spec.ts` adds the same check through the handler. With the old
wiring, a tenantless PATCH of a profile only tenant-a holds answers 200 and moves tenant-a's
profile to 40. With the fix it answers 404 and tenant-a keeps 10.
* 🧷 fix: Roll Back Only What a Rename Changed and Validate Profile Writes on the Base They Land Over
- Grant moves report what they changed (re-keyed grants, and superseded grants whose removal
was confirmed); the undo re-keys only grants still at the new name and re-creates a
superseded grant only while the new name still holds the grant that superseded it, so a
grant revoked during a rename is never resurrected.
- The Mongoose binding settles a create whose acknowledgement was lost by the `_id` it chose
(found at version 1: committed, returned), as the store contract now requires; a profile
move whose copy committed finishes instead of leaving an orphan copy. The memory engine and
the conformance suite cover it, plus a copy that cannot be withdrawn being logged.
- A rename rollback moves back only the profile it moved (by identity, edits included), puts
back only members still on the new name, and reverts the description only while it is still
the one the rename set.
- PUT, PATCH /fields and POST /changes read Base beside the profile on every attempt and read
it again once the write commits; a write that Base changed under is judged on that Base and
withdrawn (only at the revision it wrote) when it fails there.
- The priority route rereads a lost race's current revision in the caller's tenant partition.
* 🔐 fix: Apply Base Config Overrides Before Sign-In and Refuse Script Policy Links
Sign-in decisions made before the user is known now read librechat.yaml plus the `__base__`
override of the request's tenant, or of the deployment outside a tenant, and fail closed
(`resolvePreAuthAppConfig`). Registration, the first phase of password reset and the first
email-domain check of the LDAP, OpenID, SAML and social strategies use it. The second check
applies the account's role overrides with or without a tenant, and a new account is checked
against the role it will be created with before anything is inserted. OpenID checks again when
the admin claim or role sync changes the role. Password reset issues no link when the
account's config cannot be read.
The signed-out `GET /api/config` serves Base `registration.socialLogins` and the pre-login
interface fields (`resolvePreLoginAppConfig`), falling back to librechat.yaml when overrides
cannot be read. `turnstile` becomes a base-only section, so Turnstile comes only from
librechat.yaml.
Config reads that merge documents stay in one tenant partition (`tenantPartition`, Mongoose
binding `tenantPartitionFilter`): the active tenant's documents, or the tenantless ones outside
a tenant. The config store's Mongoose binding reads, writes, lists and restores role documents,
`__base__` included, in that partition, and its `listActive` draws every document from it;
group and user documents stay addressed by id. Only a `list` with `acrossTenants` reads every
partition, which `listConfigTombstones` uses so the startup MCP tombstone report still names
each tenant's documents. The tenant-isolation conformance suite gains single-partition cases.
Privacy policy and terms of service `externalUrl` must be http(s), `mailto:`, `tel:`, relative
or blank (`isSafeLinkUrl`). Admin writes of another scheme are refused, a librechat.yaml link is
dropped with a warning at load, a stored one is dropped at merge, and every payload and the
client remove one that reaches them. The admin config meta reports
`features.preAuthBaseOverrides: true`.
* 🧪 test: Layer a Required-Field Override Through interface.currency Instead of Turnstile
Turnstile is set in librechat.yaml only now, so profile overrides of it are skipped and the
layering scenario could no longer see a role's Turnstile options completed by a user's site key.
The scenario now layers `interface.currency`, whose `code` and `rate` are both required: the role
stores only the rate, the user only the code, and /api/config serves both.
* 🛂 fix: Admit a First OpenID Login Under Its Claimed Role Before Creating the Account
The admin-role claim and role sync are now decided before a first-login OpenID account is created, and createUserOnce admits the email under that role's config, read in parallel with the USER role's, before inserting anything. A login the claimed role refuses creates no account and no start balance. Admitted logins are unchanged: the account is still created as USER (now explicitly), moved into the claimed role, re-checked and audited as before, with the claims decided once. An account a concurrent first login created gets the claims decided again for its own role and tenant.
* 🗄️ refactor: Portable Admin Config Store with Revisions, Key Encoding and Coherent Writes
Admin config writes went straight to MongoDB with dotted-path `$set`, `$unset`, `$pull` and `$addToSet`, and nothing checked `configVersion`. That caused six problems.
* 🔁 fix: Reload librechat.yaml on Admin Config Writes
Base-only sections such as `filters` and `messageFilter` live only in librechat.yaml, and an admin
config write was how a running server picked up an edit to them. The coherent-cache change limited
admin-write invalidation to the override and MCP caches, so the YAML base was never re-read after
startup: the content-filter e2e suite, which activates filters by editing the YAML and writing a
reload sentinel, saw `filters: undefined` from GET /base and every activation timed out.
Admin config writes clear the YAML base config again, alongside the override and MCP caches, and
the clear is broadcast with the others, so every instance reloads its YAML. The reload keeps the
last good config on failure and republishes the tools derived from it, so the global tool cache is
left for it to overwrite rather than emptied first.
* 🧭 fix: Cap Dotted Field Path Depth and Hold Revision Preconditions on No-Op Writes
A dotted fieldPath was split without the 32-segment cap that segments already had, so a deep path reached the recursive path writer and failed with a 500. Both spellings now share MAX_CONFIG_PATH_DEPTH and answer 400 CONFIG_PATH_INVALID / too_deep on PATCH, tombstone and DELETE /fields.
Writes reduced to nothing (protected interface permissions, base-only or dedicated sections) answered 200 without checking expectedRevision. They now compare it with the stored document and answer 409 CONFIG_VERSION_CONFLICT with currentRevision on a mismatch, as the write itself would.
* 📡 fix: Retry the Config Invalidation Subscription When Redis Comes Back
A SUBSCRIBE that failed at startup (Redis unreachable, the client's retries spent) was only logged, and ioredis resubscribes only to channels it has joined, so the instance missed every other instance's config invalidation until it restarted. The subscription is now sent again each time the subscriber becomes ready until one succeeds; after that the client's own resubscribe takes over, and closing stops the retries.
* 🔁 fix: Drop YAML Reloads and Merges Overtaken by a Config Write
Admin config writes clear the YAML base config on every instance, so a write is how a running
server picks up an edit to librechat.yaml. Two races could undo that:
- A base reload that read the old YAML before a write's clear cached it after the clear, and the
base has no TTL, so the old base was served until the next write.
- A request that read the old base before the clear, and was still resolving principals, cached
its merge under the new override generation for the override TTL.
The config service now keeps a base-config generation that `clearAppConfigCache` bumps. A reload
publishes the base, the tools and the last good config only if its generation is still current,
a read after a clear never joins a reload started before it, and the newer reload starts once the
stale one settles so the loader's process-wide side effects end with the newest YAML. Merges
capture the generation, base included, before they read the base config.
Tests:
- service.spec: a clear during a reload (stale success, stale failure, a read waiting on the newer
reload) and a merge built on the pre-clear base.
- invalidation.redis.spec: a write on one instance makes another reload librechat.yaml.
- admin-config-reload.spec (api): every admin config write route, through the real router,
handlers, database and config service, reloads librechat.yaml; a request with nothing to write
does not.
- invalidateConfigCaches.spec no longer asserts an order the parallel clears do not have.
* 🧬 fix: Encode Config Keys in Objects Built in Another Realm
The key encoder treated an object as plain only when its prototype was this realm's
Object.prototype, and returned any other object unchanged, keys and all. Under Jest,
structuredClone (which the secret pipeline uses) returns objects from the host realm, so the
items of an array the pipeline had cloned, such as Azure groups or custom endpoints, reached
the engine with their dotted keys raw. Node in production has one realm, but the encoding must
not depend on prototype identity: a skipped object stores its dotted keys raw without an error.
A plain object is now one whose prototype is null or a root Object.prototype from any realm.
The encoding spec covers an object built in a vm context.
* 🧪 test: Check Dotted Record Keys Reach the Store's Whole-Document Write
dev's admin config route test asserted the keys on patchConfigFields, which the handlers no
longer call; it now asserts them on the draft writeConfigDocument receives.
* 🚩 feat: Publish the expectedRevision, prunesEmptyParents and awaitedInvalidation Config Flags
GET /api/admin/config/meta now reports the three write-coherence behaviours this branch
implements, so an admin client can drop the workarounds each one replaces:
- expectedRevision: responses carry `revision`; PUT, PATCH /fields, POST /fields/tombstone and
PATCH /active take `expectedRevision` in the body and both DELETE routes in the query. A
mismatch answers 409 CONFIG_VERSION_CONFLICT with currentRevision, a malformed value 400
INVALID_EXPECTED_REVISION; unpinned writes re-read and re-apply up to 3 times.
- prunesEmptyParents: a field delete or tombstone removes the objects it empties, stopping at
arrays; shells-only documents count as empty for assign-only lifecycle calls.
- awaitedInvalidation: writes answer after the config caches are cleared (broadcast with Redis),
GET /base bypasses the merged-config cache, and a merge read before a clear is never cached.
meta.spec probes each one against the behaviour: a stale and a malformed precondition on a
PATCH, the store operations' unset and tombstone on nested objects and an array element, and a
held invalidation, the GET /base read options and a merge raced by a clear.
* 🔀 fix: Keep Config Keys Raw Where the Engine Stores Them, So Older Servers Read Them During Upgrades
Servers before the key encoding (v0.8.9-rc1 among them) read every override key literally.
The Mongoose binding encoded every write, so during a rolling upgrade the first write from an
upgraded server turned a stored `gpt-4.1` or Bedrock inference profile into `gpt-4%2E1` for
every server not yet upgraded, and an older server's restore of a deleted group or role
config dropped the `keyEncoding` marker its schema lacks, after which upgraded servers read
the encoded keys literally.
The binding now sends keys raw first and encodes them only when the engine refuses a raw
field name (DocumentDB, Cosmos, FerretDB or MongoDB 4.4 for `$` names): the refused write
changed nothing, so it runs again encoded under the same revision precondition, and that
process encodes later writes holding such keys directly. MongoDB 4.4+ stores dotted names
(5.0+ also `$` names inside a value), so there an older server reads exactly what it wrote. A
document whose raw keys spell escape sequences while none holds a raw `.`, `$` or NUL is
still written encoded, since a raw read would decode it. A raw write clears the marker.
Reads decode a marked document (raw keys an older server added beside encoded ones, or wrote
under a marker it left, carry no escape sequence and read as stored) and an unmarked one
unless some key holds a raw `.`, `$` or NUL, which no encoded document does; that reads an
encoded document whose marker an older server dropped. Encoding stays in the binding for
every engine that needs it (decision #15); the residual cases are in documentdb-compat.md.
* ⏱️ fix: Remove Config Cache Writes a Clear Overtook in Flight
With an asynchronous APP_CONFIG store (Redis or a custom Keyv store), a clear can bump the
generation and finish its delete after a reload or merge checked the generation but before its
`set` landed. The older value then repopulated `_BASE_` until the next write, or a merged
config for the full override TTL.
The base reload, the last-good restoration and the merge cache now check the generation again
once their write lands and delete what they wrote if a clear overtook it. A deleted entry only
costs the next read a reload or a merge; a newer base load cannot be removed this way, since it
starts only after the stale one settles.
* 🔑 feat: Keep Dotted Record Keys in Admin Config Writes and Publish the Config Contract
Keep dotted record keys in admin config write bodies behind a path-scoped
sanitizer, reject $-prefixed and prototype keys after auth, report dotted_key
issues with segments, and publish GET /api/admin/config/meta (features, rules,
limits, versions) so clients can gate on backend capabilities.
* 🧪 test: Expect Issue Segments in the Config Override e2e Scenario
Override validation issues now carry `segments`; assert the full issue shape.
* 💉 chore: Upgrade Node.js to Security Release 24.22.1
* test: Enable Enter Submission in Native Acceptance
* test: Use the Machine Picker in Native Acceptance
---------
Co-authored-by: Lia <lia@librechat.ai>