Commit graph

19 commits

Author SHA1 Message Date
lia-by-librechat[bot]
d434417089
🦠 chore: Upgrade Node.js and Undici to Security Releases (#18066)
* 🦠 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>
2026-11-11 19:17:04 -05:00
Danny Avila
d32403f851
🍃 ci: Provision the mongod Binary Before Any Test Starts (#18053)
Some checks failed
Codegraph E2E Vote Gate / Gate (push) Waiting to run
Codegraph E2E Votes / vote (shard 1/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 10/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 2/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 3/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 4/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 5/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 6/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 7/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 8/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 9/10) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/chat (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Playwright E2E Tests / Codegraph select (push) Waiting to run
Playwright E2E Tests / e2e () (push) Blocked by required conditions
Playwright E2E Tests / MCP list_changed (replica count 1) (push) Blocked by required conditions
Playwright E2E Tests / MCP list_changed (replica count 2) (push) Blocked by required conditions
Playwright E2E Tests / MCP Apps (browser and server) (push) Waiting to run
Playwright E2E Tests / e2e (push) Blocked by required conditions
Main Promotion Policy Tests / Main promotion denial and fast-forward tests (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Has been cancelled
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Has been cancelled
* 🍃 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.
2026-11-11 10:31:46 -05:00
Danny Avila
97f7fcdbac
🥅 ci: Run Playwright After Merges to Dev and Guard Specs Under Test Selection (#18049)
* 🥅 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.
2026-11-11 10:30:09 -05:00
Dustin Healy
5081850280
🛠️ feat: Add Slack Gateway Transport Adapters (#17616)
* 🛠️ feat: Add Slack Gateway Transport Adapters

* fix: Share Gateway Execution Wire Contracts and Preserve Stop Scope

* fix: Align Gateway Transport and Installation Contracts

* fix: Centralize Gateway Policy and Durable Stop Observations

* docs: Clarify Transport Adapter and Runtime Ownership

* fix: Separate Stop Event Identity From Execution Authority

* build: align gateway lock with current workspace toolchain

* 🛠️ fix: Cache Gateway Dependencies Across Shared CI Jobs
2026-11-10 21:04:05 -08:00
Marco Beretta
558e0144fe
⚖️ ci: Refresh Playwright Shard Timings From Recent Runs (#17765) 2026-11-04 11:21:59 +01:00
Danny Avila
38c96a5e3a
🚦 ci: Throttle Codegraph E2E Votes to One Run per Window (#17380)
* 🚦 ci: Throttle Codegraph E2E Votes to One Run per Window

A vote runs the whole mock suite on ten runners, about 154 job-minutes, and
every merge to dev started one: 2,227 job-minutes on 2026-10-22, queued beside
PR CI for the same runners.

With repo variable CODEGRAPH_E2E_VOTE_MIN_HOURS set to N > 0, the votes
workflow skips its push runs (in a concurrency group of their own) and the new
Codegraph E2E Vote Gate decides instead: a merge starts a vote on dev
(workflow_dispatch) once the newest started vote is N hours old, and an hourly
catch-up votes the newest merge no vote covers once the window opens. A merge
votes as before while the catch-up has not run for three hours or the history
cannot be read. Unset, empty or 0 keeps today's push-triggered votes and skips
the gate; CODEGRAPH_E2E_VOTES=off still stops both.

The decision is a pure function in .github/scripts/vote-gate.mjs, tested in
vote-gate.test.mjs and run beside the shard tests in playwright-mock.yml.

* 🚦 fix: Keep an Unfinished Handoff Run from Covering Its Merge

With the throttle on, a merge creates the votes workflow's push run, whose
vote job will be skipped, and the gate's push run at about the same time.
Until that handoff run completed, the gate read it as a queued trial: it
matched the merge on head_sha, so the merge started no vote and waited for a
later catch-up tick, and it also held the window as a started vote.

While throttled, a push run that has not completed is now read as a handoff:
it neither covers a merge nor holds the window. A finished push run that
voted still counts as before.
2026-10-24 08:50:20 +02:00
Danny Avila
fb8f71ab14
🗳️ ci: Shard the Codegraph E2E Vote Suite Across Ten Runners (#17339)
The vote suite grew from 375 tests (39.1 min on one runner, 2026-09-30)
to 1,321, so a single-runner vote can no longer finish. Run it as the
same ten duration-planned shards playwright-mock.yml uses; each shard
logs the specs it executed and the codegraph shadow unions them into
one trial. A shard that runs out of its 28-minute test budget logs only
its failed specs, never clean ones.
2026-10-22 11:28:55 +02:00
lia-by-librechat[bot]
53ae22a6a3
💉 chore: Upgrade Node.js to Security Release 24.22.1 (#17332)
Some checks are pending
Publish `@librechat/client` to NPM / pack (push) Waiting to run
Publish `@librechat/client` to NPM / publish-npm (push) Blocked by required conditions
Docker Dev Images Build / publish (push) Waiting to run
Sync Helm Chart Tags / Ignore non-main push (push) Waiting to run
Sync Helm Chart Tags / Sync chart tags (push) Waiting to run
* 💉 chore: Upgrade Node.js to Security Release 24.22.1

* test: Enable Enter Submission in Native Acceptance

* test: Use the Machine Picker in Native Acceptance

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-22 09:34:02 +02:00
Danny Avila
6c7393e14f
🗳️ ci: Let Codegraph E2E Vote Runs Finish (#17325)
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/chat (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Each merge to dev cancelled the vote run before it, and the full mock
suite needs about 43 minutes, so 480 of 499 runs since 2026-09-24 never
finished (282 superseded, 153 cut by the 45-minute timeout, 45 never
started). Graduation evidence stopped at 09-30. Keep a started run and
one pending run, and raise the timeout to 75 minutes.
2026-10-21 23:54:49 +02:00
Marco Beretta
bdc4bafce2
🚰 refactor: Move the Pure Stream Code into the @librechat/chat Core (#16979)
The step appliers, frame normalizer and SSE transport move from client/src/hooks/SSE into packages/chat/src/core with their specs, and the client imports them from @librechat/chat. The ask-user-question predicates the content applier reads move with them, and the client's approval module re-exports them so its consumers are unchanged.
2026-10-11 23:04:47 +02:00
Marco Beretta
c00c776e0e
📦 feat: Scaffold the @librechat/chat Package (#16964)
* feat: Scaffold the @librechat/chat package

Adds packages/chat with core, react and components entries, a tsdown build,
a node-environment jest config, turbo and root build wiring, import boundary
rules, design-lint scope, and core types for the chat transport, stream,
host and status. No code moves yet.

* test: Cover the @librechat/chat boundaries as scenarios

* fix: Run the chat suite in test:turbo and build it for the mock lane

test:turbo now selects @librechat/chat, the mock e2e job builds the package the
chat-package scenarios load, and the synthetic repository in the suppression
scenarios carries the packages/chat/src root lint:design:record names.

* chore: Build the chat package in frontend:ci too

* chore: Run the chat suite in test:all

* fix: Hold core TSX to the chat boundary and scan the package for cycles

* fix: Apply the chat import boundary to JavaScript sources

* fix: Keep nested core files off the components entry

* fix: Close the remaining chat package gates and fence aborts by generation

Blocks imports through the @librechat/frontend workspace name, adds the chat
sources to the i18n scan, the CSS color gate and the client Tailwind content,
and lets ChatAbortRequest carry the generation it means to stop.

* fix: Keep JSX out of the chat core and carry abort and reconnect outcomes

Rejects JSX under the core, copies the chat manifest before the Docker
install, keys the client app build caches on the chat sources, fences
reconnects by generation, and types the abort result the transport returns.

* test: Give the CSS gate's scratch tree the chat root it now scans

* fix: Close the remaining @librechat/chat gates and wiring

Rejects import() and require() across the package boundaries, holds chat
components to the literal-copy rule, compiles TSX in the package's jest
transform, builds the package in Frontend Unit Tests, requires its test job for
main promotion, adds it to the unused-dependency scan, and lists it wherever a
sibling workspace is listed: Dockerfile.multi, the docker smoke paths, the
remaining node_modules caches, the reinstall helper, the bun build chain and
AGENTS.md.

* fix: Tighten the chat boundaries and carry steering and Assistants aborts

Template-literal import() and require() and self-imports through the package
name are rejected, user-facing JSX attributes need localized text, the cycle
scan resolves self-imports, Dockerfile.multi builds the package for the client
stage, and the transport carries steer, cancelSteer, armSteer and the
Assistants abort key.

* feat: Match the chat transport and host contracts to the client's

The transport now reports settled and replaced starts, the stream's protocol
version and resumed flag, reconnect replay, generation status, paused-run
resume with approvals or answers, abort and steer protocol versions, and the
request error shape. The host config and auth carry what the client's
ChatSettings now supplies: rename-while-running, model specs, retention mode
and the user.

* fix: Keep lazy React-entry loads out of the core and type the Assistants stop

Relative import() and require() of the /react entry from core are rejected,
and an abortKey stop resolves to the terminal conversation and run messages the
Assistants route returns.

* fix: Fence start controls by protocol and close extension-bearing entry loads

Settled and replaced start results carry the protocol version, core loads of
the /react or /components entry with a file extension are rejected, and
test:packages:chat builds data-provider first.
2026-10-10 21:00:10 +02:00
Marco Beretta
fdd5f9ce65
🖼️ fix: Precache PWA Icons and Let Them Refresh (#15654)
* 🖼️ fix: Precache PWA Icons and Let Them Refresh

Production builds set `publicDir: false`, so `client/scripts/post-build.cjs`
copied `public/assets` into `dist/assets` only after `vite build` had finished.
vite-plugin-pwa globs `dist/` from its `closeBundle` hook, inside that build, so
the icon patterns in `workbox.globPatterns` matched zero files and the generated
`sw.js` shipped without a single icon, silently: workbox treats an empty glob as
a no-op. `build:ci`, used by the Playwright lanes, never ran the post-build step
at all and produced a `dist` with no icons or `robots.txt`.

Move the copy into a `copyPublicAssets()` build plugin that runs in
`writeBundle`, which completes for every plugin before `closeBundle`, and drop
the post-build script with its lone `fs-extra` dependency.

Ordering alone was not enough. The plugin defaults `dontCacheBustURLsMatching`
to `/^assets\//`, true only for hashed bundle output. The icons live in
`assets/` under stable filenames, so they entered the manifest with
`revision: null`, permanently immutable, meaning an installed PWA would never
pick up a rebranded icon: the other half of the report. Match Vite's
`[name].[hash].[ext]` shape instead so hashed chunks stay revision-free while
the icons carry content revisions.

Also drop `manifest.webmanifest` from `globPatterns`, since the plugin always
appends it as an additional manifest entry and globbing it duplicated the
precache entry.

A clean `npm run build` now yields 55 precache entries with all five icons
revisioned, against 0 icon entries before.

* 📝 docs: Describe the Full Copy Set in copyPublicAssets

* 🔒 chore: Drop fs-extra From bun.lock
2026-09-06 11:32:09 -04:00
Danny Avila
6f3d303985
📍 ci: Pin the Votes Ledger Results JSON to an Absolute Path (#15166)
First live full-suite vote run (32731087273, 198 passed) wrote
e2e/pw-results.json while the ledger step looked in the repo root and took
the fail-safe branch: zero trials logged. A relative
PLAYWRIGHT_JSON_OUTPUT_NAME resolves against the config directory, not cwd —
reproduced synthetically with the config in a subdirectory. Absolute
workspace path on both the reporter env and the ledger read.
2026-08-24 10:33:12 -04:00
Danny Avila
f10fcd7d19
🎰 ci: Vote on the Full Mock Suite to End Phantom Spec Trials (#15162)
* ci: votes run the full mock suite; covered list from Playwright's own discovery

The vote workflow passed the merged PR's skippable tier as CLI path filters, but
playwright.config.mock.ts scopes discovery to testDir specs/mock/ — tier entries
outside that directory matched nothing, and the covered-list log line still
claimed them. Run 32701691037 proves it: a11y/keys/messages in the covered list,
zero of their tests executed, '120 passed' all from specs/mock/. The graduation
ledger was minting clean trials for specs that never ran.

Now every dev push runs the full mock suite (no path filters to mismatch), the
covered list is derived from playwright --list --reporter=json (git-enumeration
fallback over the same testDir), and each merge is one trial for every pool spec
— ~4x faster accrual toward the pre-registered graduation bars, plus the
post-merge Playwright safety net the jest workflows already have. Timeout 30->45
for the wider run; newest merge still cancels older votes; observe-only,
continue-on-error, kill switch CODEGRAPH_E2E_VOTES unchanged.

* ci: covered list from executed results, not discovery (Codex P1)

Env-gated suites (mcp-tool-list-changed needs E2E_MCP_LIST_CHANGED, enforced-
model-specs needs E2E_MODEL_SPECS_ENFORCE) are discovered by --list yet skip
every test under the vote job's default env — counting them as covered would
mint phantom trials, the exact class this PR exists to kill. The run now emits
line+json reporters and the ledger step derives covered from specs with at
least one non-skipped test outcome; no results json means no trials logged.
Verified against a synthetic suite: gated spec excluded, nested dirs handled,
crash branch logs nothing.
2026-08-24 09:04:24 -04:00
Danny Avila
b421f900dd
🗳️ ci: Log the Exact Spec List in Codegraph E2E Votes (#15143) 2026-08-23 18:26:34 -04:00
Danny Avila
061e4b02a3
🎞️ ci: Fix Playwright ffmpeg Install Hang and Cache the Download (#15065)
Every Playwright job spent a flat 90s on `npx playwright install ffmpeg`,
and none of them ended up with a usable ffmpeg.

The 2.3MB download finishes in under a second; extraction then hangs until
`timeout -k 10 90` reaps it (exit 124, masked by `continue-on-error`). That
is a Node 24.16.0 readable-stream change (nodejs/node#62557) colliding with
yauzl/fd-slicer never firing `close` after EOF, which hangs extract-zip.
It leaves a truncated `ffmpeg-linux` — 5,055,201 bytes against the zip's
declared 5,101,056, segfaulting on exec — and no INSTALLATION_COMPLETE
marker, so Playwright treated ffmpeg as uninstalled. `video: 'on-first-retry'`
has therefore never worked in CI, and every first retry of a flaky test died
in browserContext.newPage: exactly the failure the step existed to prevent.

Upstream fixed it in Playwright 1.60.0 (microsoft/playwright#40747) and Node
reverted it in 24.18.0 (nodejs/node#63834). Node 24.16.0 is pinned in 17
places including the Dockerfiles, so bump Playwright instead — it is a dev
dependency, and `^1.56.1` already permitted 1.62.1; only the lockfile pinned
it. Staying at or above 1.62.1 also avoids the tsconfig-resolution
regressions in 1.62.0.

Caching alone could not have fixed this: a cold cache still hangs, and what
would have been cached is the corrupt binary. So the ffmpeg download is now
restored from cache keyed on the resolved playwright-core version, the
install is skipped outright on a hit, and the cache is only saved once the
binary is verified to actually execute — a partial extraction can never be
promoted into a cache that every later job restores.

Per job: 90s to ~0s on a hit, ~2s on a miss.
2026-08-21 01:36:09 -04:00
Danny Avila
a0fda2cab1
🗳️ ci: Vote on Fail-Open Merges Too (Tiers Are Bridge-Derived) (#14969) 2026-08-18 08:10:09 -04:00
Danny Avila
20e2f78490
🩹 ci: Quote Colon in Codegraph Votes Workflow (Invalid YAML) (#14952) 2026-08-17 22:42:59 -04:00
Danny Avila
68ea03ffb2
🗳️ ci: Codegraph E2E Vote Runs on Dev Merges (Observe-Only) (#14947) 2026-08-17 16:22:59 -04:00