* refactor: Move the useChat Facade and ChatContext into @librechat/chat/react
The facade, ChatContext, the chat contract types and the resume request atom now
live in the chat package. The message cache subscription and the app's tool
outcome rules reach the facade through the contract, and useChatHelpers reads
its pane conversation through ChatSettings instead of the app store.
* fix: Key Cached Message Views on the Host's Tool Outcome Rules
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
* 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.
* feat(prompts): sync Langfuse prompts into the catalog
* refactor(prompts): compose the Langfuse prompt sync runner outside the admin handler
Add createLangfusePromptSyncRunner, which binds the lock, the prompt-group
methods, the ACL grant and the Mongo error predicates once and returns a
runner that takes the per-request source, connection-bound listPrompts,
lock lease and page cap. The admin handler receives that runner as one
dependency instead of forwarding its parts, and its config method
signatures return a LangfuseAdminConfig interface in place of Mongoose
document types.
In api, api/cache/distributedLock.js creates the one DistributedLock for
the process and api/server/services/LangfusePromptSync.js composes the
runner once with it; the admin route imports the composed runner.
* fix(prompts): report incomplete Langfuse syncs and gate the sync action
- Refresh the prompt-group and effective-permission queries after a failed
sync too, because earlier imports can already be committed.
- Return `complete: false` when the page limit stops a sync before the last
upstream page, and show a warning instead of the success message.
- Show the Sync prompts action only to users with `manage:prompts`, the
capability the sync route requires. Resolve the Langfuse startup-config
capabilities in one batched lookup.
- Document that an interrupted import can leave a group without its initial
PUBLIC grant, and that a page in progress can outlast an expired lease.
---------
Co-authored-by: Rebase Probe <probe@example.com>
Reject edits, deletes, new revisions, promotion and revision deletes on
prompt groups whose source is not native with a read_only service error,
mapped to 403 "Externally managed prompts are read-only". The guard reads
the stored group, so the MANAGE_PROMPTS bypass is covered. Sharing,
usage counts and resolution are unchanged.
The client hides Edit and Delete for external groups, shows a read-only
detail view with a Langfuse notice and keeps Share.
* feat(prompts): add source identity to prompt groups
Add source, sourcePromptName, sourceProjectId and sourceDestination to
PromptGroup. productionId is required only for native groups. A unique
partial index on the source identity covers only groups that have
sourcePromptName, so native groups need no migration.
The create path drops client-supplied source fields, and the native
create upsert does not match langfuse groups. Records map a missing
source to native.
* fix(prompts): centralize sources and restrict native group matching
* feat(langfuse): test prompt listing and resolution from settings
Add a dry-run dialog in Settings > Langfuse that lists Langfuse prompts
and resolves one text prompt (production label or an exact version)
through the tenant's Langfuse connection. Nothing is written. A tenant
user's prompt reads never use the central env keys, even while
TENANT_ISOLATION_STRICT is off.
DevOps makes the feature available with LANGFUSE_PROMPT_SYNC_AVAILABLE
(timeout LANGFUSE_PROMPT_SYNC_TIMEOUT_MS). The tenant admin turns it on
with langfuse.promptSync.enabled.
Related: Linear AI-2271, ClickHouse/ai#4032
* fix(langfuse): isolate prompt credentials and expose prompt settings
Use stored credentials with deployment headers for prompt reads.
Show the settings tab when connection editing or prompt sync is available.
Keep connection controls and trace links under their existing gates.
Audit prompt-sync updates and reuse shared prompt response types.
* 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: 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.
* feat: Keyboard Submit and Escape for Tool Approval Cards
The reject reason and response fields submit by the composer's Enter
rules, the JSON edit field submits on Ctrl/Cmd+Enter only, and a submit
shortcut rebound off Enter works in all three. Escape in the composer
review panel collapses it and returns focus to its toggle, as does the
Collapse button. The no-host binding default moves into
useComposerBindings so the ask and approval cards share it.
* test: Cover Tool Approval Keyboard Control in E2E Scenarios
* fix: Match the Composer Submit Chord in the Approval JSON Field and Guard Safari IME Escape
* fix: Mirror Page Components For RTL Layouts
* fix: Keep the Project Workspace Panel Group LTR Under RTL
The workspace reversed its panels under RTL but left the group inheriting the document direction, so the flex row reversed them again: details stayed on the left and the separator dragged backwards. Add RTL scenarios for the project workspace, shared artifacts pane and marketplace category tabs.
* fix: Drop the Conflicting RTL Margins on the Agent Detail Close Button
The logical -me-2 already pulls the button to the inline end, so the leftover rtl: overrides pushed it into the header under RTL.
* test: Drag RTL Separators in Pointer-Sized Steps
* fix: Keep Input Adornments on the Side Their Field Reserves
* fix: Remount the Project Workspace Separator When Direction Changes
* test: Cover RTL Separator Keys and the Prompt Counter
* fix: Remount the Shared Artifacts Separator When Direction Changes
* test: Open the Prompt Counter Scenario From the Create Dialog
* test: Allow Sub-Pixel Rounding Beside the Prompt Counter
* fix: Inset the Prompt Name From Its Inline Start
* test: Open the Scrim Spec's Row Menu by Focus
The row's menu button mounts on row hover or focus. When this spec shares a
worker with specs that leave a streaming chat in the sidebar, the list
remounts rows under the pointer and the hover never mounts the button. The
leak is pre-existing and tracked separately; this spec now focuses the row it
seeded and repeats the focus until the menu button holds it.
* refactor: Move the Resumable Generation Start Into the Chat Core
* fix: Call a Host Transport's Start on the Transport Itself
Forwarding transport.start as a bare function rebound this to the resumable host, breaking any host transport whose start is an instance method.
* test: Cover Interface and Chat Direction Scenarios
* test: Pin the Default Textarea Direction to Auto
* refactor: Keep the Chat Direction Preference in Jotai
* test: Drive Direction Scenarios Through Phone Settings and a Held Bundle
* fix: Mirror Chat Surfaces For RTL Layouts
* fix: Keep Short Subagent Ticker Lines at Their Reading Start
Adds RTL chat scenarios covering code, markdown blocks, sibling arrows and virtualized lists.
* fix: Resolve Quote and List Direction From Their Content
dir=auto skips descendants that carry their own dir, so a quote or loose list holding dir=auto paragraphs always resolved left-to-right. Lists now take one direction so markers and indent stay on the same side.
* fix: Keep Tables, Callouts and Trace Axes on One Direction
Tables take one direction from their content so cell borders share a frame; strong-direction detection skips Arabic-Indic digits, separators and marks; handoff and answer callouts use a logical start border; trace tick and range labels stay on the LTR axis.
* fix: Treat Every Script's Letters as Strong Direction
Direction detection now keys on Unicode letters, so Devanagari, Thai and other LTR scripts resolve LTR. E2E specs that selected rows by pl-6 now select ps-6.
* test: Cover the Shared Strong Direction Helper on Its Own
* fix: Read Bidi Marks and Native Script Digits as Strong Direction
* fix: Approximate Bidi Classes by Block So Symbols and Numerals Resolve
* fix: Resolve Strong Direction From Unicode Bidi Class Tables
* docs: Note How the Bidi Tables Are Generated and Where They Differ
* fix: Generate the Bidi Tables From Unicode 17 Including L-Class Marks
* fix: Anchor Sidebar, Drawer and Panels to the Inline Edges in RTL
* test: Cover the Mirrored Shell in RTL with Scenario Specs
* test: Wait for the Sidebar Width Transition Before Dragging
* test: Cover a Live Switch to RTL With the Artifacts Panel Open
* fix: Follow the Interface Direction in Radix, the Composer and First Paint
Wrap the app in a Radix DirectionProvider driven by i18n so Tabs, Select and
menus stop rendering LTR subtrees in right-to-left locales, and swipe toasts
toward the inline end.
Chat direction becomes auto, ltr or rtl (auto by default; stored LTR/RTL
values are kept). The composer applies a forced direction as a dir attribute
instead of reversing rows, which double-flipped under an RTL document, and the
text fields default to dir=auto. The unused Jotai chat direction atom that
pinned every TextareaAutosize to ltr is removed.
index.html sets dir before first paint, and the language setting no longer
races i18n over document.lang.
* fix: Keep the Empty Composer Placeholder on the Interface's Reading Edge