- refactor: Move Ask User Question Cards Into the Chat Package
- fix: Preserve Ask Card Styling Without Suppression Growth
- fix: Provide Live Ask Pauses As Scoped Context Data
- test: Cover the Settled Ask Record Collapse Cascade
- fix: Give the Ask Call Spec Host the Tool Call Chrome
* 🫁 fix: Ease Context Usage Popover Size Transitions
Expanding snapped the card to its wide width in one frame; collapsing snapped it narrow first, reflowed the details into one column and made the card taller than it had been before rolling up.
- The popover owns the card width and eases it at the pace of the roll it travels with.
- The details hold the wide card's width through both rolls, so the card uncovers one settled layout.
- The per-tool breakdown and the usage sections roll instead of jumping.
- A press inside the card pins it, so a control that shrinks it from under the pointer no longer closes it.
* 🫁 fix: Restart the Details Width Hold on Every Opening
A collapse reversed midway kept the details mounted with their mount-time hold already spent, so they reflowed to the narrowing card, flashed one column and gave the roll a taller height to snap back from. The hold is now keyed to the open state and restarts with each opening.
A card that opens already expanded resizes nothing, so it no longer holds: with a classic scrollbar on a viewport-capped card the held width could sit across the two-column threshold from the settled one.
---------
Co-authored-by: Lia <lia@librechat.ai>
* 🎞️ perf: Run the In-Flight Label Sweep on the Compositor
The sweep on a running tool call, streaming reasoning and the elapsed timer
animated `background-position` under `background-clip: text`, which no
browser can hand to the compositor. Every frame of it ran style, paint and
commit on the main thread, and each paint walked the transcript around the
label, so the cost of a frame grew with the conversation and the sweep
stuttered whenever the main thread was busy.
`Shimmer` in `@librechat/client` draws the same sweep from two transforms
that cancel: a masked band slides across the label while a second copy of the
text inside it slides back, so the glyphs hold still and only the gap in the
mask moves. The copy is generated content, so the label is still one text
node. Every in-flight label renders through it.
`e2e/benchmarks-fade` measures a frame and each kind of stream event inside
an exported conversation, from a Chromium trace of the built client.
* 🧪 test: Let the Frame Benchmark Open a Chat in a Chosen Theme
* 🧵 perf: Keep the Composer, Nav Rail and Row Toolbars Out of Every Stream Event
A streamed delta rewrites one row, but each one also re-rendered the composer
form (and re-measured its textarea), the message nav rail (re-translating a
label per message), the sidebar's chat provider and the pending-steers row,
because each subscribed to the whole streaming message or the whole messages
array to read something a delta never changes.
- The chat contract and steering read a projection of the branch tail (where it
sits, whether the run is paused) and fetch the message itself when a turn is
built, through `useBranchTailGetter`. `ChatTurnsParams` carries
`getLatestMessage` in place of `latestMessage`.
- The compact action and pending steers select what they use of the tail.
- The URL-prompt hook observes the history only while a submission waits on it.
- The nav rail's ribs are memoized apart from the rail.
- A row's toolbar keeps one element per glyph and stable handlers, so a send
and its completion no longer re-render every button of every row.
`e2e/benchmarks-fade` gains a render-reason probe (`FADE_PERF_WHY`), a whole-run
profile, and windows for the send and its confirming frame.
* 🫥 perf: Conceal Rerun During a Run Instead of Unmounting It on Every Row
A run starting or ending withholds, then restores, the rerun control on every
row of the thread at once. Unmounting and remounting a button on each row made
the browser re-style the whole transcript both times: the stylesheet holds
`:has(:disabled)` rules and a message row is a `:has()` anchor, so a button
entering, leaving or flipping `disabled` inside a row invalidates that row's
entire subtree. In a 250-message thread that was 80 to 100 ms inside the send
keypress and again inside the final frame.
The control now stays mounted for as long as the row has a rerun to offer and
is concealed by visibility while a run is in flight: no focus, no pointer, no
place in the accessibility tree, and no layout where the toolbar starts at the
row's edge. Below `lg`, where the toolbar is centered, it leaves the flow as
before. It is deliberately not also `disabled`. The reply being written still
mounts no controls at all.
* 🎯 perf: Write :has() Rules So a Change in a Row Does Not Re-style the Row
Two selector shapes in the stylesheet left the browser unable to tell which
elements a `:has()` rule could reach, so it re-styled the whole subtree of
every `:has()` anchor above any change:
- Tailwind's `group-has-[…]`, which compiles to
`.x:is(:where(.group):has(…) *)`. Message rows and their toolbars are
`group`s, so a button mounting or unmounting in a row re-styled the row.
- `theme-disabled-within:[&_*]:…`, which compiles to `…:has(:disabled) *`.
With it in the sheet, a `disabled` flip did the same.
Either one alone was enough: flipping `disabled` on one button per row of a
250-message thread took 100 to 110 ms, and mounting one took 88 ms. A run
starting or ending did one of those on every row.
The row-hover reveal, the header label crossfade and the toolbar's
hover-active hold now use `grouped-*` custom variants that emit
`:where(.group):has(…) .x`: the same elements at the same specificity, with a
subject the browser can read. A wrapper's parts take the disabled fill from
classes the component adds while it is disabled, through `theme-disabled-fill`,
instead of from `:has(:disabled) *`. The same two changes now cost 25 to 42 ms
and 27 ms.
`has-selectors.spec.ts` reads the stylesheet the app ships and fails on either
shape; `restyle.perf.spec.ts` measures the cost.
* 📱 fix: Keep a Concealed Rerun Hidden on Narrow Screens
The narrow-screen stylesheet forces every toolbar button visible from outside
any cascade layer, so it outranked the utilities that conceal a rerun while a
run is in flight: below 1024px the button stayed on screen and in the tab
order, inert. A concealed button now carries `data-concealed`, and that rule
leaves it alone.
Covered at a narrow and a wide viewport by what the reader gets: the settled
reply's rerun is hidden and cannot take focus during a run, and is back after.
* 🧮 perf: Skip the Pause Scan in Pending Steers When None Are Pending
The pending-steers row follows the conversation's messages, so it renders for
every streamed delta, and it resolved the run's pause state before checking
whether it had anything to show. That check walks every part of every message.
It now runs only with a steer to display.
- refactor: Move the Composer Palette Into the Chat Package
- fix: Keep the Palette Usable Without a Windowed List or Catalog Host
- test: Cover Picking Palette Rows With the Mouse
- fix: Leave Palette Keys to IME Composition and Focus to the Field a Press Moved It To
- fix: Localize the Palette Without Its Data Host
- fix: Ship the Composer Popover Motion With the Client Package
- test: Check the Composer Motion Survives the App Cascade
- fix: Offer Palette Favorites Only Where the Host Stores Them
- fix: Name the Palette Favorite Shortcut Only Where It Works
- fix: Leave the Bookmark Shortcut Alone Where the Palette Stores No Favorites
- refactor: Move Attachment and Retrieval Rows Into the Chat Package
- refactor: Drop Dashes From the Moved Attachment Comments
- test: Cover the Moved Attachment and Retrieval Rows
- refactor: Keep the Shared Button on the Attachment Preview Download
- test: Pin the Fold and Settle Motion Against the App Stylesheet
- refactor: Render Pending Turn and Steers from the Package
- refactor: Keep Package Pending Rows Inert Without a Steer Host
- fix: Read the Host Thread Mode on Every Render
- fix: Point the Hosts Guard at the Messages Loader
- fix: Follow the Moved Pending Rows in the Guard and Lazy Chunk Specs
- fix: Ship Message Body Typography With the Shared Theme Styles
- fix: Keep the App Message Typography Cascade With the Shared Styles
* 🎞️ perf: Run the In-Flight Label Sweep on the Compositor
The sweep on a running tool call, streaming reasoning and the elapsed timer
animated `background-position` under `background-clip: text`, which no
browser can hand to the compositor. Every frame of it ran style, paint and
commit on the main thread, and each paint walked the transcript around the
label, so the cost of a frame grew with the conversation and the sweep
stuttered whenever the main thread was busy.
`Shimmer` in `@librechat/client` draws the same sweep from two transforms
that cancel: a masked band slides across the label while a second copy of the
text inside it slides back, so the glyphs hold still and only the gap in the
mask moves. The copy is generated content, so the label is still one text
node. Every in-flight label renders through it.
`e2e/benchmarks-fade` measures a frame and each kind of stream event inside
an exported conversation, from a Chromium trace of the built client.
* 🧪 test: Let the Frame Benchmark Open a Chat in a Chosen Theme
- refactor: Move Tool Approval Review into the Chat Package
- refactor: Tag the Response Review Tool Batch Spec as a Scenario
- fix: Resume the Composer Review Panel Through the App Host
* ci: Record Playwright Shard Timings From Green Dev Runs
* ci: Run the Playwright Mock Suite on Fifteen Memory Shards
* ci: Run the Playwright Workflow Script Tests Once per Run
* test: Make the Due Schedule E2E Wait for One Engine Tick Only
* test: Cover the Shard Timings Hand-off With Acceptance Scenarios
* perf: Load Search, Share, Trace and Composer Popovers on Demand
The search, share, response-review and marketplace routes, the trace
viewer and the composer's popovers (mention, prompts, skills, ask, tool
dialogs, code approval and workspace menus) were statically imported by
the chat, so every visit downloaded them, and the search and share routes
pulled most of the message renderer into boot. Routes load through route
loaders, the trace viewer behind a loading state, and the composer
pieces under null Suspense boundaries, since they render nothing until
triggered.
* test: Cover Surfaces That Load on Demand
* test: Wait for the Composer Popovers Instead of Network Idle
* fix: Let a Loading Trace Be Closed
While the trace viewer's chunk downloaded, its fallback covered an inert
chat with no way out: the close button and Escape live in the viewer.
The fallback now keeps the viewer's header with a focused close button
and dismisses on Escape.
* test: Close a Trace Whose Download Stalls
* fix: Return Focus to the Trace Opener Across the Loading State
The loading fallback took focus before the viewer mounted, so the viewer
recorded the fallback as its opener and closing left focus on the page.
The surface now records the opener when the trace opens, passes it to
the viewer and returns focus there when either closes.
* test: Assert Focus Returns to the Trace Button
* fix: Hold the Viewer Theme Back While a Shared Link's Code Loads
* perf: Paint the Loading Shell Before the Bundle Arrives
* fix: Name a Lost Connection Instead of Suggesting a Refresh
* fix: Give the Endpoint Key Button a Usable Touch Target
* test: Cover the Loading Shell, Offline Copy and Key Button Target
* fix: Announce the Loading Indicator in the User's Language
* test: Exercise the Key Button on a Plain Endpoint Row and the Localized Label
* test: Measure the Key Button's Layout Size, Not Its Animated Box
* fix: Keep the Key Button's Row Height on Fine Pointers Too
* fix: Ink the Loading Indicator in the Theme's Text Role
* fix: Draw the Loading Indicator With the Shared Spinner
* test: List the Loading Spinner Spec as an index.html Guard
* fix: Resolve the Loading Label's Language the Way the App Does
* test: Cover the Loading Label for an Automatic zh-TW Browser
- perf: Stop Shipping the Node Crypto Polyfill to the Browser
- perf: Keep the Query Devtools Out of the Boot Chunks
- perf: Load Side Panel Tabs When They Open
- perf: Keep the RE2 Engine Out of the Browser Bundle
- perf: Load KaTeX and highlight.js Only for Math and Code
- test: Cover Code That Loads on First Need
- fix: Apply Loaded Math and Highlighting Whatever the Load Trigger Matched
- test: Assert Rendered Formulas Without Assuming Display Math
- fix: Retry a Failed Math and Highlighting Load While Mounted
- fix: Always Load Highlighting Where the Language Is Guessed
- fix: Register the PII Sizer Wherever Config Loads
- fix: Load Preview Math From the Filled-In Prompt and Keep Dollar Signs Literal
- test: Register the PII Sizer Where the Filter Harness Validates Config
- test: Preserve Side Panel Layout During Lazy Loading
- Move the admin lockout guard into the shared AdminSettingsDialog so every feature with a USE permission gets it, including Marketplace
- Show the lockout warning only once the ADMIN USE switch is turned off, instead of permanently
- Gate Save behind an alert dialog that requires typing ADMIN before the change is submitted, with focus starting in the field
- Drop the Prompts-only confirm and the showAdminWarning, onPermissionConfirm, confirmPermissions and extraContent props
- Reword the warning so it does not assume access to librechat.yaml
- Run the jest spec on the real role selector, role menu and translations, mocking only the roles list request
- Cover the guard with mock e2e scenarios: warning before Save, typed confirmation by mouse and keyboard, Cancel and Escape, a rejected save, other roles, and the Prompts dialog
* feat: Redesign the Slack Channels Setup and Management UI
* test: Cover the Channels UI and Keep the Channel Lifecycle Specs on the New Copy
* fix: Keep the Agent Id on a Channel Link Whose Agent Cannot Be Read
* fix: Name Channel States That Need Action and Keep Link Recovery in the App
* test: Follow the Channel Library in the Workspace Agent Setup Spec
The organization workspace setup spec still pressed the removed Add Slack
channel button, timed out, and left its agent behind for the retry. It now
opens the Channel Library, reaches row actions by hover, gives each attempt
a unique agent name, and carries scenario tags so verify runs it.
* style: Polish the Agent Builder, Tools and Skills Panels
* fix: Keep the Catalog Search a Searchbox and Cover the Builder Polish in E2E
* test: Press the Memory Scope Card Instead of Its Hidden Radio
* test: Find the Skills Search by Its New Floating Label
* style: Restyle the Fork Popover and Calm the Feedback Hover
* fix: Follow the Stored Fork Mode and Update the Specs for the New Fork Popover
* test: Find the Fork Options Link by Both of Its Names
* feat: Add Choice Cards, Raised Radio Tone and Section Add Button
* fix: Size the Section Add Button From a Theme Role and Cover the Shared Controls in E2E
* test: Cover the New Shared Controls Under a Reference Theme
* test: List the Shared Controls Theme Spec in the Guard Manifest
* fix: Submit Tool Approvals Without a Known Generation Epoch
The resume submit hook required the client-side generation epoch, so when
it was unavailable Submit returned before calling the mutation and the
approval card stayed pending with no error. The resume route validates
generationCreatedAt only when present and fences on the authoritative job
and actionId, so the epoch is now sent as an optional extra fence.
* test: Cover Approval Submit When the Status Omits the Generation Epoch
The model selector applies its search query after a 200 ms debounce, and
until then the unfiltered menu is still rendered. openModelSearch waited only
for a visible option, which that unfiltered list satisfies, so the pin test
counted and arrowed through it. When the results replaced it mid-loop, the
active row unmounted and the remaining presses often ran out before reaching
a mock-model row. Wait for the results announcement, which only the search
results render, before navigating.
* 🧪 test: Read the Artifact Scrim's Blur From the Persistent Scrim
"a small blur surface still blurs by four pixels" read the backdrop filter
of `#artifact-viewer [role="status"]`.first() once, with a single evaluate.
The artifact panel's lazy tabs also render a `role="status"` loading
placeholder until their chunk arrives, and the panel re-renders while it
opens. A one-shot read that resolves the wrong status, or a node React has
just replaced, gets the computed style of a detached element: an empty
string instead of `blur(4px)`.
Select the always-mounted refresh scrim, the only status that carries
`aria-hidden`, and assert its filter with `toHaveCSS`, which re-resolves and
retries until the value settles.
Untraced, on two CPUs: 11 of 20 runs failed with `Received: ""` before,
20 of 20 pass after.
* ⚡ perf: Mount the Mobile Header Menu Only Once a Phone Layout Has Shown It
The chat header rendered both of its action surfaces on every load: the
desktop buttons and the mobile overflow menu, hidden with `className="hidden"`
on wide screens. The hidden menu still mounted its whole tree on desktop,
with its bookmark, export, share, temporary-chat and pull-request hooks and
its dialog providers.
Mount the overflow menu only while the drawer viewport is active, and keep
it mounted once it has been shown, so resizing back to desktop does not drop
a dialog opened from it.
Measured with a React DevTools hook counting component renders over a cold
desktop load of a saved conversation (7 warm navigations each, production
build): 1,313 component mounts before and 1,242 after, the overflow trigger
no longer in the DOM, and the median component re-renders over the load
5,835 before and 5,682 after.
`dropped-classes.spec.ts` read the overflow trigger's size on a desktop
viewport, where it was only attached; it now reads it at phone width, where
the trigger is visible.
* 🧲 fix: Settle a Pinned Row's Position on Drop, Not Only on Hover
A pinned row reorders in its `hover` callback, which judges the pointer
against the hovered row's midpoint using the offset react-dnd last recorded.
The HTML5 backend delivers hover once per animation frame, so a release that
lands in the same frame as the move across the midpoint is judged against the
offset from before it: the swap is refused and the drop keeps the old order.
A quick, deliberate drag is discarded.
The drop handler now runs the same placement against the final pointer offset
before returning its result, so `end` commits the order the pointer actually
ended on. Hovering is unchanged.
The new regression holds the hover frame and fires dragover/drop at a point
past the midpoint and at one short of it. On the previous handler the first
case keeps the old order; with this change both cases match the pointer.
In a real browser, with a drag that releases without waiting for a hover
frame: "a pinned chat cannot be dragged through a pinned model" kept the old
order in 4 of 15 untraced runs on the previous handler and 0 of 15 with this
one.
* 🧲 test: Release a Pinned Drag Without Waiting for a Hover Frame
The pinned drag helper waited for an animation frame after each settling
move, so react-dnd had delivered a hover at the final position before the
release. That kept the reorder scenario green while a release landing in the
same frame as its last move was discarded by the app.
The drop handler now settles the final pointer position itself, so that wait
no longer stands between the scenario and a failure; it only hides the
fast-release path. Release straight after the settling moves again, so the
scenario covers it.
Untraced, on two CPUs, with this helper: "a pinned chat cannot be dragged
through a pinned model" failed 4 of 15 runs against the previous drop handler
and passed 15 of 15 with the settled drop; the whole pinned-drag-rules file
passed 30 of 30.
* 🧪 test: Publish the Reaper Fixture's PID Only After It Is Written
Two reaper tests wait for a PID file to exist and then read it. The shell
creates the file when it opens the redirection and writes the PID a moment
later, so a read in between gets an empty file. `Number('')` is 0, and
`isGone(0)` reports true because there is no `/proc/0`: "escalates to
SIGKILL when the tree ignores SIGTERM" and "sweep reaps a group that
outlived a clean root exit" then fail their "still running" assertion.
Write the PID to a temporary file and rename it into place, so the file
appears only with its content. With a 0.3 s pause forced between the
redirection and the write, both tests fail on the old fixture and pass on
this one.
Also kill each spawned process group after every test, so a failing test
does not leave its trap-protected `sleep 30` behind, and read the process
state with `ps` where `/proc` does not exist.
* 🔦 test: Keep a Measured Trace and a Startup Profile When Lighthouse Fails
When the serial-latency audit fails a budget, the uploaded `.lighthouse/`
holds the JSON and HTML reports only. They name the slow metric but not the
main-thread work behind it, so a total-blocking-time failure cannot be traced
to the code that blocked without reproducing it locally.
- Run Lighthouse with `--save-assets`, keeping each run's measured
`lhr-*-0.trace.json` for Chrome's Performance panel. Its raw DevTools
network log is deleted; the trace is parsed and every string value has the
session cookie values redacted, so numeric timings and JSON structure
survive even for short cookie values. A trace that does not parse (an
interrupted run) is deleted rather than uploaded raw.
- After a failed audit, navigate once more with the CDP profiler running and
save `.lighthouse/startup.cpuprofile`, including three seconds after the
transcript appears so late catalog callbacks are sampled. This runs after
the measured audits, so it cannot change their numbers, and a profiling
error never replaces the original failure.
Budgets, runs and the workflow are unchanged; the workflow already uploads
`.lighthouse/`.
* 🔦 test: Keep Lighthouse Traces Only When the Audit Fails
Each saved trace is about 45 MB, so keeping all three on every run turned the
always-uploaded `lighthouse` artifact from about 2 MB into about 137 MB for
runs that pass and need no diagnosis. Delete the traces once the test's last
assertion has passed; a failing run still uploads them with its reports.
* 🧪 test: Read the Streaming Shimmer From the Live Footer
"an in-flight label sweeps, and high contrast holds both stops opaque" read
the stream-elapsed label's styles once through `locator.evaluate`. The label
lives in the streaming footer, which re-renders while the reply streams; when
the node the locator resolved was replaced before the evaluate ran, the read
came from a detached element or failed.
Assert the animation name and background clip with `toHaveCSS`, which
re-resolves and retries, and read the shimmer's dip alpha by querying the
current node inside the evaluate, polling until it settles.
Untraced, on two CPUs: 4 of 20 runs failed with `Received: ""` before,
20 of 20 pass after.
* 🧪 test: Click the Drawer's New Chat Link, Not Whichever One Is Exposed
"returns focus after right-clicking an unopened running menu on a small
screen" opens the mobile drawer and clicks
`getByRole('link', { name: 'New chat', exact: true })`. On a saved chat the
header row also offers a New chat link, and it hides only when the sidebar's
expanded state commits. On mobile that commit is deferred: the drawer starts
sliding first and the state flips a few frames later inside a transition,
which a streaming run keeps pushing back. The drawer's Close button is
already visible during the slide, so the test reaches the click while both
links are exposed and fails with a strict mode violation.
Scope the locator to `#mobile-drawer`, the link the test means.
Untraced, on two CPUs: 20 of 20 runs failed on the previous locator and 20
of 20 pass with this one.
---------
Co-authored-by: Dustin Healy <54083382+dustinhealy@users.noreply.github.com>
* 🧪 test: Measure Activity Fold Labels Once the Header Slide Lands
Opening a fold slides its header's new label in over the old one (300 ms).
The clean-phase test read the phase label's box right after opening the
group below it, still inside that slide, then compared it with the box after
a rail hover; the two differ by a fraction of a pixel. A traced attempt is
slow enough that the slide has landed first. Wait for the header's finite
animations to finish before taking the reference box.
* 🧪 test: Find the Mention Endpoint Row in the Mention List Alone
The drill-down test looked up `Mock Provider C` as any option on the page.
The setup picks Mock Provider A from the model menu just before, and that
menu keeps its options in the accessibility tree for about 100-160 ms while
it fades out, Mock Provider C among them, so an untraced attempt that types
the filter in that window hits a strict-mode violation. Look the row up in
the listbox the mention combobox controls.
* ⏱️ test: Let the Composer Palette Finish Closing Before the Tool Timer Freezes the Clock
`tool-timer.spec.ts` closes the composer palette with Escape and then calls
`page.clock.setFixedTime`, which installs Playwright's clock. From that point
every timer the page starts is run by the clock, one callback per task, and
the agent stream that follows queues a zero-delay timeout for each query-cache
notification, so the clock runs seconds behind.
The palette is still closing when the clock is installed. Its popover unmounts
from a 123 ms leave timer that is started two animation frames after Escape.
When the install lands inside those two frames the timer belongs to the clock
and waits behind the notification backlog: the popover stays mounted at zero
opacity over the transcript and takes the click meant for the tool disclosure
for the five seconds the tool runs. The disclosure then leaves with the tool
and the click waits out the test's 120 s timeout.
Wait for the palette dialog to unmount before reading the start time and
freezing the clock.
* 🧲 test: Deliver a Hover Frame Before a Pinned Row Drag Is Released
`dragRowOnto` sends its whole pointer path, release included, in about 25 ms.
react-dnd's HTML5 backend delivers hover to drop targets once per animation
frame, and a target's hover callback reads the pointer offset the previous
hover recorded, so a release is judged against where the pointer was when a
frame last ran. When no frame runs between the pointer crossing the hovered
row's midpoint and the release, the last recorded offset is the one from
entering the row, in its lower half: the swap is refused and the list keeps
its order.
Only the reorder in `a pinned chat cannot be dragged through a pinned model`
depends on that reading. The other drags in the file end in a drop handler
that reads no offset.
Wait for an animation frame after each of the three settling moves, so the
hover carrying the final position has been delivered before the release.
* 👁️ fix: Hold the Seen Check's History Refetch While a Run Streams
The seen check revalidates a conversation's history when the list reports a reply that no fetch has shown yet, and it asked for that refetch whenever the messages query was idle, including under a run the pane is attached to.
A resumed run writes its response into the cache from the stream's sync. A refetch that starts after that sync returns the stored row for the same message, and the cache takes it because both lists are the same length, so the live response is replaced by what was persisted when the run began until the stream's next event rewrites it. A manual compaction resumed after a reload shows it for as long as the summarizer takes: its stored row is an empty summary part with no running marker, so "Summarizing..." disappears and nothing stands in for it.
The refetch now waits while a run is in flight. The check already re-runs when the run ends, which is when revalidating is safe.
* 🧪 test: Wait for the Late Subagent File's Stream Before Reading Its Turn as Over
Stop is withheld between a turn's admission and its stream attaching: no generation epoch exists yet for it to stop. The scenario read Stop's absence right after the POST as the end of the turn, then asserted without waiting that its route had injected the late file into that stream. When the check ran inside that interval the stream had not been requested yet, so the assertion failed on a turn that went on to deliver the file.
It now waits for the reply only the stream carries, then for Stop to go.
Playwright sends route.fetch(), the request fixture and page.request through one
keep-alive agent per worker with no idle timeout, and Node's agent ignores a
server's Keep-Alive hint without one. LibreChat and the fixture servers closed
idle sockets after 6 s, so a request reusing a socket at that moment was reset
(read ECONNRESET) or dropped (socket hang up): the remaining retried passes in
wrapping.spec.ts and thread-fold.spec.ts.
Run LibreChat with HTTP_KEEP_ALIVE_TIMEOUT_MS=0 and pass every fixture server
and the replica proxy through keepIdleConnections(), and check in
fixtures.spec.ts that each harness server answers without an idle deadline.
* 🦠 chore: Upgrade Node.js and Undici to Security Releases
* test: Wait for Restored Composer Readiness and Reuse Wrapping Config
---------
Co-authored-by: Lia <lia@librechat.ai>
* 👋 test: Wait for the Header Selector Before Counting Agent Names on the Greeting Landing
The greeting scenario read how many header controls named the agent with a
one-shot `count()` and then expected the same number of mentions inside
`main`. The header selector takes the agent's name after the welcome screen
paints, so when the name landed between those two reads the first said 0 and
the second saw the selector's own label, which sits inside `main`. When both
reads ran before the name landed the check passed without the selector ever
naming the agent.
Wait for the selector to show the name, then expect that label to be the only
mention inside `main`.
* 🗂️ test: Keep the Sidebar Open When Chat History Is Already Showing
On desktop `openChatHistory` clicked the Chat History rail button
unconditionally. The rail button of the panel already showing collapses the
sidebar, and Chat History is the panel every document starts on, so after the
reload in the subagent activity scenario the helper closed the conversation
list it was meant to show. The assertions that follow only passed while the
list was still mounted during the collapse.
Open the sidebar first on both layouts and press the rail button only when
another panel is showing, the guard `openPanel` already uses.
* 🚦 test: Hold the Mock Suite Until the Server Reports Ready
Playwright starts the suite once the base URL answers, which the server does
as soon as it listens. It keeps initializing after that and refuses chat
starts and schedule writes with a 503 until `/readyz` turns 200, so a spec
that runs first against a slow start got `SCHEDULES_NOT_READY`. The
two-replica wrapper already waits on `/readyz` before exposing its proxy; the
single-process server had no such gate.
Poll `/readyz` in global setup before authenticating.
* perf: Start Critical Chat Reads Before Discovery
* test: Use Complete Default Role Permissions in Startup Fixtures
* test: Complete the New Role Query Response Fixture
---------
Co-authored-by: Lia <lia@librechat.ai>
A route handler that calls `route.fetch()` can still be running when its test returns. Closing the browser context disposes the fetched response, the handler throws `Response has been disposed`, and Playwright reports that against a test whose assertions had all passed. With `failOnFlakyTests` on, that fails the shard.
Specs that answer requests through `route.fetch()` now take `test` from `e2e/specs/mock/fixtures.ts`. Its `context` fixture detaches the routes on the context and its pages with `unrouteAll({ behavior: 'ignoreErrors' })` before Playwright closes it; contexts a spec opens itself close through `closeContext`.
`ignoreErrors` rather than `wait`: a wait never ends for a handler parked on a promise the test leaves unsettled, and with two handlers in flight Playwright stops intercepting when the first finishes and continues the other request itself, so the second handler's `route.fulfill()` throws `Route is already handled!`.
* 🧪 test: Keep the Service Worker Out of Scenarios That Hold a Request After Load
The sidebar row scenarios and the streaming dot scenario install a route on a
page that has already loaded, to hold one request open. The PWA service worker
finishes installing and takes control of that page at about the same time, and
a route installed in the few milliseconds around that handover is never
consulted: the request goes straight to the server and Playwright stops seeing
the page's requests at all.
In the sidebar scenarios the archive completed while the test waited on a
promise only the route could resolve, so the test sat until its 60 second
timeout. In the streaming dot scenario the held turn simply finished and the
dot was gone. Both specs now block service workers, as the other specs that
depend on a route already do, and the archive wait fails with a named
expectation instead of running out the clock.
* 🧪 test: Wait for the Prompt Filter to Apply Before Opening Row Menus
The prompts panel applies a filter half a second after typing stops, and does
it by replacing the rows with the filtered request's answer. The scenario
opened a row's menu straight after typing, on a row that was about to unmount,
so when the swap landed between the menu opening and the test reading its
items the menu was gone and the test read an empty list.
Typing the filter now waits for the filtered request to finish, so the rows
the test opens are the ones the filter produced.
* 💭 fix: Settle a Grouped Thought Once the Run Has Moved Past It
A thought folded into a tool group decided it was still streaming by comparing
its index with the tail of the body it renders in. Every settled activity
phase renders in a body of its own and so has a tail too, which left the last
thought of a finished phase reading "Thinking..." with its live peek whenever
that body was on screen while the run went on. At the end of a run a summary
card folds in over the phase with its panel open, so the finished thought
flashed its peek for about a tenth of a second under the completed reply.
The group now applies the rule a lone thought already follows: only the body
that holds the message's cursor has a part still being written.
The scenario that guards this sampled the peek ten times a second and stopped
at the final text, so it saw the flash only when a sample happened to land in
it. The page now counts every appearance itself, through the end of the run.
* 🧪 test: Count Thought Peeks Inside the Conversation Only
The count the page keeps looked for the peek anywhere in the document, where
the samples it replaced looked inside the message view. It now matches them.
* 🧱 ci: Block the PWA Service Worker Across the Mock E2E Profiles
Every mock test opens a fresh browser context, so the app's service worker
installs and claims the page during each test's first load. A `page.route`
installed within a few milliseconds of that claim is never consulted: the
request it should hold goes to the server, and a test waiting on the route
times out. 113 mock spec files install routes and seven blocked the worker
themselves.
Set `serviceWorkers: 'block'` in the mock profile's shared `use`, which every
profile derived from it inherits. No spec asserts worker behavior; one that
does can opt back in with `test.use({ serviceWorkers: 'allow' })`.
* 🧪 test: Keep the Sandpack Preview Worker in the Plain Text Artifact Spec
`serviceWorkers: 'block'` stops every service worker in the browser context,
not only the app's. Sandpack's static template serves an artifact's files from
a service worker inside its preview iframe, so with the profile blocking
workers the preview stays empty and the spec that reads it fails every attempt.
Opt that one spec back in and say in the profile's comment that the setting
reaches third-party workers too.
* 🔑 fix: Replay a Request Rejected for a Superseded Bearer Instead of Refreshing Again
A burst of requests leaves with one bearer. The first 401 starts a refresh and the
rest share it only while it is in flight: a 401 delivered after the refresh settled
found no recovery running and started a second one, although the session had already
recovered and the response described a bearer that was no longer in use.
Compare the bearer the rejected request carried with the current one. When it has
been replaced and no recovery is running, replay the request with the current
bearer. A replay that is rejected again carries the current bearer, so it takes the
ordinary refresh path. The fetch transport follows the same rule.
This is what failed "recovers from an expired bearer during app bootstrap without
redirect looping": 9 of the 21 bootstrap 401s were delivered after the first
recovery finished, so the test counted a third refresh and a second recovery cycle.
* 🔊 test: Play Decodable Audio and Hold the Reply's Button in the Read-Aloud Replay Scenario
The fixture answered the speech request with four bytes the MP3 parser rejects, so
every playback failed. A failed playback cancels its request, and the audio is
cached only once the response has been read to the end, so the replay was served
from memory only when the response finished before the decoder gave up. When the
decoder won, the replay issued the second request the scenario forbids.
The test also located the button by its name. While a message is read aloud its
button is named "Stop", so the locator resolved to the user message's read-aloud
button: the wait for playback to end passed at once, and the second click could
land on a different message.
Serve a third of a second of silent MPEG frames so playback succeeds and ends on
its own, and locate the reply's button by its test id so the wait and the replay
address the same control.
* 📅 test: Wait for the Schedule Save to Land Before Reloading
The edit scenario clicked Save and reloaded the page in the next step. A reload
discards requests still in flight, so when it won the race the PATCH was cancelled
before the server answered and the edited schedule never appeared. Await the PATCH
response, and require it to succeed, before reloading.
* 🔗 fix: Grant a Legacy Shared Link's Permissions Once When Its First Views Race
The share page requests a link's config and its messages together, and each request
migrates a legacy link on the way in. Both find no grant and both write one. The
grant is an upsert matched on the principal and resource, which no unique index
covers, so the two writes inserted two rows: a second public entry, a second owner
entry, or both.
`grantPermission` now accepts the `_id` to give the entry if the grant creates it.
The migration derives that id from the link and the principal, so the second insert
collides on `_id` and is replayed as an update of the first entry. It holds across
processes because the database enforces it. Grants that pass no id are unchanged.
"manages a shared-link snapshot and preserves legacy public links through runtime
migration" asserts one public entry and saw two.
* 🔑 fix: Refresh When a Replayed Fetch Is Rejected With the Current Bearer
The fetch transport replayed a request whose bearer had been superseded and
returned whatever came back. A second 401 there means the current bearer is not
accepted either, which is the case the refresh exists for, and the axios path
already handles it that way. Replay first, then fall through to the ordinary
recovery when the replay is rejected too.
* 🔗 refactor: Derive a Unique Grant's Entry Id in the Data Layer
`AccessControlService.grantPermission` took the entry's `_id` as a Mongoose
`ObjectId`, which put a storage type in an exported `packages/api` signature. The
service now takes `uniqueEntry: true`, and `grantPermission` in data-schemas
derives the id from the principal and resource it already matches on. A caller can
no longer pass an id that names a different grant.
* 🪪 fix: Apply a Builder Agent Selection Before the Agents Catalog Loads
The agent builder's Select button starts a chat with the agent its form holds. `useSelectAgent` first looked that agent up in the agents map and returned silently when it was missing. Since #17692 the map is a deferred catalog, released on browser idle (at most about 2.75 s after first paint on a busy main thread), so a click that landed earlier did nothing and the next message went to whatever model was selected before.
An unloaded map now reads as unknown instead of as a missing agent: the builder already loaded the agent it offers, so only a loaded map can refuse the pick. Selecting also releases the agents catalog, which the header and composer need to name the agent.
This is what made `tool-approvals.spec.ts` and `run-files-lifecycle.spec.ts` pass only on a retry: in every recorded failure the builder click preceded the agents map request and the message was sent to the default model spec.
* 📡 test: Read the Subagent Activity Stream Without Depending on How It Closes
The shared-panel scenario waited for the activity stream's `requestfinished` event and then read the response body. Both need the server to close the stream first. The panel also closes it: it stops listening as soon as the durable thread reports the task terminal, and the server persists that status before it writes the stream's final frame. When a thread poll landed in between, the browser reported the request as aborted, `requestfinished` never fired and the body was no longer readable.
The scenario now counts the stream as ended on either event and reads what the stream delivered from the page's own request, so it asserts the same live updates whichever side closes first.
* 🚏 fix: Send a Queued Message Started in a New Chat After the Source Run Releases the Composer
"Start in a new chat" on a queued message navigates to `/c/new?prompt=…&submit=true` while the source conversation is still generating. The URL auto-submit could fire in the few tens of milliseconds between the composer dropping that run and the next commit: `ask` still saw the composer as submitting and refused, and the auto-submit, which is spent on its first attempt, cleared the URL with nothing sent. The row had already left the queue, so the message was gone from the page.
A new chat has no run of its own, so the auto-submit now waits there until an effect has observed the composer idle, then sends. Existing conversations keep the current behaviour: a prompt arriving during their own run stays in the composer.
"the ClickHouse theme paints its own link, code fill and QR backdrop" and "a theme that names only its link colours Markdown links in both modes and can recolour the QR backdrop" each failed a first attempt in 1 of 70 pull request runs on Nov 11 with "apiResponse.json: Response has been disposed", thrown from the `/api/config` route handler after every assertion had passed.
The app requests `/api/config` three times while it starts, the third about 90ms after the first two. Both tests end within a few milliseconds of that request, so it can still be inside `serveThemes` when the body returns: in one CI trace the handler's fetch starts 1ms before the last assertion and finishes 10ms after the context began closing. Closing the context disposes the fetched response, `response.json()` throws, and Playwright reports the handler's error against the finished test.
Every test in the file now waits for its route handlers to finish before the context is torn down. A handler that throws for any other reason is still reported; only the race against teardown is gone.
Playwright reports a test that fails and then passes on a retry as "flaky" and exits 0, so a
regression that fails two attempts in three merges green. Set `failOnFlakyTests` in CI on the
mock profile (inherited by the Redis transport, registered-email and other derived profiles) and
on the base profile. Retry counts are unchanged: the later attempts still record the trace and
video and show whether a failure repeats.
A run failed this way still prints "N flaky" beside a passed count, so add a reporter that names
each retried pass in the job log and the job summary and says that it is what failed the run.
* 🧪 test: Measure the Prompt Counter After Its Dialog Settles
The RTL prompt counter scenario failed its first attempt in 9 of 64 recent
pull request runs and passed on retry. The Create Prompt dialog scales in
from 95% over 200ms, and the test measured during that animation with three
separate boundingBox() round trips: the field's x, the field's width, then
the counter's x. Each landed on a different frame, so an x from a smaller
scale was added to a width from a larger one and overshot the counter.
Wait for the dialog's own animations to finish, then read the field and the
counter in one evaluate so both rectangles describe the same frame. The
assertion and its 1px tolerance are unchanged; at rest the field ends 6.3px
before the counter.
* 🧪 test: Await the Window Close When Docking the Artifacts Pane
"docking back returns the pane to the side panel" failed its first attempt in
4 of 64 recent pull request runs with "locator.click: Target page, context or
browser has been closed". Docking closes the pane's window from inside the
Dock control's own click handler, so the click can lose its acknowledgement to
a page that is already gone: the CI trace shows "performing click action" and
the window's close 11ms apart.
Send every dock through one helper that awaits the window's close event and
tolerates a rejected press only once that window is closed. A press that fails
while the window is still open is rethrown, and a press that does not close
the window fails on the missing close. The code-tab scenario made the same
unguarded click, and the keyboard scenario swallowed every error; both now use
the helper.
* 🧾 test: Bill Detached Subagents Their Own Prompt in the Mock Model
The mock model computes the input tokens it reports from the agent context of the graph it was built for. A subagent model override shares that one model with child graphs, so a detached child of the same agent was billed the parent's system prompt and tool definitions for as long as the parent run had not been disposed, and only its own messages afterwards.
When the child's first call returned before that disposal, the inflated report pushed the SDK's calibration ratio to its cap, the pruner cut the 24 KB tool result to 4,912 characters, and the retained-history fixture stopped the child before signalling ready. On the Redis transport lane the two events land within a few milliseconds of each other, so the child wins that race in about one run in six; on the memory lanes the disposal is comfortably first.
The agent view now reads a graph's agent contexts only for streams of that graph's own run. The history fixture records why it stopped a task, so a waiter fails with that reason instead of a 45-second timeout.
* 🧪 test: Cover Detached Child Billing Through the Real SDK
The regression test drove the mock model directly with run ids it chose itself, so it assumed the relationship the ownership check depends on instead of observing it.
It now builds a real SDK run with a self subagent, a real task store and tool node, applies the real hook, and spies on what each stream reports. The parent run is never disposed, so its graph holds its agent context for the child's whole life: on dev's mock model the child stops with the lost-results failure the Redis lane hits, and here it reaches ready with every child stream billed for the messages it was sent and both parent streams billed their system prompt under the graph's own run id.
* fix: allow members to connect agents to installed Slack workspaces
* fix: clarify Slack destination assignment actions
* fix: align Slack assignment status with destination heading
* fix: explain Slack agent assignments in terms of the connected bot
* fix: separate Slack connection setup, management and confirmation
* fix: name replaced agents only when the member can view them
* perf: avoid redundant Slack assignment identity lookups