Commit graph

554 commits

Author SHA1 Message Date
Danny Avila
aa8e5849e0
⬆️ feat: Migrate to Zod v4 (#17442)
* ⬆️ feat: Migrate to Zod v4 (GHSA-mrhx-c7xc-m3w5), openai 6.49, zod-openapi 6

* 🔒 chore: Regenerate bun.lock

* 🐛 fix: Keep omitted fields absent under Zod 4 partial/optional defaults

* fix: Preserve Config Record-Key Diagnostics After Zod 4 Migration

* fix: Require Agents SDK 4.1.1 for Zod 4 Accounting

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-26 14:16:22 +01:00
Danny Avila
4cb359682a
🏤 chore: Upgrade API and Test Dependencies, Refresh Bun Lockfile (#17414)
* chore: Update package dependencies across multiple modules

- Upgraded `@azure/identity` to version 4.14.0 in package.json files.
- Updated `multer` to version 2.5.0 and `nodemailer` to version 10.2.1.
- Incremented `undici` to version 7.30.1.
- Updated `@happy-dom/jest-environment` to version 21.0.4.
- Incremented `qs` to version 6.16.1 and `fast-uri` to version 3.1.9.
- Updated `serialize-javascript` to version 7.1.4.
- Updated `zod` to version 4.6.7 in multiple modules.

These updates ensure compatibility with the latest features and security improvements.

* chore: update bun.lock file
2026-10-24 15:30:39 +02:00
Danny Avila
94ae8a4198
🪷 chore: Upgrade DOMPurify and ip-address (#17379)
Some checks failed
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 (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
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Docker Dev Images Build / publish (push) Has been cancelled
Sync Helm Chart Tags / Ignore non-main push (push) Has been cancelled
Sync Helm Chart Tags / Sync chart tags (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
* chore: Update dompurify to version 3.4.17 across all package files

- Bumped dompurify version from 3.4.16 to 3.4.17 in package.json, package-lock.json, and relevant sub-packages.
- Ensured consistency in dependency versions across the project.

* chore: Update ip-address package to version 10.7.4 in package.json and package-lock.json

- Bumped ip-address version from 10.5.1 to 10.7.4 in package.json.
- Updated package-lock.json to reflect the new version and integrity hash.
2026-10-23 07:48:26 +02:00
lia-by-librechat[bot]
6eb0cb8c44
🆙 chore: Bump Agents SDK to 4.1.0 (#17345)
Co-authored-by: Lia <lia@librechat.ai>
2026-10-22 16:53:24 +02:00
Danny Avila
a3ffa4fa6a
🚿 chore: Upgrade sanitize-html, Hono, and MongoDB Memory Server (#17343)
* 🔧 chore: Update sanitize-html and related dependencies in package-lock.json and package.json

- Upgrade sanitize-html from ^2.17.7 to ^2.18.1 across multiple package.json files.
- Update dayjs from 1.11.21 to 1.11.23 in package-lock.json.
- Upgrade is-plain-object from 5.0.0 to 5.1.0 in package-lock.json.
- Upgrade launder from 1.7.1 to 1.7.2 in package-lock.json.
- Update postcss from ^8.3.11 to ^8.5.27 in package-lock.json.

* 🔧 chore: Upgrade mongodb-memory-server to version 11.3.0 across package-lock.json and multiple package.json files

- Update mongodb-memory-server from ^11.0.1 to ^11.3.0 in package-lock.json.
- Reflect the same version change in api/package.json and packages/data-schemas/package.json.

* 🔧 chore: Upgrade hono to version 4.13.13 in package.json and package-lock.json

- Update hono from ^4.13.7 to ^4.13.13 in package.json.
- Reflect the same version change in package-lock.json.

* 🔧 chore: Upgrade follow-redirects to version 1.16.1 in package-lock.json

- Update follow-redirects from 1.16.0 to 1.16.1 in package-lock.json.
2026-10-22 13:04:12 +02:00
lia-by-librechat[bot]
df3adb837a
🐣 chore: Prepare v0.8.9-rc1 Release (#17336)
Co-authored-by: Lia <lia@librechat.ai>
2026-10-22 08:56:53 +00:00
Marco Beretta
cac1a354fd
📦 fix: Strip Assistant Prefill for Claude 5.x Models (#17209)
* fix: Bump @librechat/agents to 4.0.6 for Claude 5 Prefill Stripping

* test: Cover Assistant Prefill Stripping Through the Anthropic Client
2026-10-17 21:42:18 +02:00
Danny Avila
b760839c0c
🧵 fix: Harmony Headers in Text Attachments Break OpenAI Models on Bedrock (#17101)
* 🧵 test: Cover Harmony Headers in Text Attachments Sent to OpenAI Models on Bedrock

A pasted text/plain attachment is sent inline as file context, so a harmony header such as `<|channel|>analysis` inside it reaches every later turn. OpenAI models on Bedrock answer that request with an event stream that closes before any event, which crashed the turn in @librechat/agents 4.0.4 with `Cannot use 'in' operator to search for 'tool_calls' in undefined`.

Drive LibreChat's own file-context formatting through the SDK's Bedrock model with a recorded response and assert the header reaches an OpenAI model neutralized and other model families unchanged.

* 📦 chore: Bump @librechat/agents to v4.0.5

* 📦 chore: Regenerate the Lockfile with npm 11 to Keep libc Constraints
2026-10-16 18:00:15 -04:00
Dustin Healy
73847f2db5
🔌 feat: Integrate Durable Skill Lifecycle Across Writers and Routes (#17043)
* feat: integrate durable Skill lifecycle across writers and routes

* 🧪 test: Cover Skill Management Deletion End to End

* fix: Queue superseded Skill blobs for durable cleanup

* fix: Reject Skill file storage moves without new identity

* 🧪 test: Cover Skill UI Delete and Cleanup Restart

* 🧪 test: Assert Durable Cleanup for Replaced Skill Files

* fix: release Skill names during account deletion marking

* fix: use reserved Skill blob plans across writers

* fix: hold superseded Skill blobs until sync commits

* test: preserve account deletion retry coverage after restack

* test: verify durable Skill cleanup after account erasure

* fix: complete Skill cleanup leases and avoid historical metadata scans

* fix: bound Skill cleanup manifest processing
2026-10-16 09:05:05 -07:00
Danny Avila
c83af2000a
🔒 chore: Resolve Open Dependabot Security Alerts (#17016)
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
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
- compression ^1.8.2, handlebars ^4.7.10, sharp ^0.35.5 (librsvg 2.63.2),
  @opentelemetry/instrumentation-mongoose ^0.67.0 as direct bumps
- proxy-addr 2.0.8 and source-map-js 1.2.2 as in-range lockfile refreshes
- raise the existing katex overrides from ^0.16.21 to ^0.18.2 (resolves 0.18.10)
2026-10-16 07:01:43 -04:00
Danny Avila
685c8b5b43
🔒 fix: Upgrade the MCP SDK Past the OAuth Credential Leak (GHSA-6qxp-vccf-f47h) (#17015)
Bump @modelcontextprotocol/sdk from ^1.30.0 to ^1.32.1 in api and
packages/api. 1.31.0 binds stored OAuth credentials to the issuing
authorization server; LibreChat does not use the affected auth()/
authProvider path and already pins refreshes to the stored token endpoint.

1.32.0 makes the client transports follow same-origin redirects
themselves, which would re-issue requests the connection fetch declined
(hop cap, reauthorized tools/call). Set redirectPolicy: 'follow' so
redirects stay with the connection fetch, and cover both transports with
real-SDK tests.
2026-10-16 07:01:25 -04:00
Marco Beretta
5fc4371c6a
🪦 refactor: Remove Dead Legacy API Modules and Root Tooling (#17114) 2026-10-15 12:25:24 +02:00
lia-by-librechat[bot]
114394c6a0
🦉 feat: Compare Review Commit Ancestry Without Git (#16734)
* 🦉 feat: Compare Review Commit Ancestry Without Git

* test: Cover Attached Reviewer Compare Registration

* 🦉 feat: Compare Review Commit Ancestry Without Git

* test: Cover Attached Reviewer Compare Registration

* 🦉 feat: Use SDK GitHub Comparison With Host Eligibility Gates

* test: Await the Comparison Timeout Assertion

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-05 08:20:51 -04:00
Danny Avila
ada91c13b6
📦 chore: npm audit fix + bump agents SDK to v4.0.1 (#16581)
* chore: bump dompurify

* chore: bump agents sdk to v4.0.1
2026-09-30 22:12:41 -04:00
Danny Avila
57487088e5
📦 chore: bump agents SDK to v4.0.0 (#16558) 2026-09-30 06:22:35 -04:00
Danny Avila
6a1d30cac3
🚀 v0.8.8 (#15735)
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/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
2026-09-29 23:55:37 -04:00
lia-by-librechat[bot]
03b89f88c5
🔩 fix: Raise Vulnerable Dependency Floors (#16474)
Co-authored-by: Lia <lia@librechat.ai>
2026-09-28 22:30:45 -04:00
Danny Avila
c8c5478cf1
📦 chore: bump agents SDK to v3.9.7 (#16425)
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/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
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (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
2026-09-27 22:13:29 -04:00
Danny Avila
3c08a7dd04
📦 chore: bump @librechat/agents SDK to v3.9.6 (#16354)
* 📦 chore: bump `@librechat/agents` SDK to v3.9.5

* 🐛 fix: Preserve Fading Tier State With Agents SDK v3.9.5

* 📦 chore: bump `@librechat/agents` SDK to v3.9.6

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-09-25 09:53:34 -04:00
Danny Avila
f13b0eaef4
🚚 chore: Point Repository and Image References at LibreChat-AI (#16005)
Some checks failed
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/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
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
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Publish `librechat-data-provider` to NPM / pack (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / pack (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Has been cancelled
Update package repository and bugs URLs, GitHub links in docs, templates and comments, and image references (compose files, deployed-update, Helm values and renovate hints) from danny-avila to LibreChat-AI / librechat-ai. Covers the rag-api repository and its images, which moved to the organization. Sponsor links and the sealed star-history chart are unchanged.
2026-09-23 23:08:36 -04:00
lia-by-librechat[bot]
b374360775
🚡 chore: Bump Agents SDK to v3.9.3 (#16261)
* 🚡 chore: Bump Agents SDK to v3.9.3

* chore: Lock Agents SDK 3.9.3 release

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-09-23 19:44:25 -04:00
Danny Avila
361553f332
🚀 v0.8.8-rc4 (#16147)
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
Publish `librechat-data-provider` to NPM / pack (push) Waiting to run
Publish `librechat-data-provider` to NPM / publish-npm (push) Blocked by required conditions
Publish `@librechat/data-schemas` to NPM / pack (push) Waiting to run
Publish `@librechat/data-schemas` 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
* 🚀 v0.8.8-rc4

* chore: bump LibreChat chart to 2.0.14
2026-09-22 23:30:28 -04:00
Danny Avila
a54cc32b31
📦 chore: bump agents SDK to v3.9.1 (#16212) 2026-09-22 14:08:33 -04:00
Danny Avila
026f17e1af
🦾 chore: Bump Agents SDK to v3.9.0 (#16142) 2026-09-20 20:20:41 -04:00
Danny Avila
2df937dd06
🌳 feat: Isolate Attached Workspaces by Conversation (#16107)
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/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
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
* feat: bind attached workspaces to conversations

* ⬆️ chore: bump agents to 3.8.8
2026-09-19 23:19:26 -04:00
Dustin Healy
44af4d3789
📖 fix: Verify Agents OpenAPI contracts and disable external reporting (#16028) 2026-09-16 15:17:56 -04:00
Atef Bellaaj
69f0dd2a12
🔌 feat: OpenAPI spec and docs for the public Agents API (#15928)
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/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
* 🔌 feat: OpenAPI spec and docs for the public Agents API

* 🔧 fix: address review on Agents API OpenAPI spec and docs:

- adapter: mark JSON request bodies as required
- openapi.js: move gate, config read and spec serving into packages/api
  as an injected router factory; leave /api as wiring only
- docs: compute URLs in-browser and use a relative servers url so docs
  work under a base path (e.g. /chat)
- build: copy the generated spec into dist so the multi-stage image ships it
- agents: reuse the enforced list envelope for the docs so the AgentList
  schema cannot drift from the runtime cursor and strictness

* 🔧 fix: align Agents API OpenAPI contract with enforced runtime

Second review round on the public Agents API spec. Three cases where the
published contract described something the server does not do, so generated
clients would fail against the live API:

- Upload form: document the `purpose` field (enum: file_search, execute_code,
  context) that POST /agents/{id}/files actually requires, instead of the
  internal-only `tool_resource`; requests following the old form were rejected
  with 400 because `purpose` was absent.
- Auth: drop the `apiKeyBearer` scheme from the management and skill endpoints.
  They gate on OIDC/M2M via requireAgentManagementAuth and deliberately reject
  the API-key fallback; the API key belongs to the out-of-scope
  OpenAI-compatible endpoints and returns when those are documented.
- Skill update: document the 409 conflict PATCH /skills/{id} returns on a stale
  expectedVersion. The agent update path collapses its internal 409 to 400, so
  it correctly keeps no 409.

* 🔧 fix: serve docs on experimental server and document the 401

Third review round on the public Agents API spec.

- Experimental server: mount routes.openapi in api/server/experimental.js before its /api 404 handler. Without it, npm run backend:experimental returns 404 for /api/docs and /api/openapi.json even when openapi.enabled is true, because that server never mounted the router.
- Auth failure: document the 401 that requireAgentManagementAuth returns on a missing, expired, malformed, or unbound token. Its body is { "error": "Unauthorized" }, a flatter shape than the management error schema, so add a dedicated UnauthorizedError schema and a shared 401 response to the agent and skill contracts rather than reusing the standard error schema.

* 🔧 fix: document skill-update, auth-conflict, upload-limit, and watch-copy gaps

* 🔧 fix: added error shapes for permission denied and internal server errors in API responses docs

* fix: cover the auth-layer 500 shape and pin the account-deletion code

* fix: update OpenApiRouterDeps documentation and simplify request handling in isEnabled function

* 🔧 fix: gate the Swagger asset mount behind the OpenAPI toggle

* 🔧 fix: accept the malformed-JSON 400 envelope in the contract

* fix: accept the tenant-isolation 403 envelope in the contract

* fix: add description for content property in SkillFileUpdateRequest to clarify byte limit
2026-09-16 13:50:05 -04:00
Ravi Kumar L
e32e9f3222
⬆️ chore: bump agents to 3.8.7 (#15947) 2026-09-14 18:45:52 -04:00
Danny Avila
e18606e5ce
🚀 v0.8.8-rc3 (#15859)
Some checks failed
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
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Publish `librechat-data-provider` to NPM / pack (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / pack (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Has been cancelled
* 🚀 chore: prepare v0.8.8

* 🚀 chore: prepare v0.8.8-rc3

* docs: mention Agent workspace defaults
2026-09-13 02:17:48 -04:00
Joseph Licata
f25242df98
🦘 feat: Share Run-Scoped Files With Subagents (#15848)
* feat: add run-scoped file sharing for subagents

Delegate current-message files through authorized execution catalogs and publish selected immutable code-output versions through the existing file pipeline.

Requires the companion agents SDK context adapter before the dependency can be released and pinned.

* fix: preserve child tool artifacts and verify file-sharing lifecycle

Keep citations and other non-sandbox artifacts on their existing delivery path while retaining private code outputs and inspected images until publication.

Cover native and text delivery, nested and sibling authorization, concurrent runs, cancellation cleanup, and checkpoint recovery through the browser harness.

* test: align file-sharing fixtures and integration cleanup

* test: repair LibreOffice conversion fixtures

* test: verify deployment skill bytes across checkout formats

* fix: align subagent file budgets and refresh boundaries

* chore: update agents SDK to 3.8.6

* refactor: move code output processing into API workspace

* fix: enforce shared file budgets for parents and teams

* fix: declare the shared file encoder interface
2026-09-12 20:14:22 -04:00
Danny Avila
c79f13b1f1
📦 chore: bump npm audit packages and @librechat/agents to v3.8.5 (#15770)
* chore: bump agents sdk to v3.8.5

* chore: bump nodemailer to v10.0.1

* chore: bump sharp to v0.35.4

* chore: bump js-yaml to v4.3.2

* chore: bump hono to v4.13.7 and @hono/node-server to v2.1.1
2026-09-09 01:33:24 -04:00
Danny Avila
ba12eaa418
⛔ fix: Bind Tool Approvals to Generation Scope (#15724)
* fix: bind tool approvals to generation scope

* fix: gate generation scope on replay lifecycle support

* chore: add npmrc for npm v12 support, fix xlsx tarball dl

* chore: bump agents sdk to v3.8.3

* fix: require scoped approval replay support
2026-09-08 08:02:48 -04:00
Danny Avila
6f05678bfc
🧐 feat: Restore Interactive Tool Approval Review (#15717)
* 🧐 feat: Review Pending Tool Actions in the Composer (#15714)

* feat: add interactive approval review to the composer

* fix: Harden interactive approval boundaries

* fix: Bound every approval display label

* test: exercise composer approval review in BYOM acceptance

* fix: reveal all directional approval controls

* fix: canonicalize code approval targets across replicas

* style: sort resumable approval test imports

* test: Exercise Coexisting Approval Surfaces

* Revert "🧐 feat: Review Pending Tool Actions in the Composer (#15714)"

This reverts commit 5f79ded9553405b697e837e1976a70accbfc3fc3.

* Reapply "🧐 feat: Review Pending Tool Actions in the Composer (#15714)"

This reverts commit 52c7d9c7453da0168338bcf79494927f561a92a0.

* chore: bump agents sdk to v3.8.2
2026-09-07 22:02:56 -04:00
Danny Avila
3e2a6f333b
🪗 feat: Compact Context in a Summarize-Only Turn (#15690)
* 🗜️ feat: Manual Context Compaction as a Summarize-Only Turn

Adds a user-triggered "Compact context" action that summarizes the active
branch on demand. The compaction is an ordinary agent turn: the client
submits it through the normal chat pipeline with `compact: true`, the
controller hangs it off the branch's leaf instead of creating a user
message, and the agent client runs the graph summarize-only (the SDK's new
`summarizeOnly` input), so the summary streams into the response
placeholder under the leaf exactly like the automatic detour's and is
persisted as the boundary every later turn starts from.

Nothing new is needed for job registration, billing, abort, persistence,
or the usage snapshot: the run emits the same summary step and post-summary
context snapshot the automatic path already emits, and the response message
carries the summary part plus the `summaryUsedTokens` baseline the gauge
reads. The controller validates the request (existing conversation, a real
leaf, summarization enabled, no edit/regenerate/continue combination) and
answers 409 when the leaf is already a bare summary.

Client-side the submission borrows the regenerate shape — no new user
bubble, the placeholder parents onto the leaf — while the wire payload
drops `isRegenerate` so the server never treats it as a regenerated user
turn. The action sits in the context-usage popover, gated by the same
`summarization.enabled` switch as the automatic detour.

* 🗜️ fix: Localize a Compaction That Cannot Run

A compaction the graph could not attempt (summarization disabled, the
instructions already exceeding the budget, or an explicit recency window
covering the whole conversation) rejects with the SDK's
`ManualSummarizationSkippedError`, which rendered as the generic admin
error. It now maps to a typed `compaction_skipped` payload with the reason,
and a run that ends with neither a summary nor a recorded error fails as
`compaction_failed`; the Error component localizes both. A run that already
recorded why it stopped keeps that error part instead of failing twice.

* 🗜️ fix: Anchor a Compaction on the Leaf Everywhere It Is Read

Review round 1.

- The client sent the leaf's parent as `parentMessageId`, which the
  controller treats as the anchor, so the summary would have skipped the
  latest reply and landed as its sibling. The leaf's own id is now both the
  placeholder's parent and the server-side anchor.
- A compaction has no user message of its own, and every consumer of the
  job's user-message slot now knows it: the error path parents its row on
  the loaded anchor and never upserts the leaf, and the job records the
  regenerate shape so a reconnecting client rebuilds the turn under the
  leaf instead of recreating it as a user message.
- The controller no longer reads the anchor before the branch is loaded;
  `BaseClient` validates it against the history it loads anyway and
  answers 404 for a missing leaf or a typed `nothing_to_summarize` for a
  finished compaction. That predicate is shared through the data provider
  and ignores a summary still streaming or one that failed, so an
  interrupted compaction can be retried.
- A compaction never consumes files staged in the composer, the action is
  shown only when the server advertises `compactionEnabled`, and the
  in-flight marker is feature-local Jotai state rather than a read of the
  Recoil submission store.

* 🗜️ fix: Keep a Compaction Turn to Its Summary

Review round 2, plus the class it belongs to. A compaction submits no user
turn, so nothing that keys off one may run: the memory pass no longer runs
over the history (it would have spent a model call and could repeat memory
writes), and skill primes are no longer injected into the transcript the
run is about to summarize.

The client's in-flight marker is also reconciled on mount: a compaction
that finished while the view was away left the marker set, and the next
ordinary turn in that conversation would have shown as compacting.

* 🧹 chore: Sort Imports in the Compaction Hook Spec

* 🔧 chore: Update @librechat/agents dependency to version 3.8.1 in package-lock.json and package.json files
2026-09-07 21:51:54 -04:00
Danny Avila
b181ef0232
🪬 feat: Configure Langfuse Trace User Identity and Metadata (#15667)
* 🪪 feat: Configurable Langfuse Trace User Identity and Metadata

* 🪪 fix: Prefer createRun's conversationId and warn once on an unset userIdField

* 🪪 fix: Validate Langfuse trace field names at the point of use

* 🧹 chore: Sort identity imports

* 🪪 fix: Source the trace model label from the initializer, not a prompt-affecting option

* 🧪 fix: Build the trace context without a prototype so partial client contexts resume

* 📦 chore: Bump `@librechat/agents` to v3.8.0 for the Langfuse trace userId override
2026-09-06 17:30:23 -04:00
Marco Beretta
10c5c91594
🎨 feat: Theme-Adaptive SVG Support for Custom MCP and Group Icons (#13817)
* feat: theme-adaptive SVG support for custom MCP and group icons

Custom icons (MCP server iconPath, model spec groupIcon) were rendered as
plain <img>, so monochrome SVGs kept fixed dark colors and were nearly
invisible in dark theme.

Introduce a shared CustomIcon component that detects monochrome SVG glyphs
and tints them with currentColor so they follow the active theme, while
multi-color SVG logos and raster images keep their original colors. The
monochrome decision parses the SVG's color tokens; content is fetched once,
cached, and any failure falls back to the original image. Monochrome SVGs
render via CSS mask, never inlined, so no SVG markup reaches the DOM.

Apply across all custom-icon surfaces: MCP settings cards, the chat MCP
dropdown, stacked MCP icons, tool-call headers, and model group icons.

Also support SVG in the MCP avatar uploader: add SVG to the accepted file
types and sanitize uploaded SVGs with DOMPurify before storing them, and
make the dialog preview theme-adaptive via the same component.

Add unit tests for SVG detection, monochrome analysis, sanitization, and
CustomIcon rendering.

* fix: reset adaptive icon tint state when the source changes

A reused CustomIcon instance kept the monochrome verdict from a previous
source until its effect re-ran, so switching to a raster image or a new
multi-color SVG could briefly render it as a currentColor silhouette.

Key the resolved verdict to the current source and reset it synchronously
during render (seeding from cache when available), so a stale verdict can
never tint a different icon. Add hook tests covering the source change.

* fix: do not tint custom SVGs that have an opaque background

A grayscale SVG with an opaque full-canvas background (for example an
exported logo with a white background rect and a black glyph) passed the
monochrome check and was drawn through a CSS mask. Masks key off the alpha
channel, so the opaque background filled the whole area with the tint color
and the icon collapsed into a solid block.

Detect a full-canvas opaque background rect and exclude such SVGs from
tinting, rendering them with their own colors instead. Transparent
single-color and multi-shade glyphs remain tintable. Add tests for the
background cases.

* fix: detect opaque SVG backgrounds without a viewBox

Opaque background detection only read canvas dimensions from the viewBox, so
an SVG that declares width and height on the root element but omits the
viewBox slipped through and was tinted into a solid block.

Fall back to the root svg width and height when no viewBox is present, and
match attribute names exactly so stroke-width is not mistaken for the canvas
width. Add tests for the no-viewBox cases.

* fix: parse comma-separated SVG viewBox values

The viewBox regex only accepted whitespace between values, so a valid
viewBox like "0,0,24,24" failed to parse and an opaque background went
undetected, tinting the icon into a solid block. Accept commas and
whitespace as separators. Add a test for the comma-separated case.

* refactor: detect SVG tintability with DOMParser instead of regexes

The monochrome/tintable decision scraped SVG markup with regexes, which kept
missing edge cases (opaque backgrounds, missing or comma-separated viewBox,
stroke-width vs canvas width, embedded raster images).

Parse the SVG once with DOMParser and inspect real elements and attributes:
reject embedded <image>/<foreignObject> content, detect a full-canvas opaque
background rect, read the canvas size from the viewBox or root width/height,
and gather paint colors from attributes, inline styles, and <style> blocks.
Unparseable input is treated as not tintable. Tests cover these cases.

* fix: only tint single-tone grayscale SVGs

A grayscale SVG can draw its background as a full-canvas path (not just a
rect), e.g. a white background path plus a black glyph. The rect-only
background check missed that, and the icon flattened to a solid currentColor
block under the CSS mask.

Tint only when the SVG resolves to a single grayscale tone. Any second tone
(a background shape drawn as a path or rect, an accent, or a second shade)
now preserves the icon's own colors, which covers full-canvas path
backgrounds without per-shape geometry parsing.

* fix: count default black fill when detecting tintable SVGs

* fix: treat currentColor as a tone and stroked closed shapes as filled

* fix: ignore non-rendering template paint and count filled open paths

* fix: scan defs and symbol paint rendered through use references

* fix: resolve currentColor against fixed color and match style fills for default paint

* fix: treat alpha-zero fills as transparent in SVG tint detection

* fix: resolve inherited and CSS fill for backgrounds and default paint

* fix: resolve CSS currentColor and default-black use instances

* fix: count default-filled polylines when detecting tintable SVGs

* fix: resolve inherited fill and style/CSS opacity in SVG tint detection

* fix: ignore display:none shapes and stop counting CSS color as paint

* fix: only count CSS paints that match rendered elements

* fix: match root for CSS currentColor and skip unreferenced defs tones

* fix: count paint only on rendered shapes and filter hidden CSS currentColor

* fix: resolve use-instance currentColor and skip hidden use default fills

* fix: resolve CSS paints onto rendered painters and skip overridden use fills

* fix: keep checking ancestor opacity after resolving paint opacity

* fix: resolve CSS paints by specificity and skip transparent default fills

* fix: apply CSS over presentation attributes and follow nested use targets

* fix: strip CSS comments, honor visibility, and inherit paint through nested use

* fix: skip transparent svg use references

* Account for SVG filter colors

* fix: propagate outer use color through nested currentColor references

* fix: preserve url() id casing and record every nested use chain

* fix: preserve SVGs whose filters recolor the source

* refactor: detect monochrome icons via canvas pixel sampling

Replace the SVG source parser with offscreen-canvas pixel sampling: draw the icon, read pixel data, and treat it as monochrome only when every non-transparent pixel is grayscale within tolerance and the image has some transparency (a fully opaque image would mask to a solid block). Verdicts are cached per src.

An explicit monochrome flag on CustomIcon skips detection; sampling is the fallback. Image load failures and canvas taint from non-CORS cross-origin icons fall back to untinted rendering instead of throwing.

* harden custom SVG icon handling across security, a11y, and perf

Sanitize user-provided MCP iconPath server-side; the client-side
DOMPurify pass was bypassable by posting iconPath straight to the API.
Adds sanitizeMcpIconPath in @librechat/api (allowlist SVG sanitizer that
preserves case-sensitive names) and runs it in the create/update
controllers, plus a length cap on iconPath in the shared schema.

- gate theme detection to same-origin/data sources so a remote icon is
  no longer auto-fetched from every viewer's browser
- restore forced-colors (High Contrast) visibility and the broken-icon
  onError fallback for tinted icons
- mark redundant icons decorative to avoid screen-reader double reads
- base64-encode inlined SVG data URIs and bound the verdict cache
- harden the client SVG sanitizer and guard FileReader failures
- cover the tinted render branch, sanitizer allowlist, and edge cases

* fix: preserve local SVG references while stripping external hrefs

The hardened sanitizers dropped <use> and every href outright, blanking
self-contained exporter output like <defs><path id="p"/></defs>
<use href="#p"/> and gradients inheriting stops via href="#g".

Re-allow <use> and href/xlink:href on both sanitizers, restricted to
same-document fragments: the client uses a dedicated DOMPurify instance
with an afterSanitizeAttributes hook (kept off the shared default
instance), and the server mirrors the rule with a sanitize-html tag
transform plus an empty allowedSchemes list as a second layer. External,
protocol-relative, relative-path, and javascript: hrefs are still
stripped, leaving the element inert.

* fix: keep xlink namespace and safe filters in the server icon sanitizer

The server allowlist stripped xmlns:xlink from the root while keeping
xlink:href, leaving an unbound prefix that is a parse error once the
icon is stored as an image/svg+xml data URI, so SVG 1.1 exporter output
went blank after save. It also dropped <filter>/fe* primitives that the
client sanitizer's svgFilters profile allows, so icons relying on
effects like feDropShadow lost them between preview and reload.

Allow xmlns:xlink and mirror the client's filter allowlist (elements
plus their presentation attributes); feImage passes through the existing
fragment-only href transform, so external references are still stripped.

* fix: require empty pixels for tinting and block external url() references

Two issues from review of the icon sanitizer and monochrome detector:

- scanMonochrome flagged any pixel below full opacity as transparency,
  so an SVG that fills the whole canvas with a semi-transparent grayscale
  wash was tinted and rendered as a solid currentColor block. Require a
  genuinely empty pixel (alpha at or below the paint threshold) instead.

- The fragment-only reference rule only covered href/xlink:href, so a
  url() in filter/fill/mask/clip-path/style kept external targets like
  filter="url(https://evil/f.svg#f)". Both sanitizers now strip any
  attribute carrying a non-fragment url(), preserving local url(#id).

* fix: preserve internal SVG stylesheets while scrubbing their references

Exporter SVGs that store multi-color paint in an internal <style> block
(e.g. .red{fill:#e00} with class="red") lost all styling because the
sanitizers dropped <style> outright, so multi-color logos rendered with
default paints after upload.

Re-allow <style> on both sanitizers and scrub its CSS: strip comments
and @import at-rules and rewrite any non-fragment url() to none, keeping
local url(#id) paints. These icons only render in inert <img>/CSS-mask
contexts isolated from the host page (no script, and no subresource
loads once external refs are scrubbed), so a script-free stylesheet is
safe to keep; a premature </style> close still has its trailing markup
re-sanitized by the parser.

* fix: normalize icon value before deciding it is not an SVG data URI

A posted iconPath with leading whitespace or C0 controls (e.g.
"\n data:image/svg+xml,...") slipped past the anchored data-URI check,
so sanitizeMcpIconPath returned it raw while a browser trims the prefix
and still renders the SVG, keeping its external <image>/url() and other
stripped content. Normalize the value the way URL parsing does, trimming
leading/trailing C0 controls and spaces and removing embedded
tab/newline, before the SVG check so these variants are sanitized too.

* fix: cap sanitized icon length and re-encode as compact base64

The schema length check ran on the input, but sanitizeMcpIconPath then
re-encoded the markup with encodeURIComponent, which expands SVG by well
over the base64 input size (a 235KB base64 icon became a 374KB percent
string). create stored that over-limit value, and editing the server
resubmitted the prefilled value and failed MCPServerUserInputSchema.

Re-encode the sanitized SVG as base64 (far more compact for angle-heavy
markup, which sanitizing can itself grow via explicit close tags) and
drop anything still over MAX_MCP_ICON_PATH_LENGTH, so a stored icon can
never exceed the cap that a later edit re-validates against.

* fix: resolve CSS escapes before stripping external SVG references

A literal url(/@import matcher missed CSS-escaped references: a value
like style="fill:u\72l(https://attacker/x)" or an escaped @import
survived sanitization because the browser un-escapes \72 to r at
tokenization time while the regex never saw a url(...). The external
reference was then persisted and served to other clients.

Un-escape CSS the way a browser does (single pass over \hex and
\char escapes) before the url()/@import matchers run, on both the client
and server sanitizers. Also scrub the multi-declaration style attribute
in place instead of dropping it, so co-located local paint rules survive
while escaped external references are neutralized.

* fix: re-sanitize after scrubbing style blocks to block markup reintroduction

scrubStyleBlocks runs after sanitizeHtml and splices un-escaped CSS back
as raw markup, so an escaped sequence like \3c/style\3e\3cimage/\3e
(inert text during the first pass) became a real </style><image href>
element after unescaping, past the allowlist. Re-run the allowlist over
the scrubbed result whenever a <style> block was rewritten, stripping any
element the un-escaping surfaced while leaving legit local rules intact.

The client sanitizer is unaffected: it sets the scrubbed CSS as a DOM
text node, which serializes with < and > escaped, so no element is
reintroduced. Added a regression test pinning that behavior too.

* fix: make forced-colors icon tint override the inline background color

The forced-colors rule for .custom-icon-tint had no !important, so it
lost the cascade to the element's inline `background-color: currentColor`
and the masked glyph still blanked out in Windows High Contrast — the
exact regression the rule was meant to prevent. Verified in a real
forced-colors render: without !important the tinted icon is invisible;
with it the glyph paints in CanvasText and stays visible.

* fix: enforce icon length cap in the sanitizer, not the schema

The schema `.max()` on iconPath rejected the whole update at parse time.
A server whose stored icon predates the cap (previous versions allowed
large data-URI images) re-submits that value from the edit dialog, so
the user was locked out of changing any field or clearing the bad icon.

Drop the schema `.max()` and enforce MAX_MCP_ICON_PATH_LENGTH in
sanitizeMcpIconPath for every value type: an over-cap SVG is compacted
or dropped, an over-cap raster/URL is dropped. Editing a server with a
pre-existing oversized icon now succeeds and clears the icon instead of
failing validation.

* fix: decode XML entities and parse quoted URLs in SVG CSS scrubbing

Two more bypasses of the CSS reference scrubber, both live once the
stored image/svg+xml is parsed by a viewer:

- A <style> block reaches the scrubber as raw text, so an entity-encoded
  reference like &#64;import (or &#x40;import) was never seen as @import;
  the browser decodes it at render time. Decode XML character references
  (numeric + the five predefined named) before the matchers run.
- The url() regex excluded ')' even inside quotes, so a valid quoted URL
  like url("https://x/a)b") slipped through. Parse quoted and unquoted
  URL tokens separately so a ')' inside quotes stays part of the target.

Applied to both the server (sanitizeMcpIconPath) and client (sanitizeSvg)
scrubbers. Entity decoding also catches an entity-encoded </style> markup
breakout, which the re-sanitize pass then strips.

* fix: close custom icon review threads

* fix: transpile sanitize-html's ESM dependency chain in api jest runs

* fix: preserve marker definitions and fragment-only marker references

* fix: keep object-cover sizing when tinting masked icons

* fix: preserve textPath labels and currentColor color scopes in icon sanitizer

* fix: preserve pattern coordinate-system attributes in icon sanitizer

Keep patternUnits, patternContentUnits, and patternTransform so patterned
SVGs do not fall back to objectBoundingBox after server-side sanitize.

* refactor: sanitize icons with one shared DOMPurify policy

The server re-implemented DOMPurify's SVG profiles as two hand-written
sanitize-html allowlists, so every element and attribute the client kept had to
be transcribed by hand, and each miss surfaced as an icon that previewed
correctly and then lost its markers, patterns, filters, or xlink binding once
stored. Run DOMPurify on jsdom instead and share the config and reference hook
with the client, which drops both allowlists.

Restrict url() values to same-document fragments on every attribute rather than
on the marker properties alone, so external references in fill, stroke, filter,
mask, and clip-path are stripped as well.

Restore feDropShadow casing after sanitizing. DOMPurify has to parse as HTML,
its XML mode drops filter primitives and gradients, and the HTML tag-name
adjustment table predates that primitive, so it survived lowercased and left its
filter empty once the stored icon was re-parsed as image/svg+xml.

* fix: defer jsdom load until MCP icon sanitization

jsdom and dompurify were imported at module scope, so every
require('@librechat/api') paid their startup cost. Load them on first
SVG sanitize instead.

* fix: sort type import in MCP icon sanitizer

The static-check import sorter wants value imports before type-only
imports. Moving the DOMPurify type import after librechat-data-provider
clears the drift.

* fix: address PR review bot findings

chatgpt-codex-connector:
- Resolve icon URLs through new URL() instead of trusting a leading slash, so
  /\attacker.example/icon.svg is no longer treated as same-origin
- Check every url() token in an SVG attribute rather than only the first, and
  reject values carrying a CSS escape that would decode into one
- Forbid animateTransform, animateMotion, animateColor, and mpath, which the
  SVG profile admitted despite the policy intending to remove animation
- Preserve the radial-gradient fr attribute the profile omits
- Reject multi-tone grayscale in scanMonochrome, which a mask would flatten
- Sample at 128px so a small chromatic accent is not averaged away
- Settle a stalled icon load after 10s so its in-flight entry is released
- Bound the decoded SVG before building a jsdom tree for it
- Reject an oversized icon upload with a visible error instead of accepting it
  and silently clearing it on save

* fix: address Codex findings and trim icon sanitizer comments

- Bound icon files by size before reading or sanitizing them
- Track tone spread across every painted pixel, not only solid ones
- Settle monochrome detection on any sampling throw
- Use named DOMPurify/JSDOM types and shorten PR comments

* fix: percent-decode SVG data URI bodies before base64 decoding

* fix: declare the SVG namespace on sanitized icons and keep icon rejections out of form validity
2026-09-04 10:49:43 -04:00
Danny Avila
ee0a51ac19
🪵 fix: Log Code API Auth Header Failures With Request Context (#15592)
* 🪵 fix: Log Code API Auth Header Failures With Request Context

Every Code API tool LibreChat builds — `execute_code`, `bash_tool` and
the PTC tools — resolves its auth headers through
`codeExecutionAuthHeaders`. When that throws, `@librechat/agents`
replaces it with a fixed "Code execution is not authorized" string
before either the model or the operator sees it, and the SDK's own
console diagnostic carries no request or user id.

Log the failure here before rethrowing. Winston attaches requestId,
userId and tenantId to every record, so this is the only line that can
be correlated with the `[code-env:inject]` events surrounding a failed
execution. Rethrowing unchanged keeps the SDK's sanitization intact —
the model-facing message does not change.

* 🧵 fix: Carry Non-Error Auth Failures Into the Log Message

winston folds an `Error` meta's message and stack into `info.message`
before any format runs, so an Error cause already survives the plain
console format that prints `info.message` alone. A non-Error rejection
does not: winston drops a string or plain-object meta from that format
entirely, leaving the same generic line the SDK's sanitization produces.

Append the cause to the message only when it is not an Error, so the
Error path stays free of a duplicated message. A new spec renders both
paths through a real winston transport whose format prints nothing but
`info.message`, which is what pins the distinction.

* 🧯 fix: Keep the Auth Failure Cause Out of Winston Metadata

Passing the caught value as positional metadata had three separate
failure modes, all measured against real winston.

Winston merges object metadata onto the log record, so a rejection
carrying `tenantId`, `userId` or `event_name` lands on top of the fields
`attachRequestContext` fills in — and that function deliberately keeps an
already-present value, so the failure would be attributed to the wrong
user or have its identity stripped by a matching event name. An `Error`
is no safer: only its custom enumerable properties are copied, which is
exactly the reachable set.

Any metadata also arms `format.splat()`, which then treats a `%s` in the
cause as a substitution token: rejecting with `service said %s
unavailable` rendered `service said service said %s unavailable
unavailable`.

And `String()` throws on a null-prototype object, so an exotic rejection
made the catch block throw its own formatting error instead of logging
and rethrowing the original.

The cause is now derived through a guarded formatter and inlined in the
message, with no metadata at all — which is also what makes it visible on
the console format that prints `info.message` alone. The rendering spec
now runs through `errors()` and `splat()` as well as the bare printf, and
restores each transport's previous `silent` value rather than assuming it
was false.

* 🔑 fix: Keep Signing Material Out of Code API Key Load Failures

Node 24's JSON `SyntaxError` quotes an excerpt of the source around the
offending token, so a malformed `CODEAPI_JWT_PRIVATE_JWK_JSON` produces
`Unexpected token 'M', ..."d":MIIEvgIBAD"... is not valid JSON` — private
key material inside an error message, which every caller then logs. The
message redaction patterns do not recognize a bare base64 fragment, so
nothing downstream would have caught it.

`createSigningKey` now converts any load failure into a diagnostic naming
the failure and the key format it attempted, and nothing more. That makes
the message safe by construction rather than by scrubbing, which matters
because the log added in this branch is what would have persisted it.

Also guard the `name`/`message` reads in the cause formatter: a proxy can
throw from either accessor, which would have replaced the rejection with
a formatting error and logged nothing at all.

* chore: bump agents sdk
2026-09-04 10:38:49 -04:00
Danny Avila
c00acb36a0
🌌 feat: Add GPT-6 Astra Support (#15567)
* 🌌 feat: Add GPT-6 Astra Support

Registers OpenAI's GPT-6 Astra (`gpt-6-astra`) as a first-class model on the
canonical OpenAI endpoint.

Every model-specific behavior Astra requires — Responses routing for tool
calls, stripping the sampling and logprob parameters it rejects, and
substituting the `none`/`minimal` reasoning efforts it does not accept — lands
in `@librechat/agents` (danny-avila/agents#506) rather than here. None of it is
expressible at configuration time: tools bind after `getOpenAIConfig` runs, and
LangChain's request builders emit `temperature`/`top_p` from instance fields
regardless of what this layer sets. Keeping it in the SDK also means the
routing gate can be the documented rule (tools present) instead of the
over-approximation the config-time GPT-5.6 path is forced into.

What is left here is registration:

- 1,050,000-token context window and 128K max output
- Model dropdown (config.ts) and the `OPENAI_MODELS` example
- Standard pricing: $10/M input, $1/M cached input, $12.50/M cache writes,
  $50/M output
- The >272K long-context tier, which LibreChat already supports through
  `premiumTokenValues`/`premiumCacheTokenValues`: 2x input and cache rates and
  1.5x output for the full request

Batch/Flex (50%) and Fast mode (2x) have no representation in the pricing
model today and are not introduced here; they apply per-request rather than
per-model, so they need a request-shape signal this layer does not yet carry.

Tests pin the pricing against the documented multipliers rather than restating
the literals — cache writes as 1.25x input, and the premium tier as 2x/1.5x of
standard — plus threshold behavior either side of 272K, and that `gpt-6-astra`
resolves to its own key for snapshots and provider-prefixed ids instead of
collapsing onto a shorter `gpt-6` match.

Resolves #15560

Ref: https://developers.openai.com/api/docs/models/gpt-6-astra
Ref: https://developers.openai.com/api/docs/guides/latest-model

* 🧪 test: Guard the GPT-6 Astra Max Output Entry

[Copilot] The Astra tests asserted the context window but not the 128K max
output added alongside it in `anthropicMaxOutputs`' OpenAI counterpart, so that
entry could regress silently. The gpt-5.6 tier test above covers both, and the
delete-the-fix check showed the gap: removing the source entries failed only
the context assertions.

Assert `getModelMaxOutputTokens` alongside `getModelMaxTokens`, and fold the
snapshot/prefix cases into one loop so both dimensions are covered for every id
shape rather than only the bare one. Verified by deleting just the max-output
entry: both Astra tests now fail where previously neither did.

* 🪧 feat: Declare the First-Party OpenAI Endpoint to the Agents SDK

The agents SDK gates GPT-6 Astra's request constraints — Responses-only tool
calls, rejected sampling parameters, unsupported reasoning efforts — on knowing
it is talking to the first-party OpenAI surface, and defaults them off. It takes
that as a declaration rather than inferring it, because a base URL cannot answer
the question: only this layer knows whether a URL is a faithful first-party
route, a gateway, or a proxy with its own semantics.

That decision already exists here, in `isCanonicalOpenAIBaseURL`, used by the
GPT-5.6 Responses default. Declaring it from the same checks keeps it in one
place instead of duplicating it downstream where the two could drift — and if
the endpoint logic ever moves, it moves once.

`firstPartyEndpoint` is declared on `OAIClientOptions` alongside the other agents
SDK fields this layer already sets (`promptCache`, `_lc_stream_delay`,
`includeReasoningContent`), so it typechecks against the current published SDK
and is consumed once the SDK release lands.

Two backward-compatibility expectations gain the field. That is the intended
signal: they assert the full emitted config precisely so a new field cannot slip
through unnoticed.

* 🗂 fix: Keep GPT-6 Astra Out of the Assistants Catalogs

[Codex P2] `sharedOpenAIModels` feeds `defaultModels[assistants]` and
`[azureAssistants]` as well as the OpenAI and agents catalogs. Astra serves tool
calls only from the Responses API, and the Assistants endpoints do not route
through `getOpenAILLMConfig`, so listing it there offered a configuration the
provider rejects.

Astra now sits in its own `responsesOnlyOpenAIModels` list, spread into the
OpenAI and agents catalogs only. Agents keeps it deliberately: that path does go
through `getOpenAILLMConfig`.

* 🎚 fix: Route GPT-6 Astra to the Responses API at Config Time

[Codex P1] `max_tokens` was shaped into `max_completion_tokens` here, from
`llmConfig.useResponsesApi`, while the agents SDK switched Astra to the
Responses API later at invocation time — so the request reached an endpoint
expecting `max_output_tokens` and was rejected.

Deciding the API here fixes that, and generalizes: any field whose shape depends
on the endpoint has the same problem, so the choice has to precede the shaping.
It also lands before Azure replaces `llmConfig.model` with a deployment name,
which is the only point that still knows the real model id.

Unlike the GPT-5.6 rule above, this does not depend on reasoning parameters.
Astra serves tool calls only from Responses, and OpenAI recommends Responses for
it generally, so a static decision loses nothing — which was the reason the SDK
was deciding it dynamically. The existing guards carry over: OpenRouter, custom
gateways, and an explicit `dropParams` opt-out keep their configured path.

The agents SDK is still required, for the request shaping Astra needs on either
API (danny-avila/agents#506); it no longer decides routing.

* 🏷 fix: Record the Served Model Before Azure Overwrites It

[Codex P1] `llmConfig.model` is unconditionally replaced with the Azure
deployment name, so the agents SDK received an alias and could not tell which
model it was talking to — a deployment not literally named `gpt-6-astra` got
none of the request shaping Astra requires.

Records the real id in `servedModel` immediately before the overwrite, which is
the last point that still knows it. The SDK prefers it over `model` when
deciding which model-specific constraints apply (danny-avila/agents#506).

Set for every first-party Azure request rather than only Astra: "what this
deployment serves" is a fact this layer knows and the SDK decides what to do
with, and keeping model-specific knowledge out of here is the point of the
split. The backward-compatibility expectation gains the field, which is that
test doing its job.

* 🎛 fix: Do Not Let a reasoning_effort Drop Disable Astra Routing

[Codex P1] The Astra routing reused the GPT-5.6 opt-out wholesale, which treats
`dropParams: ['reasoning_effort']` as opting out of the Responses API. That
holds for the 5.6 default, which routes *because* of reasoning — removing the
effort removes its reason to route. Astra's routing is not reasoning-driven, so
a rule clearing an unsupported stored effort silently put it back on Chat
Completions, where its tool calls fail.

Astra now honors only an explicit `useResponsesApi` drop. Reusing the guard
without re-deriving whether each clause applied was the error.

* ✂️ fix: Scope GPT-6 Astra to the First-Party OpenAI Endpoint

[Codex P1 + P2] Two findings, both Azure, resolved by removing the Azure support
rather than extending it.

Azure's first-party hosts do not satisfy `isCanonicalOpenAIBaseURL`, so a
configured `*.openai.azure.com` was neither routed to Responses nor declared
first-party; and moving Astra out of `sharedOpenAIModels` also removed it from
the Azure chat fallback, since `getOpenAIModels({ azure: true })` resolves
through `defaultModels[azureAssistants]`.

Both are moot once the scope is right: OpenAI does not document Astra as
available on Azure OpenAI. Its model page lists the API and OpenAI's own
subscription plans, with no third-party cloud surface. The Azure handling was
support for a deployment the model is not documented to reach, and it produced
most of the review findings on this branch and its agents SDK counterpart.

Routing and the first-party declaration are now scoped to
`EModelEndpoint.openAI`, and the Azure-only `servedModel` recording is gone
along with its SDK counterpart. Astra staying out of the Azure catalogs is now
the intended outcome rather than a regression.

* 🚫 fix: Keep Astra Out of the Initial Azure Catalog

[Codex P1] `initialModelsConfig` feeds the OpenAI catalog to Azure OpenAI as
well, so scoping Astra to the first-party OpenAI endpoint left it advertised on
Azure anyway — and being first in the list, it could become the default
selection where no prior choice exists. The server's Azure fallback already
excludes it, so the client would offer a model the server then rejects.

The Azure initial catalog now uses the OpenAI list minus the Responses-only
models, following the same scoping decision the routing guard makes.

The initial Assistants catalog was already safe: `fitlerAssistantModels`
requires `gpt-4` or `gpt-3.5`, which Astra does not match. Pinned that in a test
rather than leaving it to a regex written for another purpose.

* ⬆️ chore: Bump `@librechat/agents` to 3.7.20 for GPT-6 Astra Constraints
2026-09-04 10:23:29 -04:00
Danny Avila
a6cf61abcf
🪵 feat: Add OpenTelemetry Logs Pipeline via Winston Bridge (#15565)
Exports application logs as OTel log records when OTEL_LOGS_ENABLED=true,
correlated with the active trace, and gates every signal explicitly so a
disabled signal never falls back to the SDK's default OTLP exporter.
Verified end to end over OTLP/gRPC against an in-process collector.
2026-09-03 21:16:09 -04:00
Danny Avila
849e9bb40d
🧳 fix: Carry Logical Endpoints Through Agent Runs (#15538)
* fix(agents): preserve logical endpoints in run inputs

* docs(agents): clarify endpoint input compatibility

* chore: update @librechat/agents to version 3.7.19

* refactor(agents): use released endpoint input type
2026-09-03 11:35:19 -04:00
Danny Avila
f9f1b2fb95
✨ v0.8.8-rc2 (#14845)
Some checks failed
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 / 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/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
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Publish `librechat-data-provider` to NPM / pack (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / pack (push) Has been cancelled
Docker Dev Images Build / publish (push) Has been cancelled
Sync Helm Chart Tags / Ignore non-main push (push) Has been cancelled
Sync Helm Chart Tags / Sync chart tags (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Has been cancelled
* chore: prepare v0.8.8-rc2 release

* test: satisfy mongo meili static checks

* test: avoid unsafe logger spy assertion

* chore: refresh v0.8.8-rc2 release

* test: restore mongo meili test isolation

* chore: normalize v0.8.8-rc2 versions

* docs: refresh v0.8.8-rc2 release surfaces
2026-09-02 22:18:48 -04:00
Danny Avila
90cdcb384e
📦 chore: bump @librechat/agents to v3.7.17 (#15531) 2026-09-02 21:08:53 -04:00
Danny Avila
8a46ca070c
🧊 feat: Persist Context Fading Tier Across Agent Runs (#15505)
* 🧊 feat: Persist Context Fading Tier Across Agent Runs

Carry the pruner's latched context-fading tier from `@librechat/agents`
through `contextMeta` the way `calibrationRatio` already travels, so a
historical tool result keeps the same truncated bytes from one run to the
next and Anthropic's prefix-based prompt cache survives across turns
(danny-avila/agents#497).

- Add `IAgentFadingTier` to the message and conversation `contextMeta`
  types, schemas and the data-provider zod schema
- Add `isAgentFadingTier`, `resolvePersistableFadingTier` and
  `resolveRunContextMeta` in `packages/api`; a tier is persisted once it
  carries information (masking active or a budget below the window), and
  a latched tier is kept even at a neutral calibration ratio
- Seed `createRun({ fadingTier })` from the parent response's contextMeta
  regardless of encoding, since caps are character-based; the field rides
  the existing forward-compatible `runConfig` variable and older SDK
  versions ignore it, as does `Run.getFadingTier` being absent
- Accept a valid `fading` field in event actor context and reject a
  malformed one, matching the calibration checks
- Capture run context meta through one module-level helper for both
  completion paths instead of two inline copies

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Seed Fading Tier Across HITL Resume, Validate at the DB Layer

Address review findings on fading tier persistence:

- Leave the "is this tier worth persisting" decision to the SDK, whose
  `Run.getFadingTier()` now returns only informative tiers; comparing
  against the client's window misclassified untouched conversations
  whenever a reserve ratio was configured
- Carry `contextMeta` through the HITL pause projection (staged approval,
  job metadata, resume state) and seed the rebuilt client from it, so a
  paused turn resumes with the same tier and calibration instead of
  re-deriving a shallower one and rewriting the prefix
- Share run seeding between `chatCompletion` and `resumeCompletion`, and
  make capture tolerate partial runs and bare resume contexts
- Validate `contextMeta.fading` in `commitAgentEventActorState` with a
  shared `isAgentFadingTier` guard in data-schemas, so a malformed tier is
  rejected at the DB layer instead of silently cold-starting the actor
- Reuse `IAgentEventActorContextMeta` for `IMessage.contextMeta` instead of
  extending an inline duplicate

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 test: Cover Resume Seeding From Paused Context Meta

Assert the resume controller seeds the rebuilt client from the context meta
captured at the pause before rebuilding the run, and move the capture
helper's JSDoc back above its function.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧹 style: Sort Imports in Fading Tier Plumbing

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Persist Fading Tier Through Redis Jobs and Branches

Address Codex and Copilot review findings on fading tier persistence:

- Deserialize `contextMeta` in `RedisJobStore`, whose explicit read mapper
  rebuilt every other pause field but this one, so Redis-backed
  deployments resumed with no tier to seed after every HITL pause
- Copy server-private `contextMeta` onto the assistant message created by
  `POST /api/messages/branch`, so the next turn seeds its pruner the same
  way it would from the parallel source response
- Constrain the `fading` subdocuments in both Mongoose schemas (version
  enum, positive budget, required fields) to match the zod schema
- Throw a distinct "fading tier is invalid" error from both context meta
  validators instead of reporting a calibration failure

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Carry Context Meta Through Stop and Re-Pause

Addresses the second Codex pass on the fading-tier persistence:

- A re-pause whose resumed segment has nothing persistable now clears the
  job's `contextMeta` in the same transition instead of leaving the first
  pause's calibration and tier for the next resume to seed from.
- The client publishes the run's live calibration and fading tier onto the
  job after each pre-invoke context snapshot (deduplicated on value), and
  the Stop path copies `jobData.contextMeta` onto the stopped response, so
  a follow-up from a stopped turn keeps the prompt prefix stable.
- Mid-run captures (HITL pause, Stop) read the graph's live state; `Run`
  refreshes its own getters only after the stream settles, so the pause
  used to persist the seeds it started from.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Fence Context Meta Publication Ahead of Stop

A Stop handled by another replica reads the job before the owner is
signaled, so a fire-and-forget publish could lose the race, and a run
stopped before its first context snapshot never published the tier it
inherited. The client now publishes the inherited seed before the run
streams or resumes, and the context-usage handler awaits each
snapshot's publish so the write lands before the model call it
describes begins. Failures still only log; the pre-run publish is
optional-called so bare resume contexts keep working.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Read Back Context Meta After the Abort Claim

The run owner publishes its context meta ahead of each model call and
awaits the write, so a publish landing between the abort's initial job
read and its terminal claim describes the call whose partial output the
abort snapshot carries. abortJob now reads the same-epoch job back after
the claim and content re-read and takes its context meta, so the stopped
response persists the tier that produced its bytes. The refresh is
best-effort and logs on failure like the content refresh beside it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Share In-Flight Context Meta Writes and Clear Neutral Live State

Two snapshot callbacks in a parallel-agent run can capture the same tier
before the first write settles; the publisher now caches the in-flight
promise per serialized value so the second caller awaits the same
durable write instead of treating an uncommitted value as published.
A live snapshot with nothing left to persist after an earlier publish now
writes a neutral record (ratio 1, no tier), since a running job's fields
cannot be deleted through the metadata writer, so a Stop no longer
persists an earlier non-neutral state onto the response. The pre-run
seed publish is unchanged and is told apart from live snapshots by a
flag from the context-usage sink.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 chore: Drop Unused Rest Parameter in Context Meta Test

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 feat: Persist Per-Agent Fading Tiers as Compact Context Meta

Reconciles the host with @librechat/agents at 9aacad1a, where graph
history stays canonical and each Run derives a provider-only projection
from the latched tiers. LibreChat therefore persists only compact state:
the calibration ratio, the default agent's tier, and now the per-agent
tiers from Run.getFadingTiers(), stored as validated entries so agent IDs
never become MongoDB field names and restored onto a null-prototype
record for RunConfig.fadingTiers. Truncated messages, canonical tool
content, projection provenance and per-message truncation state are
never persisted; the SDK's latched flag is stripped on capture.

The per-agent map travels everywhere the single tier already did:
response contextMeta, event-actor checkpoint state, HITL pause and
resume job metadata in both stores, the Stop path, and branch creation.
A shared Mongoose definition keeps the message and conversation schemas
identical, the zod schema validates entries, and commitAgentEventActorState
rejects malformed maps. Comments no longer describe graph messages as
truncated; only the provider projection is.

Tests cover: tool results and inputs reach the persisted content parts
at full size; contextMeta carries exactly the compact tier and
calibration fields; a persisted snapshot round-trips into the seeded
RunConfig unchanged and prototype-safe; per-agent tiers survive pause,
Redis job round-trips, and event-actor context validation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Restore Event Actor Types and Publish Seeds Before Abortable Setup

The previous commit's doc rewording in the conversation types dropped the
event-actor interfaces that precede the fading tier, which broke the
declaration bundle in CI; they are restored unchanged.

The inherited context meta is now published onto the job as soon as the
parent's state is loaded and awaited at the top of chatCompletion and
resumeCompletion, ahead of run creation and the other abortable setup
stages, so a Stop during setup still persists the parent's tiers onto the
stopped response. The partial response saved when every subscriber
disconnects now carries the job's context meta like the Stop and pause
paths do. The branch route keeps the source's context meta in the saved
message but strips it from the HTTP response, matching client reads.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Serialize Distinct Context Meta Publications

Overlapping snapshots from parallel agents could carry different tiers;
each started its own write and both job stores keep whichever write
finished last, so an older snapshot could overwrite a newer one. Each
distinct publication is now issued after the previous one settles, in
call order, so the newest snapshot is what a Stop reads back. Equal
values still share one write.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Project Root Message Reads and Keep Inherited Meta on Setup Failure

The root GET /api/messages paths returned raw documents: the
single-message query read called getMessages without a projection and the
cursor page performed an unprojected find. Both now apply
CLIENT_MESSAGE_SELECT, with getMessagesByCursor accepting a select option,
so the persisted fading tiers never reach the client through the
paginated endpoint; the search-hydration read projects the same way.

A turn that loads a parent's context meta but fails before its run exists
used to replace the inherited meta with the capture of a missing run, so
the persisted error response lost the last valid tiers. Both finalizers
now keep the inherited meta when no run was created while a created run's
neutral state may still clear it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 refactor: Move Context Meta Publication Into packages/api

The publication coordinator (ordering, deduplication, in-flight sharing,
failure state) now lives in packages/api as createContextMetaPublisher,
with selectRunContextMetaToPublish deciding what a publication carries;
the legacy client keeps only the wiring to the job metadata writer. A
transiently failing write is retried with a short backoff before the
publication is reported and forgotten, so a snapshot's model call no
longer proceeds on the first rejection while the job holds the previous
record. The SDK swallows handler errors, so retrying is the only way to
strengthen the fence without failing the turn.

A terminal save now supplies contextMeta: null when the finished run has
nothing to carry, and saveMessage unsets a previously stored value in
that case, so a disconnect snapshot's record cannot outlive the run that
completed neutrally.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Widen the saveMessage Method Type for the Null Unset

The exported method interface still typed contextMeta as the message
field, so the spec exercising the null unset failed typechecking; it now
mirrors the implementation signature.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Publish Every Agent's Snapshot, Sanitize Search Hits, Unbound Agent IDs

The context-usage handler now awaits the run's context meta publish for
every ON_CONTEXT_USAGE event, hidden sequential agents included, while
the visible-snapshot bookkeeping and the client emission keep their gate;
a Stop before the next visible snapshot finds the tier a hidden agent's
model call latched. Search results are built from the hydrated hit minus
its server-private contextMeta, since Meilisearch hydration projects every
schema field. The per-agent tier entry guard no longer caps the agent ID
length: ephemeral agent IDs encode endpoint, model and sender without a
bound, and dropping such an entry would let that agent alone re-derive
its tier on the next turn. Also formats the publication spec so the
static checks pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Unset Context Meta Atomically, Keep Publication State After a Failed Write

- `saveMessage` folds the `contextMeta` unset into the same update that
  persists the terminal response, on both the plain and the provenance-merge
  paths, so a failure between two writes can no longer leave a completed row
  carrying a disconnect snapshot's state.
- `createContextMetaPublisher` tracks whether any record has committed
  separately from the retryable latest publication, so `hasPublished` stays
  true after a later publication exhausts its retries and a following neutral
  snapshot still overwrites the earlier record on the job.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Carry Context Meta Through the Resumable Stop Route and Neutral Resumed Completions

- The resumable Stop route copies the refreshed `jobData.contextMeta` onto the
  terminal assistant message it persists, as the abort middleware already
  does, so a stopped resumable response keeps the tiers that produced its
  partial output.
- A resumed run that completes with neutral context state now saves
  `contextMeta: null`, which unsets the paused segment's record instead of
  letting an omitted field keep it on the completed row.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Trust Only Server-Authored Context Meta, Unset It on a Neutral Stop, Read It From the Job on Disconnect

- `POST /api/messages/:conversationId` and conversation imports drop any
  client-supplied `contextMeta`, and the run seeds its calibration and fading
  tiers only from a server-authored parent response, so a forged tier can never
  shape a provider projection.
- Both Stop paths save `contextMeta: jobData.contextMeta ?? null`, so a job that
  re-paused with neutral state unsets what an earlier pause stored on the row
  instead of leaving it behind.
- The disconnect partial save reads the same-epoch job record for the run's
  published context meta, since the client-facing resume snapshot never carries
  server-private state.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧪 test: Mock the Job Store in the Resume Metadata Spec

The disconnect partial save now reads the same-epoch job record through
`GenerationJobManager.getJobStore()`, so the resume metadata spec's manager
mock provides it as the other disconnect spec already does.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 🧊 fix: Keep Context Meta Off the POST Message Response

`POST /api/messages/:conversationId` returned the saved row verbatim, so a
client write against an existing server-authored message echoed the row's
stored context meta. The route now projects the row through the same client
projection the branch route uses, which drops the server-private field.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

* 📦 chore: Bump @librechat/agents to 3.7.16 for Persisted Fading Tiers

3.7.16 is the first release that carries danny-avila/agents#497, so
`Run.getFadingTier()` / `getFadingTiers()` now report the latched tier
this branch persists and `RunConfig.fadingTier` / `fadingTiers` seed the
next run from it. The dependency set is unchanged from 3.7.15; only the
package entry moves.

Adds an SDK-backed round trip to the fading spec: a first pruner latches
an informative tier, `resolveRunContextMeta` reduces it to the persisted
shape, and a second pruner seeded from that shape reproduces the first
run's projected tool-exchange bytes under instruction and calibration
drift, while an unseeded pruner under the same drift relaxes its tier and
rewrites them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNbgMeR2aZDyhsqAy4L8gF

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-02 20:29:43 -04:00
Danny Avila
790f2b3153
⚡ feat: Add Gemini 3.8 Flash Support (#15519)
Some checks failed
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 / 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/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
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
* ⚡ feat: Add Gemini 3.8 Flash Support

Adds first-class support for Google's Gemini 3.8 Flash (`gemini-3.8-flash`,
GA 2026-09-02) for both the Gemini API (AI Studio) and Google Cloud Gemini
Enterprise Agent Platform, following the Gemini 3.7 Flash integration (#14818).

The Flash-family handler that PR generalized already carries the shape 3.8
needs, so registering the model is a one-line rule rather than new behavior:
it inherits the strip of deprecated sampling params (temperature/topP/topK),
the rejected penalty params, and `thinkingBudget`, defaults to `medium`
thinking, and — like 3.7 — errors on `minimal`, so an explicit `minimal` is
substituted with the nearest supported level, `low`.

- Context window (1,048,576) in googleModels; API + cache pricing in tx.ts
- Model dropdown (config.ts) and GOOGLE_MODELS examples for both integrations
- Register the model in the Flash-family thinking-rule table
- Apply the same introductory pricing as 3.6/3.7 Flash ($0.75 in / $3.75 out /
  $0.075 cached, per 1M), reverting to $1.50 / $7.50 / $0.15 on 2027-01-01;
  the existing comments at both call sites now name 3.8 alongside 3.6/3.7
- Tests mirroring the 3.7 Flash coverage: thinking default, legacy-param strip,
  explicit level pass-through, `minimal` substitution, versioned aliases,
  context window, model-key mapping, and rates

Refs #15516

Ref: https://ai.google.dev/gemini-api/docs/models/gemini-3.8-flash
Ref: https://ai.google.dev/gemini-api/docs/pricing

* 🔧 chore: Update @librechat/agents dependency to version 3.7.15 in package-lock.json and related package.json files
2026-09-02 15:06:40 -04:00
Danny Avila
29f738dea8
⏭️ feat: Honor an Interrupt Before the Model Has Answered (#15491)
* ⏭️ feat: Honor an Interrupt Before the Model Has Answered

An interrupt armed while the model is still thinking sat as "Interrupting"
until the entire turn finished, then landed as a terminal continuation. The
cause is upstream: the SDK reads `shouldPreempt` once per streamed chunk, and
its seal gate requires non-empty text — so a silent provider is never polled at
all, and a reasoning-only turn is never sealable.

`@librechat/agents` gains a discard-and-restart path for exactly that window
(`HOOK_PREEMPT_RESTART_CAPABLE`). This wires the host half:

- `GenerationJobManager.subscribePreempt` registers run-scoped wake listeners,
  notified after an ACCEPTED arm — local or cross-replica, since both land in
  `armPreemptIds`. Fenced on `createdAt` like every other preempt entry point,
  and a throwing listener never fails the arm a queued steer depends on.
- `createSteerPreemptPoll` hands that channel to the SDK as
  `StreamPreemption.subscribe`, gated on a new `isSteerPreemptRestartSupported`
  probe so an SDK that cannot act on a wake is never handed one.

The wake is a hint only: `isPreemptRequested` stays the single authority, so
the level-triggered contract the seal path depends on is unchanged.

Inert until `@librechat/agents` publishes the restart contract — the probe
returns false against the pinned 3.7.11 and the run keeps today's behavior.

* 🩹 fix: Replay an Already-Armed Preempt on Subscribe

Preempt requests are level-triggered, and the window between a job becoming
steerable and the SDK installing its model-attempt listener is real. An
interrupt landing there was recorded with no callbacks to notify, and on a
silent or reasoning-only turn no later chunk poll may ever run — leaving the
request to wait out the whole turn, the exact stall this channel removes.

`subscribePreempt` now replays an existing arm to the newly registered listener
only, after registration: waking the whole set would re-notify runs that
already looked, and waking before registration would leave a concurrent arm
with nowhere to land. The `createdAt` fence is unchanged and still gates the
replay.

The SDK also reads the level flag once at each attempt's start, so this is
belt-and-braces rather than the sole cover — but it makes the host correct on
its own terms instead of resting on when the SDK happens to look.

* 🔧 chore: Update @librechat/agents dependency to version 3.7.14 in package-lock.json and related package.json files

* 🔧 chore: Update dependencies in package-lock.json and package.json

- Bump versions for @humanfs/core (0.19.1 to 0.19.2), @humanfs/node (0.16.6 to 0.16.8), @xmldom/xmldom (0.8.13 to 0.8.15), and qs (6.15.2 to 6.16.0).
- Add @humanfs/types (0.15.0) as a new dependency for @humanfs/node.
- Update dependencies for side-channel and side-channel-list to their latest versions.
2026-09-02 13:35:52 -04:00
Danny Avila
6d56d3b6fe
🧴 chore: Refresh Sanitizer and Selector Parser Dependencies (#15494)
* 🔧 fix: Update sanitize-html to version 2.17.7 in package.json and package-lock.json

* 🔧 chore: Update postcss-selector-parser to versions 6.1.3 and 7.1.3 in package.json
2026-09-01 21:38:08 -04:00
Danny Avila
dccd7ae496
🧶 fix: Preserve Multi-Agent Tool Call History (#15468)
* 🧭 fix: Preserve Multi-Agent Tool History

* 🧰 fix: Preserve Lazy Subagent Tool History

* 🧪 test: Enable Lazy Code History Fixture

* 🧭 fix: Derive Effective Lazy Tool History

* 🧪 fix: Tolerate Empty MCP Name Audits

* 🧪 test: Mock Lazy MCP Name Audit

* 🧭 fix: Expand Lazy Historical Tool Names

* 🧱 fix: Derive Durable Wildcard History

* 🧬 fix: Traverse Nested Wildcard History

* 🔭 fix: Resolve Wildcard Server Boundaries

* 🔐 fix: Persist MCP Call Identity

* 🪪 fix: Stamp Resolved MCP Execution Identity

* 🕸️ fix: Resolve Graph Member MCP Identity

* 🧭 fix: Fall Back From Empty Graph Member ID

* 🧭 fix: Preserve Aggregated MCP Identity

* 🧭 fix: Harden MCP Identity Resolution

* 🧭 test: Assert Concurrent Graph Limit Invariant

* 🧭 fix: Centralize Lazy History Policy

* 📦 chore: Bump `@librechat/agents` to v3.7.13

* 🧪 test: Align Content Filter Fixture With SDK History
2026-09-01 18:37:45 -04:00
Danny Avila
26887bc5a9
🛗 chore: Elevate @librechat/agents to 3.7.11 and multer to 2.3.0 (#15409)
* 📦 chore: bump `@librechat/agents` to v3.7.11

* chore: bump multer to latest
2026-08-31 08:51:30 -04:00
Danny Avila
0389a92452
📦 chore: bump @librechat/agents to v3.7.10 (#15378) 2026-08-30 19:28:22 -04:00
Danny Avila
cd3768ed1f
🍵 feat: Continue Late Steers in Warm Agent Runs (#15357)
* feat: continue late steers in warm agent runs

* chore: bump agents sdk to v3.7.9

* fix: guard terminal steer admission
2026-08-30 11:54:17 -04:00