* 🛖 fix: Scope OAuth Binding Cookies to the Public API Path
* fix: Canonicalize OAuth Callback and Cookie Paths Together
---------
Co-authored-by: Lia <lia@librechat.ai>
* perf: Virtualize the My Files Table
* fix: Even Bottom Spacing Under the Compact Context Button
* feat: Overlay Tool Output Copy Actions and Show Full Output
* fix: Scroll the Virtualized My Files Table Itself and Expose Row Positions
* test: Scenarios for Tool Output Copy Reveal and Full Output
* test: Tab Through the Output Box to Reach the Copy Action
* fix: Open Terminal Output on Its Last Lines
* fix: Follow Streamed Terminal Output Only While the Reader Is at the Bottom
workflowSelectsWhatItFilters() split .github/workflows/static-checks.yml
with $-anchored multiline patterns, so on a Windows checkout with
core.autocrlf the trailing \r kept every pattern from matching and the
Design-rule suppressions gate failed every commit.
Parse through workflowFilters(), which normalizes line endings first, and
check in-script that the CRLF rendering reads the same lists, so CI on an
LF checkout catches a parser that only reads LF.
* ♻️ refactor: Native prompts behind a shared service and adapter
* test: Bound Slow Mongo Fixture Startup and Guard Cleanup
---------
Co-authored-by: Lia <lia@librechat.ai>
The SMTP transport options set `requireTls`, but nodemailer only reads
`requireTLS`, so the key was ignored. With EMAIL_ENCRYPTION=starttls,
a server that does not offer STARTTLS received the message over an
unencrypted connection instead of the send being refused.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat: Size roles for the shared primitives
Button's xs, lg and icon squares, the large title input, the checkbox, menu, select and dialog icons and the switch's hit area read new size roles whose defaults are the fixed sizes they drew, and the menu row corner reads radiusLg. The ClickHouse theme takes Click UI's single button size, its small icon button and its checkbox and icon sizes. A spec pins the strict count of theme-driven primitives at eight of ten and what the other two still hard-code.
* fix: Hold the switch hit area to the target minimum in width and scan stylesheet colors
* test: Read every raw palette hue in the primitive guard
* test: Exempt only theme role fallbacks in the primitive guard
* feat: Tab minimum width role and a wider fixed-size guard
The primitive guard now also reads absolute arbitrary sizes, ring-offset palettes and 4 and 8 digit hex colors. The Tabs trigger's 100px minimum becomes the tabMinWidth role, which the ClickHouse theme sets to 0 so tabs size by their label as in Click UI.
* fix: Keep app icon buttons and their companions on the button size role
The passkey rename input keeps the field height, and the agent builder panel headers size their back button and balancing spacer from size-theme-button, so a theme that changes the button height keeps those rows aligned.
* fix: Size menu glyphs from the icon role and floor touch targets at the minimum target size
* fix: Let menu glyphs fill their slot and keep the dialog close target at the minimum size
* test: Probe the menu glyph inside a flex row, as DropdownPopup renders it
* fix: Hold icon button squares to the minimum target size
* fix: Bound the icon and checkbox size roles to the room their layouts leave
iconSize takes 0.75 to 1.25rem, iconSizeLg 1 to 2rem and checkboxSize 1 to 1.5rem, so a theme can retune them without shrinking a checkbox below the box it was or pushing an icon past the inset it sits in.
* fix: Hold the icon-only Dropdown and header spacers to the minimum target size
* fix: Floor the button size roles at the target minimum and let callers replace the control height
* test: Move the unknown appearance markers off the new title field height
* fix: Size the compact step, the exported Dialog and the combobox icons from roles
The Button and Dropdown compact recipes read a buttonHeightCompact role, the exported Dialog's action buttons and close glyph read buttonHeight and a bounded iconSizeMd, Combobox icons follow iconSize, and the checkbox callers drop their fixed sizes so checkboxSize reaches them. minTargetSize may no longer exceed buttonHeight or fieldHeight, so the target floor never pulls icon buttons out of line with the fields beside them.
* fix: Size the collapsed Combobox square from the control height role
* fix: Hold every Button size and the collapsed Combobox to the target minimum
* fix: Let section header buttons keep their own text height
* test: Treat a zero size as a reset in the primitive guard
* fix: Enforce the target size at the roles instead of on every Button
A minimum height on every Button size grew callers that draw a smaller control on purpose, such as the sortable table header (h-auto) and the 20px artifact and attachment row actions. The floors come off the Button sizes and icon squares; a theme that sets minTargetSize may instead not size any button or field below it, and the new Button size roles keep their 24px floor.
* fix: Check the control and large field heights against the target floor
* fix: Hold the target floor at a fixed 24px and floor the large field height
* fix: Keep the passkey rename field on the button height and drop the fixed MCP checkbox size
* fix: Size the Combobox check glyph from the icon role and scope the README floor claim
* 🪢 feat: Collapse Activity Folds From Their Rails
Hovering an open fold's rail lights the line and swaps the header's glyph for a collapse knob; clicking the rail collapses that fold and brings its header back into view.
* fix: Stabilize Fold Rail Hover and Header Reveal
* fix: Reserve the Chat Toolbar When Revealing Folds
---------
Co-authored-by: Lia <lia@librechat.ai>
* feat: Serve Built-In Endpoint Model Lists From Config So Principal Overrides Can Narrow Them
OpenAI, Google and Anthropic model lists came only from *_MODELS env vars,
which are global, so a role or group override could not narrow them. A
configured endpoints.<name>.models list now replaces the env list and is read
from the per-request config, matching Bedrock.
* fix: Skip OpenAI and Anthropic Model Discovery When a List Is Configured
* feat: enforce required two-factor authentication
Require local and LDAP accounts to enroll in TOTP before they can use the
app when ENFORCE_TWO_FACTOR_AUTHENTICATION is set. Sign-in, refresh, bearer
verification, optional share auth and image authorization all route an
unenrolled account into a staged setup flow, and every bearer credential
minted before enrollment or a password reset is retired.
Password reset retirement uses the existing credentialsChangedAt stamp, and
commitPasswordReset clears any staged enrollment in the same write. Passkey
sign-in follows the same enrollment gate as password sign-in.
* test: cover passkey sign-in handing off to required enrollment
* refactor: keep Mongoose user types out of two-factor auth contracts
* fix: withdraw a minted session when its retirement recheck fails
* fix: hold Agent API keys and the reset CLI to the required two-factor policy
* fix: adopt a setup token handed off after the setup screen mounted
* fix: move every tab that receives an enrollment hand-off into setup
* fix: read the enrollment gate's retirement cutoff in system scope
* fix: clear minted session cookies before the fallible session deletion
* fix: adopt a setup token persisted before the setup screen subscribed
* feat: Click UI spacing and mono stack for the ClickHouse theme
The ClickHouse theme sets spaceCompact and spaceNormal from Click UI's spaces.2 and spaces.3 and takes Click UI's mono stack verbatim. The drift guard cites all nine Click UI spaces, each drawn by a spacing role or an equal Tailwind step, and the mono family now compares in full.
* test: Pin the Click UI spaces against the compiled steps and the ClickHouse compact spacing
* feat: Field fill and ink theme roles
Fields ink their value in a new field-text role, which follows text-primary, and a theme whose fieldFillStyle appearance role is fill paints them in a new field-fill role, which follows surface-primary. The default transparent style keeps every field clear, read from the nearest themed root through a style-query variant. The ClickHouse theme fills and inks fields with Click UI's field tokens, which empties the not-expressible list.
* fix: Ink the TimePicker value in the field role and type the field colors
* fix: Keep field ink and state fills over the field fill
Field-variant Dropdown triggers no longer swap to the primary ink on hover, and the field fill variant carries a single class's weight so hover, open and disabled fills paint over it.
* test: Count the field roles beside the media overlay roles
* fix: Type the color fallbacks as one object and keep a disabled field's fill under the pointer
resolveTheme spread about twenty fallbacks typed as role-or-empty unions; each union spread doubled the type checker's work, and the field roles pushed the client typecheck past the CI heap. Typing them as IThemeRGB drops its memory from 3.3GB to 0.65GB. A fill theme with the default dim disabled style also keeps a disabled field's fill under the pointer.
* 💬 feat: Conversation Starters in Agent Builder
* fix: Preserve untouched agent starters and scope drafts to their agent
An unrelated builder save no longer rewrites stored starters: the field is
sent only when the list changed, so API-set lists past the builder cap or
with padding survive. The draft input is keyed by agent id so unsent text
does not follow the user to a new or different agent, and each delete
control now sits on its starter's row. Adds Playwright scenarios for the
builder-to-landing flow, preservation, clearing and draft scoping.
* fix: Keep starter drafts in form state and show saved starters after save
The unsent starter draft moves into react-hook-form as a builder-only
field, so it survives switching to the Model or Advanced panel and is
still cleared by the reset that loads another agent. Enter no longer adds
a starter while an IME composition is being committed. After create or
update, the starters field is reset to the stored list, so trimmed or
dropped rows do not linger and keep the add input disabled.
* fix: Keep starter edits made during a save and drop the UI-only length cap
Sync the stored starters back into the form only when the rows still hold what the save sent for the same agent, so edits typed while the request was in flight, or another agent selected meanwhile, are not overwritten. Remove the 64-character maxLength: the agent API and schema accept any length and the landing page already clamps display.
* fix: Merge a finished agent save only into the agent it was for
* test: Switch agents in place while the first save is held
* 🦎 fix: Restore Theme Contrast in Composer and Messages
* Match Sticky Activity Headers to Their Hosting Surface
---------
Co-authored-by: Lia <lia@librechat.ai>
* refactor: Serve the Marketplace Chat Through a Facade-Owned Provider
ChatProvider builds a pane's chat contract and serves it to the facade, so a host no
longer imports useChatHelpers to fill ChatContext itself. The marketplace is its first
host; its specs stub the helper module the provider imports.
* test: Start a Chat From a Marketplace Agent Card
Opens an agent's marketplace card, starts a chat from it, and expects the new chat to
send its turn to that agent and show the reply.
* test: Open the Marketplace Card Through Its Button
The card heading sits under the card's click layer, so the scenario clicks the button
that takes its accessible name from the heading.
* test: Wait for the Marketplace Agent Before Sending
The chat route applies agent_id on a short query-param poll and then drops it from the
URL, so the scenario waits for the parameter to go before it sends the turn.
* test: Type the useChatHelpers Mocks With the Hook's Parameters
The provider and marketplace specs pass index and paramId through explicitly instead of
an unknown[] spread, and the provider spec builds a complete typed chat contract.
* feat: Resume Streams and Send AI SDK Messages Through the Chat Facade
useChat and useChatActions gain resumeStream, which asks the pane's resume-on-load path
to re-check the stream status and reattach through the host transport, and sendMessage
now also takes an AI SDK user message of text parts, sent as the ask call it describes.
The facade spec covers the new members and the refused-send and failed-stop paths; the
transport spec resumes a running generation against a fake transport, stays detached
when nothing runs, and reports a reattached stream that fails.
* refactor: Keep the Resume Request With the Chat Feature
The resume-request atom is written by the facade and read by the chat's resume path,
so it moves from the app store to hooks/Chat.
* perf: Hold One Resume Request Instead of One per Conversation
A request only matters to the pane showing its conversation, so a single atom with the
conversation id and a count replaces the per-conversation family, which kept an atom for
every conversation a session ever asked to resume.
* fix: Keep Each Conversation's Resume Request Until Its Pane Answers
A single request slot let a second pane's resumeStream overwrite the first before
either pane's effect ran, so the first request was dropped. Requests are now a set of
conversation ids: the facade adds its chat, and the pane showing that conversation
consumes the entry and answers it.
* fix: Attach an AI SDK Message With a Null Parent at the Root
A root message's view carries a null parentMessageId, which ask reads as unspecified
and replaces with the branch tail. sendMessage now passes the no-parent sentinel for an
explicit null, so the turn attaches where its metadata says.
* fix: Hold a Resume Request Until Its Conversation Loads, and Send to the Facade's Chat
A pane navigating away from an Assistants conversation still reads that endpoint while
the route already names the next one, so it consumed a resume request it could not answer.
The request now waits until the pane has loaded the route's conversation. sendMessage's AI
SDK input also stops accepting a conversationId: the turn goes to the facade's own chat.
* test: Keep the Facade Resume Tests in Their Own Atom Store
The resume-request tests wrote to jotai's module-global default store and left their
entries for later tests; they now render under IsolatedAtomStore and read that store.
* 🪟 feat: Undock the Artifacts Pane into Its Own Window
The artifacts pane could only live in the chat's side panel, so viewing an
artifact meant giving up half the conversation and there was no way to put it on
a second screen. A header action now moves the pane into a separate browser
window and back.
The pane stays in the chat tab's React tree and is portaled into the popup's
document, so artifacts keep streaming into it and docking back is a re-render
rather than a reload. Everything a portal does not carry is mirrored: the host
stylesheets (re-synced for lazy chunks, HMR and CSSOM-only rules), the resolved
theme, a base URL for relative assets, and Sandpack's frame messages, which
would otherwise never reach the listener the opener installed.
* 🪟 fix: Keep the Artifacts Pane Whole When It Changes Windows
Review of the undock change surfaced one cause behind most of its findings: the
pane is a new component instance in every host, so anything a mount decides was
lost or wrongly reset when it moved.
- The code editor buffer now carries the artifact it belongs to, so a remount
restores unsaved text instead of falling back to the persisted content, and
the edit the debounce never got to send is handed to the mutation on mount.
The share hosts take one provider around every branch for the same reason.
- The artifact registry is cleared by the host that owns it: the pane keeps it
while it only changes windows, and leaving the route wipes it, so no artifact
follows the user to a shared conversation.
- Fullscreen exits through the document that owns the container, Mermaid pan
listens where its canvas lives, and Copy reports success only once the write
resolves, with a toast when it does not.
- Style mirroring compares what a sheet actually contains: rules a page inserts
through the CSSOM are serialized, and a rewrite the observer saw refreshes its
clone even when nothing measurable changed.
- A child-activity panel opened while the pane is undocked stays open; the two
panels are exclusive only while they compete for the side panel.
Adds the scenario suite for the window behaviors (`@scenario:` tagged) plus unit
coverage for the registry lifetime, the panel slot and buffer ownership.
* 🧭 fix: Carry the Artifacts Tab Across a Window Change
The pane's active tab lived in the component instance, so undocking from the
code tab landed the user back on the preview — with their unsaved text out of
sight, which reads as losing it. The tab is pane state now, next to the editor
buffer it belongs with, and the scenario asserts both survive the move.
* 🧹 chore: Drop Unused Imports From the Presentation Spec
* 🎯 fix: Bound the Artifacts Pane's Shared State to Its Session
The second review round found the cost of state that outlives an instance, all
in the seams the first round opened.
- Download now reads the editor buffer only when it belongs to the artifact on
screen, so selecting another artifact cannot export the previous one's edits.
- The active tab is reset when the pane session ends — close or conversation
change — instead of following a later artifact onto the code tab.
- A mutation started by a previous pane instance can no longer report back, so
the mount releases the stale "mutating" flag before handing over the restored
text; otherwise the edit queued behind a completion that never arrives.
- The undocked window's size and position are read while it still has them, in
its `pagehide`, so closing through the browser remembers the bounds too.
- Docking from the window moves focus to the control that replaces the one the
user pressed, which a keyboard user otherwise loses to the document.
- The share host keeps one `EditorProvider` mounted across the closed and open
branches, so opening the overlay no longer remounts the transcript.
* 🎨 fix: Paint the Undocked Window Before Its Sheet Arrives
A mirrored stylesheet is a fetch, so the popup showed its default white canvas
for that moment — plain against a dark app, and visible to the scenario as a
transparent pane. The host's resolved surface colour is now the `var()`
fallback in the popup's own layout sheet, so the window opens on the app's
canvas and the real token takes over when it lands.
The two scenarios that read settled state — the painted canvas, and a keyboard
Enter that closes the window it was pressed in — now wait for it instead of
sampling the first frame.
* 🔭 fix: Focus the Dock Target Once the Pane Has Mounted\n\nThe focus handoff ran before the pane rendered its toolbar, so the control it\nwas meant to focus did not exist yet and the request was never spent. It now\nwaits for the mount that creates that control.
* 🧩 fix: Give the Edit Pipeline and the Transcript One Owner Each
Round three found the same shape three more times: work that belongs to a
session was still decided by an instance or by a branch.
- The editor no longer infers whether a previous instance's save is running.
React Query keeps a mutation's callbacks on the mutation, so that request
settles the shared flag itself; the new instance waits for idle and submits
the restored buffer once, instead of clearing a flag it does not own and
resubmitting against an `original` the earlier request may have replaced.
- The shared conversation keeps its transcript in one place — always the first
panel of the resizable group — so opening the pane, undocking it or docking
it again changes only the pane's host, not the transcript's ancestry.
- The clipboard fallback runs in the pane's own document, so an undocked pane
on a deployment without the Clipboard API can still copy instead of only
reporting failure.
* 🧷 fix: Tie the Editor Buffer and Focus to the Pane Session
Round four found the last places where the retained buffer and the focus
handoff were decided by a code path rather than by the session boundary.
- Closing the pane discards the buffer, the tab and any pending focus request,
so reopening an artifact starts from what is saved instead of restoring — and
silently resubmitting — text the user abandoned.
- Only the buffer an instance inherits at mount is drained. Navigating back to
an artifact restores its own unsaved text in the editor instead of writing
the persisted content over it, which used to queue that content behind the
edit and undo it.
- Closing the window through the browser hands focus back exactly as the Dock
control does, rather than leaving a keyboard user on the document body.
- The clipboard fallback restores focus by capability rather than `instanceof`,
which never matches across the popup's realm.
* 🔐 fix: Make Undocking Configurable and Its Saves Session-Bound
- `interface.artifactUndocking` is a `configSchema` field, default enabled, so a
deployment that cannot use popups keeps the docked pane. The hosts resolve it
— the chat host from the startup config, the shared host from the shared-link
config, which now carries the flag — and hand it to the pane through the
context it already takes, rather than the pane reading config itself.
- A save carries the editing session it was started in. React Query keeps its
callbacks after the editor is gone, and those callbacks used to write the
buffer a closed session had just cleared and submit its queued edit; they now
stop at a session boundary, so a closed pane mutates nothing and leaves no
text behind for the next one.
* ✂️ fix: Stop the Editor from Overwriting Another Artifact's Unsaved Text
- A write this component makes into the Monaco model comes back through
`onChange` exactly like a keystroke. Restoring an artifact's text therefore
looked like typing and keyed the shared buffer to the artifact now on
screen — so selecting another artifact before the debounce fired replaced
the text the first one was still holding, and returning to it showed the
persisted content. The value written here is now recognised and consumed,
and the retained buffer is sent deliberately when its artifact comes back,
which is where its cancelled debounce finally becomes a save.
- The save lock is the session's, not a request's. A save that outlives its
session no longer clears the lock or the failure notice a later session
took, and ending a session releases it — while an edit typed behind a lock
whose owner is gone is sent by the editor holding it as soon as the lock is
free, instead of waiting for the user to type again.
* 🔔 fix: Report Failures in the Window the User Is Looking At
The app's toast surface is mounted once in the chat tab, so a notice raised
from the undocked pane — a copy that no clipboard path accepted, for
instance — appeared in a document nobody was looking at. The window now
carries a Radix toast provider and viewport of its own around the portaled
pane; the toast state is shared, so the same notice is shown wherever the
user is rather than routed by hand at each call site.
* 🚧 fix: Offer Undocking Only Once the Deployment Has Answered
An absent config read as enabled, which is the default, but a config request
in flight reads the same way: a user could undock during that window and the
arriving answer would then take the Dock control away with it. Both hosts now
treat an unanswered config as no capability, and the pane keeps the control
that docks it whenever it is undocked, so a capability that disappears cannot
strand the pane in a window with no way back.
* 🎯 fix: Land Queued Edits, the Config Toggle and Focus on the Window
- A queued edit is sent against the content the artifact actually holds. The
save that held the lock has already replaced what that edit was typed
against, so submitting the captured `original` had the endpoint reject the
newest text and leave it in the buffer alone.
- `interface.artifactUndocking` now survives interface loading:
`loadDefaultInterface` rebuilds the object property by property, so the flag
never reached `/api/config` or the shared-link payload and a deployment that
set `false` still saw the control.
- Undocking hands focus to the pane the way docking already did. The control
the user pressed goes away with the docked toolbar, so a keyboard user was
left on the empty document of the window that had just opened; the focus
request is now a move in either direction, which is what it is named after.
* 🔓 fix: Let the Request Own the Save, Not the Session
The save lock was a flag the editor set and cleared, which gave two ways to
be wrong: a callback whose session had ended cleared a lock the next session
was waiting on, and ending a session released a lock whose request was still
running — so a pane reopened mid-save could start a second read-replace-save
against content the first request was about to change.
The state is now the request's. The artifact save carries a mutation key and
`isMutating` is read from React Query's mutation cache, so it is true exactly
while a save is in flight, whoever started it: nothing to release, nothing to
leave behind, and an editor that appears mid-save queues its edit and sends it
— rebased on the content that landed — once the request settles.
* ⏱️ test: Give the Undocked Preview Time to Compile
* 📌 fix: Rebase a Queued Edit on What the Save Actually Wrote
The artifact registry catches up when the edited message propagates, not when
the save returns, so an edit sent in between was rebased on content the server
had already replaced and the endpoint rejected it. The text the last save wrote
is on the request itself: the drain reads it from the keyed mutation in React
Query's cache and falls back to the registry only when there is no save to
speak of. The same applies to a buffer inherited at mount, which is submitted
against that record too.
* 🧷 fix: Keep the Pane's Tab and Its Storage Off the Instance
Both findings of the review at a03ee0f7 are the same shape as the ones before
them: something the pane needs was reached for where it does not survive.
- The tab is pane state, but the reset that keeps it honest was an instance
ref. A host change mounts a new pane, so that ref started empty, read the
artifact already on screen as freshly opened and wrote `preview` back —
undocking and docking both returned the user to the preview, which reads as
the code they were editing having been thrown away. The marker moves to the
atom beside the tab it guards, and ends with the pane session like the rest
of it. Opening a *different* artifact still returns to the preview.
- `localStorage` was reached for at the call site. A policy that denies Web
Storage throws from the getter itself, before the guard around `getItem`
could run, so undocking threw instead of falling back to default bounds and
the redock and teardown paths threw on their way home — stranding the pane in
a window whose control the user had just pressed. Both helpers take the window
and touch storage inside their own guard.
The scenario that should have caught the tab defect asserted `aria-checked`
once, which matches the frame before the reset lands, so it is polled now.
* 🧪 test: Drop the Denied-Storage Scenario the Shell Cannot Support
Verification at c94e5ef showed the scenario asserting a capability LibreChat
does not have: denying Web Storage in the browser replaces the page with the
error boundary ("denied") before the pane's controls are reachable, so the
popup never opened and the test timed out in all three projects.
The finding behind it was about one call site — the pane reaching for
`source.localStorage` outside the guard around its `getItem` — and that stays
fixed and covered by the unit tests in `undockedWindow.spec.ts`, which
reproduce the throwing getter and fail without the fix.
Surviving denied storage app-wide is the shell's problem, not the pane's, and
is tracked at berry-13/LibreChat#41. The spec says why the scenario is absent
so it is not added back.
* 🔗 fix: Match the Artifact Trigger's Name as Dev Now Builds It
The scenarios opened the artifact by its full accessible name, spelled out as
"<title> Click to open". Dev's "Unify Artifact Triggers as Tool Rows" (#15915)
folded the format badge and whether the row renders a preview into that name,
so it now reads "E2E HTML Artifact HTML Opens as a rendered preview Click to
open" and an exact match finds nothing. Every scenario in the file failed at
its first click, three retries deep, which is what pushed the e2e shard past
its 30 minute ceiling.
This did not show up locally because the mock harness serves `client/dist`,
and mine was built before the rebase. The old bundle still rendered the old
name, so the stale locator passed here and failed in CI — and dev's own
`plain-text-artifact-row` spec failed locally for the mirror-image reason.
Both pass against a freshly built client.
The trigger is matched on its title now, the way dev's spec does it, so the
badge and the preview hint can change again without breaking the file.
* 🍞 fix: Share One Toast Viewport Between the App and the Window
The undocked artifacts window needs a toast viewport of its own, and it carried its own copy of the app shell's class list — so any change to toast placement, stacking or width would have had to be made twice, or the popup's notices would drift from the app's.\n\nThe viewport is now one composition in \, rendered by both hosts. It keeps the class list it always had and still takes a \, so the popup can adjust its own placement without forking the primitive.
* 🚫 fix: Keep a Rejected Edit Rejected Across a Host Change
A save the endpoint answers with 400 is deterministic, and the editor already refuses to send that exact text again. The refusal lived in the editor instance while the text itself lives in the shared buffer, so moving the pane to another host — which remounts the editor — dropped the marker and the inherited-buffer drain immediately sent the rejected text back, against the same original that produced the 400. Every dock or undock cost another rejected request, with no new edit from the user.\n\nThe marker now sits beside the buffer it describes, in the editor session, and names the artifact it was recorded for. A remount inherits it; a successful save clears it; ending the session clears it with the buffer. Returning to an artifact no longer resends its rejected text either, for the same reason. A genuine new edit still saves.
* 🧭 fix: Key the Artifact Registry to the Host's Conversation
The guard that bounds the artifact registry to one conversation decided that the conversation had changed by reading the chat tab's Recoil slot, which the shared route never sets. A shared conversation's host stays mounted while the reader moves between shared links, so on that route the change was invisible and only the unmount cleanup ever fired: artifacts from the previous link stayed in the registry, and opening an artifact in the next one could list and navigate back to the previous share's content.\n\nThe identity is now the host's to supply — the chat tab passes its Recoil slot, a shared conversation passes its own id — which is also what keeps the hook from reaching into app-global state for something only its caller knows. The first observed identity still does not wipe, so the loading transition into a shared conversation keeps the artifacts that belong to it.
* 🧪 test: Cover the Shared Host, a Blocked Popup and a Rejected Save
Three paths the pane reaches that no scenario exercised: a shared conversation, whose host resolves the undock capability from the shared-link config; a browser that refuses the popup, where the pane has to stay put and say so; and an edit the endpoint rejected, which must not go back on the wire because the pane changed hosts.
* 📝 docs: Document the Artifact Undocking Toggle in the Example Config
\ reached the schema and the shared-link config without ever appearing in the example file a deployment copies, so the lever existed but was undiscoverable. Documented with the default that reproduces today's behavior.
* 🔐 fix: Make the Undock Capability the Host's Answer, Not a Default
\ filled \ with \ when a host left it out, so a host that forgot would offer a window the deployment may have turned off — the one field in that context with no sensible fallback. It is now required, which makes forgetting it a compile error instead of a capability grant.
* 🕰️ fix: Read an Absent Conversation as Loading, Not as a Switch
The registry guard normalized a missing identity to a sentinel and stored it, so a host that reported nothing for a render — a shared link whose data refetches, a chat tab reading its slot before it is filled — looked like a move to another conversation. The reader lost the artifact they had open, and the same conversation coming back read as a first sighting.\n\nAn absent id is now no news at all: the last real identity stays the one the next id is compared against, so returning to it changes nothing and a real switch still wipes. Reported by Devin review of 097f9bfadd (BUG-0002), which also caught that ShareArtifactsContainer's comment already promised this behavior.
* 🏷️ fix: File a Refused Save Under the Artifact That Was Refused
The rejection marker was written with whichever artifact the pane happened to be showing when the 400 landed. A save answers after the user may have moved on, so a refusal for artifact A filed under artifact B left A free to send the same refused text again as soon as the user came back to it — and cleared B's own marker on A's next success.\n\nThe artifact a save was started for is captured when the request goes out, and both callbacks use it: the refusal names that artifact, and a success clears only that artifact's marker. Reported by Codex on 097f9bfadd.
* 🖥️ fix: Do Not Reopen the Pane on a Monitor That Is Gone
Remembered bounds are coordinates, and they outlive the monitor arrangement that produced them. Undocking takes the pane out of the page along with the only control that docks it, so a window reopened onto a display that no longer exists takes the artifact somewhere the user cannot reach.\n\nThe remembered rectangle is now used only when it can still be reached: it either overlaps this display's work area, or the browser says another display is attached, which is the case the feature exists for. A desktop reporting exactly one display is the only one where the rectangle is provably gone, and there the pane opens at the default bounds. A browser that does not report other displays keeps the user's placement. Reported by Devin review of a85d5c348e (BUG-0001).
* 🪞 fix: Follow a Stylesheet the Host Switches, Not Only Rewrites
The style mirror watched for nodes and text, so a sheet whose attributes changed — a \ switch, a \ flag, a \ that stops it being a stylesheet — left the popup showing styling the host had moved on from, with nothing to bring it back into line.\n\nThose attributes are part of the signature now, the observer watches them, and an update applies them to the clone alongside its content. Reported by Devin review of a853d48c90 (BUG-0002).
* ♻️ fix: Rebase Every Resubmitted Edit on What the Last Save Wrote
An edit replaces whatever the last save wrote, and the artifact registry only catches up when the edited message propagates. Three separate paths resubmit retained text — a queued edit, a buffer inherited at mount, and the edit restored when the user comes back to an artifact — and each had to learn that separately; the restore path had not, so it sent \ as the original, the endpoint refused it with a 400, and the text the user typed never landed.\n\nThe rebase now happens once, where the request is built: \ resolves the original from the save's own record unless a caller overrides it, so no path can forget — including the ordinary keystroke debounce, which had the same gap right after a save. Reported by Codex on a7c047cc2a, and the third finding in this family.
* 🧪 test: Let the Shared-Link Dock Click Race Its Own Window
Docking closes the window the click was made in, so the click can resolve against a page that has already gone — the same race the focus scenario already tolerates. The assertion that matters, the pane arriving back in the shared page, is unchanged. Seen once on desktop-dark while verifying a7c047cc2a.
* 🪞 fix: Clone a Stylesheet in the State the Host Has It
The attribute mirror kept a sheet current once the window was open, but the clone was built without those attributes — so a sheet the host had already switched off, or aimed at another medium, arrived in the popup switched on. Its signature matched from that moment, so the sync had nothing to correct.\n\nThe clone now carries the same attributes the sync keeps current. Reported by Devin review of c5d51b85fb (BUG-0002), and the same cause as its predecessor in that round.
* 🧪 test: Match the Blocked-Popup Notice Where It Is Shown
The notice is rendered in the toast and repeated in the live region, so the text matched two nodes and the assertion tripped strict mode on the slower mobile project. Either node proves the user was told; the assertion now takes the first.
* 🗑️ fix: Never Let a Cleared Editor Save Itself as a Deletion
Typing has always refused to save an empty editor: a user who selects all and deletes is mid-edit, not asking for the artifact's content to be removed. The paths that resubmit retained text did not know that, so a buffer holding an empty string was sent the moment the pane changed hosts or the user came back to the artifact — persisting a deletion nobody confirmed.\n\nThe rule now sits with the other decisions about whether a request goes out, in \, so the debounce, the queued edit, the inherited buffer and the restore all share it. Reported by Codex on a9a51439a5 (P1).
* 🧹 fix: Retire the Inherited Buffer Once a Newer Edit Is in Play
A host change hands the replacement editor the text its predecessor never sent, and the drain submits that once the save pipeline is idle. If the user kept typing in the replacement, the newer text queued behind the running save — and when it landed, the drain still had the older buffer in play and sent it, putting the artifact back the way it was.\n\nAnything an instance submits or queues now retires the buffer it inherited at mount, so the newest text is the last word. The drain passes the inherited text itself, which is how it stays exempt. Reported by Codex on 04a9f685b6 (P1).
* 🎨 style: Satisfy the Tailwind v4 Class Order From Canary
* 🧺 fix: Retain a Displaced Buffer Under the Artifact That Owns It
Editing one artifact evicted another's unsaved text from the shared code
buffer: the selection change had cancelled that edit's debounce, so the
overwritten copy was the only place it lived and coming back to the
artifact fell through to its persisted content. A buffer another artifact
displaces is now retained under its owner, and the editor restores and
sends it from there on the way back. Reported by Codex on 591ab13c96 (P1).
* 🧪 test: Key the Tabs Spec's Mocked Buffer to Its Artifact
The pane-wholeness change gated the preview on the buffer naming the
artifact on screen, but the spec's useCodeState mock never set
codeArtifactId, so the edited preview never applied. The mock now carries
the owner the component reads, and the editor spec's mock grows the
retained-buffer field the component destructures.
* 🧪 test: Prove a Displaced Edit Returns With Its Artifact
The displaced-buffer scenario gets its contract-level coverage: an edit
the user leaves on one artifact, an edit that displaces it on another,
and a return that has to land on the first artifact's own unsaved text.
The fake model grows a reply carrying two artifacts so both trigger rows
exist in one conversation, and its one nested ternary is unrolled so the
file lints under the repo rules CI applies to staged files.
* fix: Resolve Every Artifact Surface and Refusal Per Artifact
Preview, download and the Mermaid host now read an artifact's retained buffer the same way the editor does, rejection markers are kept per artifact so one refusal no longer overwrites another, and the saved-content history is only preferred while the registry still sits on this session's chain of saves.
* fix: Hold an Inherited Edit Until the Editor Can Save It
A buffer inherited across a host change while a response was generating was marked drained before the read-only guard dropped the save, and the read-only transition then replaced it with persisted content. The drain now waits for editing to return and writes the inherited text back after that transition.
* chore: Sort the Presentation Spec's Imports After the Canary Rebase
* test: Prove Each Artifact Surface and Save Path End to End
Covers the download of a displaced edit, a refusal per artifact, an edit after another session changed the artifact, and an edit carried through a response by a host change.
* test: Give the Undocked Presentation Case the Canary Query Client
* test: Start Artifact Scenarios From a Settled Reply on the Desktop Layout
* test: Stub the Command Executor Stamp in the Callbacks Spec Mock
Canary's #16556 calls stampCommandExecutor from callbacks.js, but this spec's @librechat/api mock predates it, so three cases failed on canary itself. The mock now carries the real helper, as it already does for isCodeArtifactToolOutput.
* fix: Track What the Server Holds Per Artifact Instead of Inferring It
The editor reconstructed the server's content from the mutation cache and treated every buffer as unsaved. A save now records what it wrote in a per-artifact ledger that the registry retires once it catches up, so a change made elsewhere (including a revert to an earlier value) wins over this tab's history, and text this tab already saved is never sent again by a host change or a return to the artifact.
* fix: Hide the Undocked Pane While Its Conversation Route Is Pending
The route keeps the previous conversation mounted but hidden while another one loads or fails to, and the undocked portal escaped that ancestry. The host now passes its pending state down and the window hides the pane with it.
* fix: Mark the Saved Buffer Copy and Retire Lag the Registry Has Passed
A buffer is saved only while it is the copy a save wrote, so editing away and back to the same text is still sent. Lag values the registry has already moved past are dropped in order, so a later change back to one of them is read as a change made elsewhere.
* test: Drop the Callbacks Mock Stub Canary Now Carries
* perf: Prune Settled Save Records When the Editing Session Ends
The app's message parts host reads the stores, so it moves from
hooks/Chat/parts to Providers/MessagePartsHostContext, beside
ChatSettingsContext. The PTC trace types move to common, and PendingSteer
joins the queue types in hooks/Chat/queue, so the chat contract names no
store module.
The drawer was fixed to the viewport, so a configured site banner, which
sits above the app and is sticky over it, painted over the drawer's header
strip and left its close toggle, panel switcher and New chat untappable.
The drawer is now absolute inside the app container, as the scrim and the
pane already are, so it opens below the banner. Without a banner the
container starts at the top of the screen and nothing moves.
* refactor(client): Pass the new-chat panel preference into the sidebar
Both new-chat controls, the desktop rail's and the mobile drawer's, read
newChatSwitchToHistory straight from the store. It is an app-global
preference the sidebar only consumes, so the host (Root) reads it and
passes it down, and the sidebar no longer reaches into the store for it.
* test(e2e): Cover the new-chat panel preference on desktop and mobile
ShareView registers its deployment-theme override from the commit it mounts,
with no theme until the link's config is ready, so an in-app navigation to
a shared link no longer keeps the viewer's theme on screen while that
config loads.
* refactor: Supply saveDrafts and isTemporary Through Chat Settings
Both preferences are app-global: the settings dialog writes saveDrafts,
and the chat route and keyboard shortcuts write isTemporary. Every chat
reader (composer, autosave, pasted-text edit, new chat and new convo,
file uploads, submissions, the temporary toggle, landing, run code) now
takes them from the host ChatSettings context, which the app fills from
its store. ChatView still reads saveDrafts from the store while #15911
owns it.
* test: Cover Chat Settings Preferences End to End
* fix: Read the Temporary Flag at Run Time in Run Code
* test: Supply saveDrafts Through Chat Settings in the Hook Specs
* test: Pin the Run Code Retention Flag With a Stable Code Ref
* test: Turn Temporary Chat On Through Its Toggle in the Scenario
* refactor: Move the Queue Run-End Atoms to Jotai
The follow-up queue, its settled receipts and pending enqueue ids, the
pane and parked run-end signals, and the interrupt-drain flag are
written and read only by chat logic (queue drain, steering, the SSE
hook, the queue rail). They now live in store/queue as Jotai atoms with
every consumer converted. The run-end FIFO keeps its nullable one-shot
API as a writable derived atom.
* test: Cover the Chat-Owned Queue State End to End
* test: Give Each Queue Rail Its Own Store in the Split-View Spec
* test: Drop the Parked Run-End Scenario Canary Does Not Meet
* refactor: Keep the Queue State Inside the Chat Feature
The queue atoms and their types move from store/queue to hooks/Chat/queue,
next to the drain that owns them. store/families re-exports the types so
existing imports keep working.
* refactor: Import the Queue Types From the Chat Feature
* test: Scope the Split-View Queue Spec to What Its Harness Proves
* test: Run the Split-View Queue Spec on One Shared Store
* fix: Open the Sole Tool Call in a Group and Label Finished Commands as Ran
A tool group with exactly one call opened into a second collapsed row, so
reading the result took two clicks. Tool cards now default open when they
are the only call in their group, through SoleToolContext, while nested
subagent messages reset it. The generic finished label for commands reads
Ran command instead of Finished running.
* fix: Open the Sole Tool Call Inside an Activity Phase
The live and settled activity phase card wraps its tool calls without a
ToolCallGroup, so a phase holding one bash call still opened into a second
collapsed row. The phase now sets SoleToolContext for a single call. The
mock tool-steps scenario matches the Ran command label.
* style: Sort Imports in ToolCallGroup Test
* test: Assert Sole Tool Card Disclosure on a Real BashCall
* test: Add Lone Tool Call Scenario
* test: Match Ran Command Label in Exit Status Tests
* fix: Let an Activity Phase Decide Sole Tool State for Its Groups
* fix: Keep the Reader's Tool Card Choice Apart From the Sole Call Default
Every local-state tool card stored its default and the reader's choice in one
sticky boolean. A sole card stayed open after its group gained a second call,
and a card that remounted while a live batch regrouped forgot that the reader
had closed it. Cards now keep the explicit choice in the per-tool disclosure
atom and derive the default on each render. A generic call that returned no
output but has arguments also opens as the sole call.
* test: Add Multi Call Group Scenario
* fix: Keep the Auto Expand Preference Waiting for Output on Generic Calls
* test: Scope the Multi Call Scenario to Its Tool Cards
* feat: Give File-Type Tiles Their Own Theme Roles
The file chips in the composer, the file table and message attachments drew their tile in one of seven hard-coded hex fills from utils/files.ts and their glyph in raw white, so a theme could recolour neither. Each kind of file now has a file-* fill role and the glyph reads file-ink; every LibreChat theme keeps today's colours, and ClickHouse draws the tiles from Click UI palette steps that keep the white glyph legible. The tile fill travels as a fill utility, the way the trace kinds already pass theirs.
* test: Pin the File Tile Roles in the Composer Tray
* test: Attach File Tile Captures to the Report
* fix: Keep FileIcon's Colour Fill and Take the Role Through fillClassName
* fix: Hold High Contrast File Tiles to AA Against Their Glyph
* fix: Ink the File Upload Spinner With the Tile Glyph Role
* feat: Give the Last Component Colour Literals Theme Roles
The default avatar's hairline, the file drop zone's artwork and a dragged badge's lift were literals in Avatar, Icon, MessageIcon, DragDropOverlay and Badge, so no theme could reach them. avatar-edge, the illustration roles and the elevationDrag appearance role now carry them, each defaulting to the literal it replaces in every bundled theme. ClickHouse paints the artwork from Click UI's info ramp.
Canvas, favicon and screenshot code read roles through readThemeColor instead of wrapping channel triplets by hand. The Reasoning fade mask, two comments and dead commented-out SVG fills no longer carry colour literals, and the allowlist is regrouped into nine justified entries.
* test: Pin the Avatar Hairline, Drop Zone Artwork and Drag Lift Roles
* refactor: Export readThemeColor Beside the Theme Atoms
* test: Compare the Avatar Hairline by the Pixel It Paints
* test: Compare the Drag Lift as the Browser Computes It
* test: Attach Drop Zone Artwork Captures to the Report
* test: Pick the Drag Lift Theme From One Init Script
(cherry picked from commit 59a8a31ab2)
Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16597
* feat(client): Give the mobile drawer one place for each control
The drawer put its two global destinations in opposite corners and repeated
one of them under every panel. The marketplace was a bare icon in the top
strip, the hardest thing there to notice; new chat was a large footer button
sitting under prompts, memories and MCP settings alike, none of which it has
anything to do with; and the close toggle wore the chat header's bordered
plate beside two flat icons, so the row read as one control and two
afterthoughts.
They swap. New chat takes the icon slot beside the panel switcher, which is
where the drawer keeps what means the same thing whichever panel is showing,
and its click behaviour moves with it into a component of its own rather than
staying behind in the footer. The marketplace becomes a full-width entry
above the panel content, labelled, in the list where someone already looks
for somewhere to go, and outside the scroller so it stays put while the
panels change under it. The toggle drops to `ghost` like its neighbours. The
footer is left with search alone and stands down entirely on a panel that has
nothing to search, rather than taking its padding out of the list above it.
The drawer now carries a text colour beside its background. Only the panel
nav set one, so the header strip, the new marketplace row and the footer all
inherited black from the document and rendered near-invisible in dark mode,
except where a control happened to name a token itself. That was hidden while
the toggle wore `header-action`, which brought its own.
* fix(client): Keep the mobile drawer clear of the home indicator and apart from its scrim
The footer now renders a safe-area spacer when search is absent, so panel
content no longer runs under the system gesture area on panels with nothing
to search. The marketplace row uses the Button's `row` size instead of
restyling it, which drops its new lint suppression.
The scrim paints the theme's `bg-scrim` role (80% by default) on its own
layer, which separates the drawer by 3:1 in both light palettes, and in dark
mode the drawer draws a `border-xheavy` edge, since no scrim opacity
separates two near-black surfaces. The scrim's focus ring is checked in the
browser instead of by class name.
* fix(client): Paint the mobile scrim's focus indicator above its fill
The scrim's theme fill sits on its own layer, which painted over the
button's inset focus ring, so a keyboard user focusing the scrim with the
chat strip on saw almost none of it. The indicator now draws on a layer
above the fill, in two tones: at the theme's 80% scrim a single dark ring
reaches only 2.3:1 on the light palettes' mid-gray, so a surface band
carries it in light and the focus ring in dark. The scenarios check, in
all four palettes, that the topmost layer at the scrim's edge carries an
indicator with a tone at 3:1 against the fill.
* fix(client): Keep the mobile drawer close toggle on the header's control
The drawer's close toggle is the chat header's open toggle flipping state,
so it keeps the header-action surface and size it shares with that control
rather than going flat like its new neighbours.
(cherry picked from commit 0da898786c)
Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16248
The menu panel, tooltip and tab trigger read menuRadius, tooltipRadius and tabRadius instead of literal corners. The defaults are the old literals, and the ClickHouse theme sets Click UI's genericMenu, tooltip and tabs radii. The not-expressible list drops the three corners and keeps the field fill and ink, the dark menu shadow and the tooltip shadow.
(cherry picked from commit 98efd35024)
Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16599