* 👋 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.
* 🚦 ci: Make Dev Workflows Ready for a Merge Queue
* ♻️ ci: Evaluate Merge Gate Expressions With the Shared Workflow Evaluator
* 🧺 ci: Share the Installed Tree in Merge Gate Tests the Way ci-setup Requires
* 🍃 ci: Provision the mongod Binary Before Tests Start
mongodb-memory-server downloads its ~122 MB mongod the first time a test
starts a server, inside a 15 s beforeAll. Only backend-review.yml cached
~/.cache/mongodb-binaries (the same step pasted four times), and a cache
alone still leaves the download inside the first hook on a miss.
Integration Tests downloaded on every run: 6 failures in 274 runs with
"Exceeded timeout of 15000 ms for a hook" in secrets.integration.spec.ts,
followed by "spawn ETXTBSY" in the suites that started mongod while the
timed-out download was still writing it.
Add .github/actions/mongodb-binary: restore the cache with the existing
key scheme, ask the installed mongodb-memory-server for the binary it
wants (MongoBinary.getPath), make sure that binary sits in the home cache
every working directory resolves, run it once, and save the cache right
away. The step fails the job when no runnable binary can be put in place.
Use it in every job that starts mongodb-memory-server, after dependencies
are installed and before tests, and add the action to the path filters of
the workflows that list their own file.
* 🧪 test: Cover the mongod Provisioning Script Without the Network
Run the real script against a stand-in resolver that keeps the properties it relies on: home cache first, download when missing, and a memoised path until the cache is cleared. Integration Tests runs the suite before it uses the action.
* 🧪 test: Run mongod Provisioning Against the Real Resolver
The suite replaced mongodb-memory-server with a hand-written stand-in, so
it checked the script against a description of the resolver rather than the
installed one. It now runs the script against the real library and
replaces only the network: MONGOMS_DOWNLOAD_MIRROR points at a local
server that serves an archive whose bin/mongod is a shell script, with the
.md5 the library verifies it against.
Recovery also no longer charges a broken copy that was already on disk to
the download: with a broken binary in both the home cache and the root
node_modules/.cache, the first attempt removed one, the retry met the
other, and the step failed without ever downloading. Existing copies are
now discarded one at a time and the download keeps its own two attempts.
* 🧪 test: Reach the Exit-Status Check Behind the Library's System Binary Probe
A system binary that prints nothing is rejected by the library's own version probe, so the case never reached this script's check or the rule that a file the job named is not deleted. Add one that answers the probe and exits non-zero.
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.
* 🥅 ci: Run Playwright After Every Merge to Dev
The mock e2e suite ran on pull requests, nightly on main and on demand, so
when a spec broke on dev no run on dev could go red: the vote workflow that
runs the suite after merges cannot fail by design.
Add a push trigger for dev with the pull request path filter. A push runs
the pull request profile with no lane narrowed (10 memory shards, 2 Redis
transport shards, both MCP lanes and MCP Apps), and the gate job reports it.
Pushes take their own concurrency group that never cancels: the run in
progress finishes, and GitHub keeps one pending run per group, so merges
that land meanwhile collapse into one run of the newest commit. Pull
request, nightly and manual runs keep their per-ref cancelling group.
The matrix test now evaluates the workflow's own expressions per event
rather than matching their text.
* 🔭 ci: Always Run Source-Scanning Guard Specs Under Test Selection
Codegraph test selection narrows a pull request run to the test files an
import graph reaches. A spec that reads source with fs has no import edge
to what it reads: toolCapabilityGates.spec.js scans four source trees, was
not selected when #17864 changed one of the files it counts, and failed on
dev afterwards.
List every such spec, with the paths it reads, in .github/guard-specs.json.
Both selectors now add a workspace's guards to a FILES decision and turn a
NONE into a guards-only run when the change touches a path one of them
reads, renames a file, or edits the list. A list that cannot be read runs
the workspace FULL. FULL decisions and every earlier fail-open path are
unchanged.
The rule keys off the decision, not the event. A selection with no file
left in the checkout gets no guards, so the test job still runs FULL on a
stale selection instead of running only the guards.
guard-specs.test.mjs fails when a spec in a gated workspace reads the
repository through fs without being listed, when a listed path is missing,
and when a workflow would not run for a path one of its guards reads. That
last check adds the five backend and one frontend paths the triggers
lacked. The test also runs both real select steps against canned codegraph
responses.
* 🧪 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.
* 🧰 ci: Provision Pinned Redis Binaries Without a Distro Mirror
The MCP list_changed jobs and Cache Integration Tests installed redis-server and redis-tools with apt-get at test time. When the runners could not resolve the Ubuntu mirrors, apt-get update spent 3m20s giving up, the install stalled into the step timeout, and the next step found no redis-cli. The version was whatever the mirror served that day.
A composite action now restores redis-server and redis-cli 8.0.5 from the Actions cache and, on a miss, builds them once from the pinned upstream commit with bounded retries. The step fails with one clear error when Redis cannot be provisioned.
* 🔦 ci: Keep Lighthouse Running When the Ubuntu Mirror Is Unreachable
The Lighthouse job installed its pinned Chromium with `playwright install --with-deps`, which runs apt-get first. With the Ubuntu mirrors unresolvable, apt exited 100 and the job failed before any audit ran.
On the runner every library Chromium links is already present with the preinstalled Chrome; the only packages apt added were nine optional fonts. The browser download stays fatal and keeps the lockfile-pinned build, while the system packages go through the bounded best-effort script the Playwright jobs already use.
* ⏱️ ci: Give the Cold Redis Build Room on a Slow Runner
The first hosted runs built Redis in 49, 58 and 103 seconds. A 180 second cap left the slowest of those less than twice its own time, so a slower runner would have failed a job for being slow. The build may now take 300 seconds and the calling steps eight minutes; an unreachable host still fails within 98 seconds. The ready line reports the fetch and the build separately.
* fix: Advance Slack Account Linking in Place
* fix: Narrow Slack Reply Transport Contract
* fix: Make Slack Link Reply Updates Monotonic
* fix: Clear Invalidated Slack Link Cards After Delayed Writes
* 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
* fix: Allow Admins to Remove Disconnected Slack Workspaces
* fix: Use Workspace Status Chips and One Confirmation Action
* fix: Confirm Workspace Removal in a Stacked Dialog
* fix: Align Confirmation Cancel Action to the Left
* 🎨 fix: Clarify Slack Account Linking
* 🧹 fix: Remove Replaced Channel Link Translation
* 🧪 test: Match Current Channel Link Copy
* 🖼️ fix: Respect the Base Path in Channel Linking
* 👤 feat: Link and Revoke Personal Channel Accounts
* fix: Own Channel Link Lifetimes and Complete Channel Entry Points
* fix(channels): activate trusted link URLs with account page
* fix: Preserve Personal Consent for Channel Managers
* test: preserve channel fixture in upstream agent selection cases
* 💬 feat: Configure Slack Connections in the Agent Builder
* fix: Bound Channel Credentials to One Activation Attempt
* fix: Scope Channel Completion to Its Dialog Lifetime