mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
979 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5b8bb3c31f
|
⏱️ fix: Bound Remaining Outbound Calls With Timeout Budgets (#17468)
* fix: Bound outbound HTTP calls that had no timeout Add timeouts.toolsMs, speechMs and imageGenerationMs to the timeouts block and apply the existing budgets to the RAG delete paths, built-in tool APIs, TTS/STT providers (TTS also aborts when the client closes), Stable Diffusion, Firebase reads and Mailgun. Calls made before app config exists (remote config, RAG health, service key URL, Google refresh) get a fixed 10 second budget. * fix: Honor configured budgets for RAG deletes and per-chunk TTS deadlines * refactor: Share one budget helper between speech and image CJS callers * test: Cover a stalled RAG delete with a mock scenario * test: Wait for the RAG embed before stalling the delete * test: Embed at upload so the stalled delete has a vector to remove * fix: Close a started TTS response on a late chunk timeout and share the service budget helper * fix: Fail startup when the remote config fetch times out |
||
|
|
7e7f559ea6
|
🏎️ perf: Parallelize Independent Agent and Schedule Lookups (#17465)
* perf: Parallelize Serial Lookups on Agent Load, Discovery, Skills, and Schedules * fix: Address Review Findings on Parallel Lookups Stage same-level discovery results before collecting edges so a shared sibling is initialized once, bound resume snapshot fetches to small chunks so over-budget graphs stop early, and surface the first ordered image failure without waiting on later reads. Update the skill name test for bounded concurrency. * test: Tag Existing Mock Specs as Acceptance Scenarios for Parallel Lookups * feat: Make Parallel Lookup Bounds Configurable Add a concurrency section to librechat.yaml for MCP catalog, skill name, skill file and resume agent lookups. Defaults equal the previous hard-coded values. * style: Sort Imports for Configurable Lookup Bounds * test: Match Model Spec Skill Resolution Args With App Config * test: Close the Builder Drawer Before Chatting on Narrow Viewports * fix: Surface Fatal Discovery Errors Without Awaiting Later Siblings * fix: Reject Discovery on the First Fatal Load Regardless of Queue Order * fix: Keep Image Encoding Fail-Fast With Parallel Reads * fix: Reject Resume Snapshot Lookups Without Waiting on the Whole Chunk * feat: Make Connected Agent Discovery Concurrency Configurable |
||
|
|
65d0ba8563
|
🧯 fix: Return Approved Tool and Generation Error Text Instead of Raw Exceptions (#17508)
* fix: Return approved tool and generation error text instead of raw exceptions * fix: Redact generation error text without the data-schemas helper * fix: Redact credentials and emails from shown generation errors * refactor: Move the Wolfram status policy into packages/api * test: Fix the Wolfram probe constructor and jest summary match * test: Match the jest pass count through color codes * fix: Redact credentials a tool input error echoes from its arguments * fix: Drop free-text fields from typed generation errors under a content policy * fix: Keep only the code and numeric fields of typed errors under a content policy |
||
|
|
a0f063b1c7
|
🔐 fix: Fence ACL Viewers and Surface Revocation Failures When Removing Shared MCP Servers (#17506)
* fix: Fence ACL Viewers and Surface Revocation Failures When Removing Shared MCP Servers Account erasure and server deletion now enumerate users the view ACL names directly or through a group, so viewers without a personal OAuth token are fenced and disconnected too. Erasure runs the OAuth teardown in strict mode, which clears local credentials and then fails when the provider refuses a revocation, keeping the server as the retry anchor, and holds every user's teardown fence until the server delete commits. * test: Type the Revocation Failure Cleanup Fixtures * fix: Renew Retained OAuth Teardown Fences Before Deleting the Server A teardown lease lasts 15 minutes, so a large erasure could outlive the first fences it holds. Leases can now be renewed by their owner, and erasure renews every retained fence right before the delete, failing without deleting when one lapsed and another writer took it. * fix: Report Refused MCP Revocations Without Blocking Account Erasure A provider that refuses revocation, combined with a viewer who signs in again between attempts, could keep an erasure failing indefinitely. The strict teardown now throws a coded MCPOAuthRevocationError after clearing local state and handing over its fence; server removal collects those as refusals, logs each user and token type whose grant may remain valid, and proceeds. Local failures (token delete, fence, ACL) still fail closed. * fix: Annotate the Revocation Error Code for Isolated Declarations |
||
|
|
784582850a
|
🧯 fix: Guard SSE Writes and Interval Cleanups Against Crashes (#17462)
* fix: Harden Timer Sweeps, SSE Writes, and Violation Counters Guard SSE writes against ended or destroyed responses through one helper, catch and single-flight the job store and TTL cache cleanup timers, serialize in-process counter updates, cap the violation log, prune stale OAuth failure records, batch the active-job lookup, and count Redis keys with DBSIZE. * refactor: Drop the redundant violation log entry copy * refactor: Log single-flight sweep failures from the API package * test: Cover active generation listing and client disconnect mid-stream * refactor: Configure violation log retention and move title timeout into the API package * feat: Configure OAuth failure retention through mcpSettings * fix: Prune OAuth failures promptly under short retention |
||
|
|
761bfa8e6a
|
🪠 fix: Erase Vectors in Their Recorded Namespaces (#17457)
* fix: Delete vectors in every recorded namespace * test: Assert vector cleanup precedes Azure deletion * fix: Preserve implicit RAG scope during vector erasure * fix: Keep failed-upload storage cleanup independent * test: Correct rollback fixture types and lint * fix: Require complete embedding ownership before erasure * test: Mark confirmed Project erasure fixture complete * fix: Stage vector ownership trust and bound erasure fanout * fix: Mint RAG credentials when queued requests dispatch --------- Co-authored-by: Lia <lia@librechat.ai> |
||
|
|
8e68cab31b
|
🤺 fix: Prefix MCP Tool Cache Write Fences (#17458)
Some checks are pending
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 Vote Gate / Gate (push) Waiting to run
Codegraph E2E Votes / vote (shard 1/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 10/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 2/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 3/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 4/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 5/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 6/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 7/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 8/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 9/10) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/chat (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
* fix: Prefix MCP tool-cache ownership fences * test: Keep fence-prefix regressions lint clean * fix: Preserve fence slots for literal Redis prefix braces * fix: Bridge MCP ownership fences across rolling upgrades * fix: Isolate deployment ownership in the legacy fence bridge --------- Co-authored-by: Lia <lia@librechat.ai> |
||
|
|
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> |
||
|
|
e594cff874
|
🏨 fix: Restore Strict Tenant Startup and Sign-In (#17441)
Some checks are pending
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 Vote Gate / Gate (push) Waiting to run
Codegraph E2E Votes / vote (shard 1/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 10/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 2/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 3/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 4/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 5/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 6/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 7/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 8/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 9/10) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/chat (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
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
* fix: restore strict tenant startup and sign-in * test: preserve real middleware in auth route fixtures --------- Co-authored-by: Lia <lia@librechat.ai> |
||
|
|
a2cd772d49
|
🏭 refactor: Centralize Source Prompt Imports in the Prompt Service (#17272)
PromptService gains importSourceGroup, which finds or creates a source pointer group, grants the PUBLIC viewer role and rolls the group back if the grant fails. The Langfuse catalog sync calls it instead of four storage callbacks and two Mongo error predicates, and the prompt service is composed once in api/server/services/Prompts.js and passed to the prompt routes, linked instructions, instructions prompt access and the Langfuse sync runner. Co-authored-by: Rebase Probe <probe@example.com> |
||
|
|
d481b6b695
|
🏬 feat: Sync Langfuse Prompts into the Catalog (#17095)
* feat(prompts): sync Langfuse prompts into the catalog * refactor(prompts): compose the Langfuse prompt sync runner outside the admin handler Add createLangfusePromptSyncRunner, which binds the lock, the prompt-group methods, the ACL grant and the Mongo error predicates once and returns a runner that takes the per-request source, connection-bound listPrompts, lock lease and page cap. The admin handler receives that runner as one dependency instead of forwarding its parts, and its config method signatures return a LangfuseAdminConfig interface in place of Mongoose document types. In api, api/cache/distributedLock.js creates the one DistributedLock for the process and api/server/services/LangfusePromptSync.js composes the runner once with it; the admin route imports the composed runner. * fix(prompts): report incomplete Langfuse syncs and gate the sync action - Refresh the prompt-group and effective-permission queries after a failed sync too, because earlier imports can already be committed. - Return `complete: false` when the page limit stops a sync before the last upstream page, and show a warning instead of the success message. - Show the Sync prompts action only to users with `manage:prompts`, the capability the sync route requires. Resolve the Langfuse startup-config capabilities in one batched lookup. - Document that an interrupted import can leave a group without its initial PUBLIC grant, and that a page in progress can outlast an expired lease. --------- Co-authored-by: Rebase Probe <probe@example.com> |
||
|
|
02613ce212
|
⛲ feat: Resolve Native and Langfuse Prompts by Source (#16909)
The prompt service dispatches resolvePrompt by group.source. A read-only Langfuse adapter fetches the text prompt on each use, with no cache, after a resolver checks the deployment gate, the tenant, prompt sync, the connection and the stored source identity. GET /api/prompts/groups/:groupId/resolve returns resolved content for native and Langfuse groups, with a per-user limit set by rateLimits.promptResolve (default 60 per minute). Agent-instruction links stay native only. |
||
|
|
9f617fc4ad
|
🧬 feat: Re-Derive Azure Groups, Vertex AI, Custom Parameters and Spec Defaults for Config Profiles (#17399)
* 🧬 feat: Re-Derive Azure Groups, Vertex AI, Custom Parameters and Spec Defaults for Config Profiles AppService derives part of the served config from librechat.yaml at startup, and config profiles merged into that output without deriving it again. Azure `groups` now merge by `group` like `endpoints.custom` by `name`: a profile's partial group merges over the group of that name, groups it does not name stay, indexed writes are refused, change batches take entry ops on them, and groups that do not resolve over librechat.yaml and Base (or whose written `${VAR}` is not set) answer `invalid_azure_groups`. Each merged group keeps the key below it unless the profile supplies one, so the rebinding guard drops a key a partial item moves and a key a lower layer dropped stays dropped; Azure re-entry compares groups merged the same way. With `CONFIG_REDERIVE_ENDPOINTS=true` (opt-in for this release), a profile's Azure `groups` resolve into what the Azure clients read (unconditional before, now behind the switch so stored group overrides do not go live on upgrade), a profile's `endpoints.anthropic.vertex` derives `vertexConfig` and the Anthropic models it serves where librechat.yaml configures Vertex AI, and the Azure Assistants endpoint follows a profile's `assistants`. Startup logs the documents that hold such overrides, the groups that would not resolve over librechat.yaml and Base, and the Vertex AI overrides that never apply. Always on: Vertex AI's key file and region are base-only, a profile may turn Vertex AI on only where librechat.yaml configures it, its settings may reference only librechat.yaml's own Vertex AI variables (reads return them resolved), a profile's `vertexConfig` is never applied and writes skip it (`derived_path`, `rules.derivedPaths`), a model's own `deploymentName` resolves its `${VAR}` like the default one, the region, project ID and the deployment name each model's requests send (the model name where the client sends it as written) must stay in their URL host label or path segment, a `${VAR}` there is a whole `${NAME}` reference only, the Anthropic client refuses any other deployment name before building a request, and an invalid setup answers `invalid_vertex_config`. The rebinding guard no longer binds the derived Vertex AI region, which is librechat.yaml's. Custom endpoint `customParams` are expanded by `expandCustomEndpoint` into the served copy, so `appConfig.config` stays librechat.yaml as written, and each endpoint a profile writes is expanded again from its merged form (a changed `defaultParamsEndpoint`, OpenRouter defaults for a profile's own endpoint); invalid definitions answer `invalid_param_definitions`. After tenant scoping, `getAppConfig` derives `modelSelect`, `parameters` and `presets` again for the specs a principal is served where nothing sets them, the agents `memory` capability follows the merged memory config, and a model spec naming an unconfigured endpoint answers `unknown_spec_endpoint`. Meta flags: `azureGroupMergeKey`, `customParamsExpansion`, `specInterfaceRederive` and `endpointRederive`. * 🪜 fix: Judge Re-Derived Config on What Every Profile Layer Leaves Two re-derivations decided whether a profile had set a field from whether any layer ever set it, so a lower profile's value tombstoned by a higher one still counted as set. - Vertex AI (CONFIG_REDERIVE_ENDPOINTS=true): the marker that keeps a profile's `endpoints.anthropic.models` over Vertex AI's is cleared by a later tombstone of those models (or of `endpoints.anthropic` or `endpoints`), and such a tombstone derives Vertex AI again, so the Anthropic endpoint serves Vertex AI's models instead of none. A tombstone of librechat.yaml's own models does the same. - Spec-dependent controls: `modelSelect`, `parameters` and `presets` are derived again where their served value differs from the base config's, not only where the librechat.yaml-shaped value does, so a control one profile sets and a higher one tombstones, or a tombstone of one librechat.yaml leaves unset, follows the specs served instead of being dropped. The memory capability, Azure Assistants, Azure groups and custom parameters already derive from the merged result; tests now cover each set in one layer and tombstoned in a higher one, and the reverse. * 🧮 fix: Derive Each Config Part From What the Layers Leave A tombstone of an object above a derived part's inputs, alone or followed by a layer that recreates part of that object, left the part without what startup derives it to: - An Azure endpoint recreated after a tombstone of `endpoints.azureOpenAI` or `endpoints` had no groupMap, modelGroupMap or model lists, so its model lists fell back to the environment's default Azure models, which requests could not map to a group. It now serves no group, with or without CONFIG_REDERIVE_ENDPOINTS (completeAzureResolution). - A tombstone of the whole `interface` left modelSelect, parameters and presets out, which the client reads as off. They are derived from the specs served into a new interface. - A tombstone of `endpoints.agents` or `endpoints` left no agents endpoint, while a tombstone of its capabilities served the defaults. The agents endpoint startup derives is served there. - A tombstone of a Vertex AI setting that leaves the setup unable to load kept the vertexConfig derived below it. Vertex AI is off there, with a warning. A table in service.spec.ts runs every derived part against every way a layer changes its inputs (set, unset, a tombstone of the path and of each object above it, a layer recreating after such a tombstone, Base on either side, tenant scoping, the switch off) through getAppConfig, and compares each cell with what startup derives from the librechat.yaml the layers leave. * 🧭 fix: Serve Only Model Specs Whose Endpoint the Layers Leave A tombstone of `endpoints.custom` or `endpoints` in a higher profile (or the Base profile) left the model specs of the custom endpoints it removes served, librechat.yaml's or a lower profile's: the spec list pointed at endpoints /api/endpoints no longer offers, with the model selector, parameters and presets still off for them. The write check only ran when the write held `modelSpecs.list`, and the merge served stored specs as they were. After the last layer, the merge now serves only the specs whose endpoint is a built-in endpoint or a custom endpoint the YAML-shaped config the layers leave defines, the rule startup skips librechat.yaml's specs by (deriveServedSpecs). A removed endpoint hides its specs until a layer defines it again; where no spec is left, none is served (as with a tenant-hidden endpoint) and the spec-dependent controls come back on. Tombstones of a built-in endpoint's settings keep its specs, as startup does, and `addedEndpoints` stays as merged. A stored spec for an endpoint that is not configured is left out on its own instead of being served; writes of one still answer 400 unknown_spec_endpoint. The derived-part table in service.spec.ts gains the model specs served (with addedEndpoints and the controls they decide) against tombstones of `endpoints.custom`, `endpoints`, and each of `endpoints.openAI`, `azureOpenAI` and `anthropic`: by a profile, by Base under a profile, a lower profile under a higher one, recreated above or by the same layer, with no spec left, and with the switch off. * 🧩 fix: Reconcile Re-Derived Config With Dev's Keyed Tombstones, Write Report and Read APIs - Keyed tombstones of Azure groups (endpoints.azureOpenAI.groups["g"], now merged by key) resolve the groups left again where the merge resolves them, and stay inert without CONFIG_REDERIVE_ENDPOINTS. - Keyed tombstones count as touching endpoints.custom, so served specs and custom parameters are derived again after one. - The served-spec derivation keeps modelSpecs while added endpoints remain, as the hidden endpoint scoping does; hidden endpoint names leave addedEndpoints. - Derived paths join the held paths every write skips, built on first use. - Tests follow the merged behaviour: Azure groups merge by group, the agents endpoint is derived again below a tombstone. |
||
|
|
ba78cf5f5f
|
🫢 fix: Keep OAuth Credentials Out of Logs (#17409)
* 🫢 fix: Keep OAuth Credentials Out of Logs
* test: Match MCP OAuth SDK Fixture Types
* fix: Sanitize OAuth Failures Across Callback and Refresh Boundaries
* fix: Close OAuth Initiation Log Leaks and Preserve Vendor Recovery
---------
Co-authored-by: Lia <lia@librechat.ai>
|
||
|
|
f05f50460a
|
🔭 feat: Admin Config Read APIs (Resolved and Effective Config, Scope Catalog, Env Status) (#17383)
* 🔭 feat: Admin Config Read APIs (Resolved and Effective Config, Scope Catalog, Env Status) Admin clients could read one config document at a time, or the deployment's merged config, but nothing showed what a profile or a user resolves to: a client had to re-implement the merge (Base-first precedence, merge keys, tombstones, the interface permission filter, base-only fields, runtime stops, secret rebinding, the env allowlist) to preview it, and had no way to see why part of a profile is ignored. Endpoint, model and tool pickers came from the end-user routes, called as the signed-in admin, so they showed the admin's own scope and keys and needed a browser User-Agent. The admin config API now has four read routes. GET /resolved/:principalType/:principalId and GET /effective?userId= return librechat.yaml, the documents that merge over it in merge order, each with the parts the merge does not apply and why, and the result, in librechat.yaml shape. They come from resolveConfigLayers, which tracks the same fold the served merge runs and is pinned to it by parity tests, and from the stored documents rather than the override cache. GET /catalog lists the endpoints (with the reason one is not served), models (served, configured and defaults), MCP servers and tools a scope serves, resolved for the scope rather than the caller and never with a user's stored key; GET /env-status reports whether each env name the config uses is set, never its value. Every read is filtered to the sections the caller can read, redacted as reads redact, and scoped to the caller's tenant. The admin Langfuse routes now say why a deployment offers no connection settings. Meta reports resolvedApi, catalogApi, envStatus and limits.catalogModelsTtlMs. * 🪞 fix: Report Duplicate Custom Endpoints from the Served Definition When librechat.yaml defines a custom endpoint name twice, or both `Ollama` and `ollama`, the catalog kept the first definition for a name's env names, reason and models, while `loadCustomEndpointsConfig` serves the last servable one. An entry could pair the served config of one definition with the env names of another. `resolveServedCustomEndpoints` now holds the runtime rule (the last definition with a name, key, base URL and models wins under its served name), and `loadCustomEndpointsConfig`, `loadConfigModels` and the catalog all use it. A name with no servable definition is reported from its last one. * ⏱️ feat: Make the Admin Catalog Model-List Lifetime Configurable `GET /api/admin/config/catalog` reused a scope's model lists for a fixed two minutes. The new librechat.yaml field `endpoints.catalogModelsTtlMs` sets that lifetime (milliseconds, `0` to one hour, two minutes by default); `0` resolves the lists on every read. It is a base-only path, so a profile cannot change it and `GET /meta` reports one value, now read from the deployment's config on each request as `limits.catalogModelsTtlMs`. |
||
|
|
532214c022
|
🐡 fix: Bound Tool Approval Admission Work (#17387)
* 🐡 fix: Bound Tool Approval Admission Work
* style: Normalize HTTP Regression Formatting
* fix: Validate Persisted Options Before Runtime Alias Expansion
* fix: Preserve Option Limits Across Reset and Initialization
* fix: Keep Legacy Approval Options Readable in Management Responses
* fix: Retain Option Limit Provenance Through Runtime Normalization
* test: Use a Typed MCP Configuration Fixture
---------
Co-authored-by: Lia <lia@librechat.ai>
|
||
|
|
4d061fdd46
|
🔄 fix: Judge Tenant Profiles on Their Own Base, Clear Config Caches on Principal Deletion, and Add a Config Reload Route (#17397)
Profile writes are judged in the tenant partition the profile merges in. For a role, or a
caller inside a tenant, that is the caller's partition. For a group or user profile written by
an admin without a tenant, it is the stored document's tenant: PUT, PATCH and POST …/changes
validate on librechat.yaml as that tenant resolves it with that tenant's __base__ over it, use
the same Base for the recheck after commit and for key binding, tombstones and field deletes
judge re-entry on that tenant's librechat.yaml, and every route reports `ignored` over that
tenant's Base. Each attempt reads the document in that partition only, and a document that
moved partition while the write ran answers 409 CONFIG_VERSION_CONFLICT. The config store's
partition rules are unchanged; another tenant's Base is read in that tenant's context.
Deleting a group, role or user clears the config caches when it removes or restores the
principal's profile (`invalidatingConfigStore`), awaited before the response and broadcast with
Redis as config writes do; a call that rejects clears too, since it may have committed.
POST …/changes lets `unset` remove any part of a top-level section configSchema does not
define; the section's own `unknown_section` issue is no longer blamed on the removal, and every
other op there still answers 400 UNKNOWN_SECTION.
POST /api/admin/config/reload, for an admin without a tenant holding broad manage:configs (a
tenant admin gets 403, since the reload reaches every tenant), runs the config cache clear without
a write, loads librechat.yaml again on the answering instance, and once it loaded publishes the
clear over Redis so every other instance loads the file on its next read. It uses
ConfigCacheInvalidation.reload, which reports the clear, the load and the publish instead of only
logging a failure (writes keep `invalidate`, which leaves the load to the next read). It answers
200 `{ success: true, broadcast }`, `broadcast` false without Redis; 422 CONFIG_RELOAD_INVALID
with each schema issue's location when the loader refuses the file, keeping the last good config
and publishing nothing; 500 CONFIG_RELOAD_FAILED when a clear fails or the config cannot be built
from the file; and 503 CONFIG_RELOAD_BROADCAST_FAILED when this instance reloaded but the publish
failed, since an instance that misses the broadcast keeps its cached librechat.yaml, which never
expires. Every reload that runs is audited as `config.reloaded`, a failed one with outcome
`failure` and its code. The meta reports `features.reloadRoute`. Writes still reload the file.
The e2e content-filter helper uses the route instead of a sentinel profile.
docs/mcp-overrides.md describes the current timing: the awaited clear, the Redis broadcast, what
still waits for a TTL, that a process the clear misses keeps its old librechat.yaml, and hiding
as an access boundary at checkout.
|
||
|
|
5e90cc45e4
|
📎 feat: Copy Chat Attachments into Attached Workspaces (#17376)
* 📎 feat: Copy Chat Attachments into Attached Workspaces A chat on an attached workspace now copies the user's own attachments into .librechat/attachments/ before the model runs, through the worker's import_file operation, and tells the model where they are. A worker without the operation, a deny file-write policy, or a copy that fails or runs past its bound leaves a plain note saying the file is not on this machine and why. * 🧭 fix: Scope Attachment Records by Tenant and Prime Late Subagents Match the tenant when recording a workspace copy, require write_file so the folder can always ignore itself, key copies by the live Code API route and worker, keep a digest when a copy fails so it is not hashed again, stop waiting on bookkeeping at the deadline, refuse to start on a cancelled turn, prime lazily initialized subagents through one per-turn primer, and make the budget configurable as endpoints.agents.workspaceAttachments.timeoutMs. * 🙈 fix: Copy Attachments Only Where the Folder Ignores Itself Gate every copy on .librechat/attachments/.gitignore ignoring the whole folder: create it with *, and accept an existing one only when it already ignores everything, otherwise report the file as unavailable with how to fix it. Prime a lazily routed subagent against its own tool context with a provisioning callback bound to it, and check for a cancelled turn before arming the deadline timer. * 🪢 fix: Recheck the Attachment Ignore Rule Each Turn and Share One Request Cap Drop the process-wide ignore cache and check the folder once per turn, shared by every agent, rejecting a truncated read. Cap workspace requests per turn across agents (workspaceAttachments.concurrency, default 3), name converted images for their stored type, log only safe error metadata, and keep the bookkeeping write from advancing updatedAt. * 🔀 chore: Take dev's File Methods Ahead of Merging dev dev and this branch both add to the same lines of the file methods module. Take dev's version here so the merge of dev that follows is clean; the next commit adds recordFileWorkspaceImport back beside dev's new methods. * 🧩 fix: Ignore Workspace Operations a Newer Worker Advertises Bring recordFileWorkspaceImport back beside dev's new file methods after the merge. Drop well-formed operation names this build does not know from a worker's capabilities, globally and per workspace, instead of rejecting the whole status, so workers can turn on new operations such as import_file by default. Known names keep their strict checks, malformed lists are still refused, and a worker offering only unknown operations offers no workspace tools rather than failing. |
||
|
|
a51c45bbf3
|
🌳 fix: Preserve Primary Files Until Secondary Cleanup Succeeds (#17228)
* fix: Preserve primary files until secondary cleanup succeeds * test: Use a flat deletion-strategy lookup * fix: Preserve erasure retries and reconcile removed embeddings * test: Match deletion regression formatting * fix: Preserve search intent after vector cleanup * fix: Repair retained project search files before tool execution * fix: Normalize Retained Project File Runtime Types * test: Use the Storage Source Enum in Project Repair Coverage * fix: Confirm Secondary Cleanup and Preserve Repair Policy * test: Correct Repair Fixture Types and Cleanup Retry Assertions * fix: Reconcile Code Copies Compatibly and Charge Shared File Budgets * fix: Reserve Admitted File Budgets Before Deferred Screening * fix: Retain Concurrent File Copies and Scope Cleanup by Tenant * fix: Bound Erasure File Checks and Correct Cleanup Fixtures * fix: Preserve Provider-Only Assistant File Deletion * fix: Reconcile Primary Vector Deletions Before Finalization * fix: Finalize Successful Files in Mixed Cleanup Batches * test: Load Real File Finalizer in Cleanup Integration Tests * fix: Preserve Project Routing MIME and Fence File Storage Operations * fix: Validate Provisioning Principal and Type Project Repair Fixtures * fix: Recover Provisioning Claims and Retain Uncertain Storage Outcomes * fix: Normalize File Recovery Results and Reconcile Transport Attempts * test: Preserve Deployment Routes in Host Provisioning Fixtures * fix: Recover Deletion Claims and Fence Generated Output Writes * fix: Preserve Generated Output Commit Snapshots * test: Use Persisted Owner Type in Generated File Fixture * test: Type Generated Output Fixture with Its Commit Contract * fix: Preserve Publication Error Handling and Cleanup Test Boundaries --------- Co-authored-by: Lia <lia@librechat.ai> |
||
|
|
db225c0919
|
🔐 feat: Admin Config Secrets v2 (MCP and Azure Credentials, Re-entry, Env Allowlist, Rebinding) (#17353)
* 🔐 feat: Admin Config Secrets v2 (MCP and Azure Credentials, Re-entry, Env Allowlist, Rebinding) The admin config API stored MCP server credentials and Azure group keys in plaintext, returned them to config readers, let an admin who cannot read a stored credential send it to a host of their choosing, and let override values reference any environment variable. MCP credentials and Azure keys, in `groups` and in the `groupMap` the Azure clients read, are now encrypted with masked previews, hidden from every read and decrypted once after the merge. A write that keeps a stored MCP credential or web search key while changing where it is sent must enter it again, judged by the value the written document holds. `${VAR}` references in overrides are limited to an allowlist, named where a change batch leaves them, and the merge drops a credential a layer moves to a new destination without entering it, listing it in write responses only for sections the caller can read. A custom endpoint's key is bound to its base URL, its provider and the destination options in addParams and dropParams (such as the anthropicApiUrl the native Anthropic client sends to), matched across layers under the name the merge folds (ollama is Ollama). A restated `${VAR}` counts as entered, so allowlisted names are not bound to a destination. Azure's `${INSTANCE_NAME}` and `${DEPLOYMENT_NAME}` stay templates in a group's `baseURL`, and a scheduled job's MCP consent no longer depends on the masked previews that change when an admin rotates the key in place. * ♻️ refactor: Move the MCP Key Re-entry Guard Out of the Binding Helpers to Break an Import Cycle With #17351's OpenID provisioning on dev, the app config service reached itself through the rebinding guard: app/service -> app/overrides -> app/rebinding -> mcp/registry/binding -> mcp/errors (and mcp/types) -> mcp/oauth/obo -> utils/identity -> auth/openid -> auth/provision -> app/resolve -> app/service. The binding helpers are pure diffs; only requireApiKeyReentryForRebinding needs the MCP error class, so it moves to mcp/registry/reentry.ts, and the helpers take MCPOptions from librechat-data-provider as mcp/headers.ts does. No behaviour changes. * 🧪 test: Drop a Base-Held Endpoint Key That a Lower-Priority Profile Moves Base merges first since #17352, so a profile below Base's priority still lands over it. The rebinding guard drops the key Base stores for a custom endpoint whose baseURL the profile changes, and the PATCH response lists it in `ignored`. * 🔐 fix: Serve Admin Azure Group Keys and Keep Deployment Keys at Their Own Destinations Azure groups a profile writes now take effect: the merge resolves a layer's `endpoints.azureOpenAI.groups` as AppService resolves librechat.yaml's (`resolveAzureGroups`, shared with `azureConfigSetup`) into the `groupMap`, `modelGroupMap`, model list and assistant models the Azure clients read. A layer's groups replace the groups below whole, as its array does; groups that do not resolve stay unread with a warning. The rebinding guard judges the resolved groups like any `groupMap` entry, and an Azure group's destination now also covers a deployment name its base URL takes its host from and the destination options of its `addParams`/`dropParams`. A write that keeps a stored Azure group key (in `groups` or `groupMap`) while changing where the group sends it answers 400 `CONFIG_SECRET_REENTRY_REQUIRED` on PUT, PATCH, field deletes, tombstones and change batches, judged as the document resolves over librechat.yaml and on each `groups` item as written. OCR fills an empty key from `OCR_API_KEY` only for its default destination (no base URL, or `${OCR_BASEURL}`), so a key the guard dropped for an override's `${VAR}` base URL is not replaced by the deployment's. The env reference policy includes the `${OCR_API_KEY}` loading fills in for an `ocr` section without a key, so a client can write back what GET `/base` returned. The custom endpoint guard no longer needs the layer's overrides to name an entry: an entry changed some other way is judged as inherited (positional tombstones inside the list are not applied by the merge, so none reached one). A web search URL a layer points at a `${VAR}` other than librechat.yaml's without entering its key is set back: web search sends the deployment's key, or its client's environment default, to any `${VAR}` URL. * 🔐 fix: Keep Azure Assistants Served, Opaque Keys as Entered and Batch Env Checks on the End State Azure assistants: a profile's `groups` replace the groups below whole, so groups with no model that supports assistants under librechat.yaml's `assistants: true` left `assistants` on with an empty `assistantModels`, and the Azure Assistants initializer picked `assistantModels[0]` (undefined). `azureConfigSetup` refuses that combination at startup; the merge now turns `assistants` off when none of the models it leaves supports them, with a warning, judged on the merged result so a later layer whose groups serve assistants keeps them on. The check is `lacksAzureAssistantModels`, shared with `azureConfigSetup`. Opaque credentials: every runtime reader of the OCR, speech, web search and Langfuse keys uses the decrypted value as is (`resolveConfigSecret`, `resolveStoredConfigSecret`, `decryptConfigSecret`), so a `${...}` inside a key the write encrypts is part of the key. Those fields are marked `opaque`: the write-time check skips a value the write encrypts there, and the runtime pass keeps their ciphertext instead of blanking it. A whole `${VAR}` reference there, which the field passes through and its reader resolves, is still checked, and so is stored plaintext. Custom endpoint (`initializeCustom`), Azure group (`mapModelToAzureConfig`) and MCP (`processMCPEnv`) credentials are expanded by their clients once decrypted and stay checked; the Assistants keys have no reader yet and stay checked too. Change batches: env references are judged on the document the batch leaves, as its other issues are. An issue counts only when the end state still holds a disallowed reference (ciphertext by its plaintext) where the batch sent one, at a location the batch changed, so a value a later op removes or replaces (`set ocr.baseURL`, then `unset ocr`) is no longer refused, and a stored reference the batch puts back where it was is left to merge time. * 🔐 fix: Proxy-Bound OAuth Secrets, Consistent Azure Group State, Batch Issues by Entry Key and Loaded Web Search References - The MCP proxy is part of the OAuth client secret's binding (user tier, admin re-entry and the merge's rebinding guard share `getChangedOAuthSecretBindingFields`): the access token the secret obtains travels through it. - A tombstone of `endpoints.azureOpenAI.groups` resolves the groups to none in the merge (empty `groupMap`, `modelGroupMap` and model lists, so the model list does not fall back to the environment's defaults), and removes what they resolve to in `applyConfigTombstones`. - The merged Azure model lists name only models a merged group serves (`narrowAzureServedModels`), so an override's `assistantModels` no group serves no longer keeps Azure assistants on. - `/changes` env issues are held by entry identity (`toConfigIdentityPath`), followed through renames and resolved on the batch's end state, so a removal or rename no longer shifts them. - References loading librechat.yaml introduces (OCR's `${OCR_API_KEY}`, the web search defaults) are allowed at the location they are loaded at, so GET /base's sections are accepted written back, and nowhere else. * 🔐 fix: Re-entry for Endpoint, OCR and Speech Keys, Own Keys Bound Over Base and User Key Destinations Kept - The document that stores a custom endpoint, OCR or speech key can no longer move its destination without the key: PUT, PATCH, field deletes, tombstones and change batches answer CONFIG_SECRET_REENTRY_REQUIRED at the changed field (getBoundKeyReentryIssues), judged by value as the document alone sends it. - A profile's own key for an endpoint, MCP server, OCR or speech service, or Azure groupMap group that Base defines is bound to that destination when it is entered: the rebinding guard reports a fingerprint of where it goes, the write stores it beside the key (<secret>Binding), and the guard keeps the key there until a lower layer moves it. Reads and the merged config leave the fingerprint out; kept keys carry it; client values are replaced. - An inherited custom endpoint or MCP server that sends a credential each user holds (user_provided, customUserVars, apiKey.source user, OpenID or Graph token placeholders) keeps its destination: a layer's move is set back and listed in ignored. |
||
|
|
0abbf3313d
|
🔐 fix: Apply Base Config Overrides Before Sign-In and Refuse Script Policy Links (#17351)
* 🔐 fix: Apply Base Config Overrides Before Sign-In and Refuse Script Policy Links Sign-in decisions made before the user is known now read librechat.yaml plus the `__base__` override of the request's tenant, or of the deployment outside a tenant, and fail closed (`resolvePreAuthAppConfig`). Registration, the first phase of password reset and the first email-domain check of the LDAP, OpenID, SAML and social strategies use it. The second check applies the account's role overrides with or without a tenant, and a new account is checked against the role it will be created with before anything is inserted. OpenID checks again when the admin claim or role sync changes the role. Password reset issues no link when the account's config cannot be read. The signed-out `GET /api/config` serves Base `registration.socialLogins` and the pre-login interface fields (`resolvePreLoginAppConfig`), falling back to librechat.yaml when overrides cannot be read. `turnstile` becomes a base-only section, so Turnstile comes only from librechat.yaml. Config reads that merge documents stay in one tenant partition (`tenantPartition`, Mongoose binding `tenantPartitionFilter`): the active tenant's documents, or the tenantless ones outside a tenant. The config store's Mongoose binding reads, writes, lists and restores role documents, `__base__` included, in that partition, and its `listActive` draws every document from it; group and user documents stay addressed by id. Only a `list` with `acrossTenants` reads every partition, which `listConfigTombstones` uses so the startup MCP tombstone report still names each tenant's documents. The tenant-isolation conformance suite gains single-partition cases. Privacy policy and terms of service `externalUrl` must be http(s), `mailto:`, `tel:`, relative or blank (`isSafeLinkUrl`). Admin writes of another scheme are refused, a librechat.yaml link is dropped with a warning at load, a stored one is dropped at merge, and every payload and the client remove one that reaches them. The admin config meta reports `features.preAuthBaseOverrides: true`. * 🧪 test: Layer a Required-Field Override Through interface.currency Instead of Turnstile Turnstile is set in librechat.yaml only now, so profile overrides of it are skipped and the layering scenario could no longer see a role's Turnstile options completed by a user's site key. The scenario now layers `interface.currency`, whose `code` and `rate` are both required: the role stores only the rate, the user only the code, and /api/config serves both. * 🛂 fix: Admit a First OpenID Login Under Its Claimed Role Before Creating the Account The admin-role claim and role sync are now decided before a first-login OpenID account is created, and createUserOnce admits the email under that role's config, read in parallel with the USER role's, before inserting anything. A login the claimed role refuses creates no account and no start balance. Admitted logins are unchanged: the account is still created as USER (now explicitly), moved into the claimed role, re-checked and audited as before, with the claims decided once. An account a concurrent first login created gets the claims decided again for its own role and tenant. |
||
|
|
6189220697
|
🏷️ fix: Resolve endpoints.all Title Settings per Field and Fold Ollama Endpoint Names (#17316)
Some checks failed
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) Waiting to run
Publish `@librechat/client` to NPM / publish-npm (push) Blocked by required conditions
Docker Dev Images Build / publish (push) Waiting to run
Sync Helm Chart Tags / Ignore non-main push (push) Waiting to run
Sync Helm Chart Tags / Sync chart tags (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (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
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (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
* 🏷️ fix: Resolve endpoints.all Title Settings per Field and Fold Ollama Endpoint Names Conversation titles picked `endpoints.all` as a whole block, so any `all` block (even one holding only streamRate, headers or activity label keys) hid every per-endpoint titleConvo, titleModel, titleMethod, titleEndpoint and title prompt. `resolveTitleConfig` resolves each field from `all`, then the named endpoint, then the custom endpoint entry, keeping titleEndpoint and titleModel as one choice from the first layer that sets either. Config overrides merged `endpoints.custom` by exact name while the runtime serves names through `normalizeEndpointName`, so an override `ollama` survived beside the YAML `Ollama` and split the endpoint between two baseURLs and keys. The merge key now folds the same way (the YAML spelling is kept), merge-key issues, issue attribution and secret preservation use the same identity, and the effective config serves `modelSpecs.addedEndpoints`, `modelSpecs.list[].preset.endpoint` and `endpoints.agents.allowedProviders` in served names without repeats. A stored document that already names one endpoint in two spellings is combined at merge in document order, so requests keep the host and key of the first item instead of moving to the YAML entry; omit-to-keep secret preservation reads the same combined entry. A new write naming both spellings is rejected as a duplicate. An agent saved as `Ollama` now runs on the served `ollama`: the model catalog lookup (`resolveModelCatalogKey`) falls back to the served name, and `initializeAgent` folds the provider before the allowedProviders check and provider setup. * 🏷️ fix: Report Per-Field endpoints.all Title Resolution in the Admin Config Meta resolveTitleConfig resolves endpoints.all title settings one field at a time, so GET /api/admin/config/meta now reports rules.titleResolution as 'field'. meta.spec ties the reported value to resolveTitleConfig: with endpoints.all = { streamRate: 1 } and openAI.titleModel = 'x', the rule is 'field' exactly when the endpoint's titleModel survives. * 🧪 test: Expect Segments on the Folded duplicate_merge_key Write Issue Admin config write issues carry segments since #17322; the folded Ollama/ollama duplicate test now asserts them. * 🏷️ fix: Match Folded Custom Endpoint Names in Admin Config Change Ops The changes endpoint from dev matched entry keys exactly, while the config merge, merge-key issues and secret preservation fold `Ollama`/`ollama` into one custom endpoint. An upsertEntry `ollama` over a stored `Ollama` copied the stored key, appended a second entry and failed as duplicate_merge_key; removeEntry `ollama` left a stored `Ollama` in place; a rename onto another spelling passed entry_exists; and the librechat.yaml entry check missed `ollama` against the YAML `Ollama`. - data-schemas: `getConfigEntryIdentity` folds a key by its override path; `getConfigEntryMatcher` backs upsertEntry, removeEntry, rename, written-path attribution and the stored-counterpart lookup; issue locations use the same identity. A rename of an entry stored in two spellings moves the one entry the runtime merge combines (`combineFoldedConfigEntries`). - api: the YAML-entry rename guard and the per-batch duplicate check compare entries by the same identity. - Tests: unit coverage for each op across spellings, and handler integration tests against MongoDB for upsert with secret preservation (single and two-spelling documents), removal, entry_exists, inherited_entry and duplicate changes in one batch. |
||
|
|
ff962fcaa2
|
📔 fix: Recover Subagent Content With Shared Chat Rendering (#17290)
* test: cover retained subagent chat history parity * feat: Define Task-Scoped Subagent Content Recovery Contract * style: Format Retained History Regression Tests * feat: Add Task-Scoped Subagent Public Content Recovery Foundation * feat: Render Subagent Turns With Standard Chat Content * fix: Bound Recovery Capture and Keep the New Writer Opt-In * feat: Recover Subagent Chat Content From Committed Task History * fix: Preserve Recovered Metadata and Shared Reader State * fix: Preserve Journal Retry Bytes, Unicode and Recovered Phases * fix: Catch Up Terminal Child Content Beyond Pinned Pages * fix: Bound Child Content Settlement and Restore Preparation Timing * fix: Preserve Retained Child History After Late Append Completion * fix: Reconcile Late Child Commits and Preserve Terminal Content * fix: Retain MCP Scope While Detached Children Execute * test: Assert Shared Task Ownership Across Request Adapters * fix: Preserve Subagent Recovery Across Flush and Deletion Races * test: Enforce Indexes in Subagent Deletion Regressions * fix: Respect Revoked Recovery When Cached Content Exists * fix: Honor Recovery Revocations and Hide Read-Only Approvals * test: Type Captured Tool Metadata in Approval Regressions * fix: Keep Recovery Fallbacks Read-Only * fix: Bound Subagent Recovery Work and Preserve Terminal Answers * fix: Reconcile Late Content Writes and Preserve Selected Outcomes * fix: Preserve Durable Outcomes Independently of Capture Completeness * fix: Reconcile Serialized Subagent Text Blocks Without Duplicate Outcomes * fix: Preserve Journal Cleanup Scope Before Conversation Erasure --------- Co-authored-by: Lia <lia@librechat.ai> |
||
|
|
8c51a3f9f8
|
🙈 feat: Let Config Profiles Hide librechat.yaml MCP Servers and Remove Their Fields (#17327)
* 🙈 feat: Let Config Profiles Hide librechat.yaml MCP Servers and Remove Their Fields Config profiles are the `__base__`, role, group and user documents written through `/api/admin/config`. A profile can tombstone `mcpServers.<name>`, and the merge then removes that server from the principal's resolved `mcpConfig`. * 🛡️ fix: Apply MCP Hiding to Server Instructions, Failed Removals and the Startup Audit - Server instructions bound for the model now leave out librechat.yaml servers hidden from the acting user, including one a model spec pins. `applyContextToAgent` passes the request user through `formatInstructionsForContext`, which drops the user's hidden set from the user-less catalog it reads. - A config-tier candidate that removes a librechat.yaml value (a field, or a key of a record such as `headers`) and fails inspection now stands as a failed config-source entry instead of falling back to the librechat.yaml base that still carries the removed value. A failed change that removes nothing still falls back, and an entry with no transport (fields written over a hidden server) keeps the documented librechat.yaml fallback. - The startup tombstone report reads every tenant's profiles in the system tenant scope, so it also runs from entry points without an outer system scope under strict tenant isolation, and names each profile's tenant. * 🗂️ fix: Project the Startup MCP Tombstone Report Query and Run It Alongside Connections * 🔑 fix: Keep Removed OAuth Headers Out of the MCP OAuth Callback * 📝 docs: Note That Removed OAuth Headers Stay Out of MCP Sign-In * 🔐 fix: Recheck the MCP OAuth Flow's Server Before Initiation Redirects OAuth initiation redirected to a flow's stored authorization URL, or started a new authorization from the flow's stored server URL, without resolving the server again, so a principal whose profile hid the server after the flow was created could still be sent to its authorization endpoint. The callback's active-server check and its OAuth header fallback lived in the CJS route. resolveMCPOAuthTarget (packages/api/src/mcp/oauth/target.ts) now owns both: it resolves the server in the principal's current config with a strict read, refuses a flow admitted for another server, a server the principal can no longer use, or a redefined one, and selects the headers the flow sends (the initiation snapshot, else the principal's config). Initiation calls it before either redirect (404 or 400); the callback calls it before the exchange and from the token-store fence. * 📝 docs: Note That a Hidden MCP Server Ends OAuth Sign-Ins Already Started * 🚩 feat: Publish the yamlMcpHide Admin Config Meta Flag Profiles can hide librechat.yaml MCP servers and a hidden server is an access boundary, so GET /api/admin/config/meta now reports features.yamlMcpHide for the admin panel to gate its hide UI on. The meta.spec probe checks the behaviour itself: the admin API stores an mcpServers.<name> tombstone, the merged config drops the server, the registry withholds it from principal lookups and checkout but not from app-level lookups, process-backed servers stay, and an unreadable principal config withholds every hideable server. * 🧪 test: Align MCP Tombstone Specs With the Portable Config Store The admin config handlers now write whole documents through writeConfigDocument, so the end-to-end tombstone spec wires it in place of the removed upsertConfig/patchConfigFields deps. A reset of a whole MCP record now also prunes the parents it leaves empty. |
||
|
|
0b4dc238b3
|
🗄️ refactor: Portable Admin Config Store with Revisions, Key Encoding and Coherent Writes (#17326)
* 🗄️ refactor: Portable Admin Config Store with Revisions, Key Encoding and Coherent Writes Admin config writes went straight to MongoDB with dotted-path `$set`, `$unset`, `$pull` and `$addToSet`, and nothing checked `configVersion`. That caused six problems. * 🔁 fix: Reload librechat.yaml on Admin Config Writes Base-only sections such as `filters` and `messageFilter` live only in librechat.yaml, and an admin config write was how a running server picked up an edit to them. The coherent-cache change limited admin-write invalidation to the override and MCP caches, so the YAML base was never re-read after startup: the content-filter e2e suite, which activates filters by editing the YAML and writing a reload sentinel, saw `filters: undefined` from GET /base and every activation timed out. Admin config writes clear the YAML base config again, alongside the override and MCP caches, and the clear is broadcast with the others, so every instance reloads its YAML. The reload keeps the last good config on failure and republishes the tools derived from it, so the global tool cache is left for it to overwrite rather than emptied first. * 🧭 fix: Cap Dotted Field Path Depth and Hold Revision Preconditions on No-Op Writes A dotted fieldPath was split without the 32-segment cap that segments already had, so a deep path reached the recursive path writer and failed with a 500. Both spellings now share MAX_CONFIG_PATH_DEPTH and answer 400 CONFIG_PATH_INVALID / too_deep on PATCH, tombstone and DELETE /fields. Writes reduced to nothing (protected interface permissions, base-only or dedicated sections) answered 200 without checking expectedRevision. They now compare it with the stored document and answer 409 CONFIG_VERSION_CONFLICT with currentRevision on a mismatch, as the write itself would. * 📡 fix: Retry the Config Invalidation Subscription When Redis Comes Back A SUBSCRIBE that failed at startup (Redis unreachable, the client's retries spent) was only logged, and ioredis resubscribes only to channels it has joined, so the instance missed every other instance's config invalidation until it restarted. The subscription is now sent again each time the subscriber becomes ready until one succeeds; after that the client's own resubscribe takes over, and closing stops the retries. * 🔁 fix: Drop YAML Reloads and Merges Overtaken by a Config Write Admin config writes clear the YAML base config on every instance, so a write is how a running server picks up an edit to librechat.yaml. Two races could undo that: - A base reload that read the old YAML before a write's clear cached it after the clear, and the base has no TTL, so the old base was served until the next write. - A request that read the old base before the clear, and was still resolving principals, cached its merge under the new override generation for the override TTL. The config service now keeps a base-config generation that `clearAppConfigCache` bumps. A reload publishes the base, the tools and the last good config only if its generation is still current, a read after a clear never joins a reload started before it, and the newer reload starts once the stale one settles so the loader's process-wide side effects end with the newest YAML. Merges capture the generation, base included, before they read the base config. Tests: - service.spec: a clear during a reload (stale success, stale failure, a read waiting on the newer reload) and a merge built on the pre-clear base. - invalidation.redis.spec: a write on one instance makes another reload librechat.yaml. - admin-config-reload.spec (api): every admin config write route, through the real router, handlers, database and config service, reloads librechat.yaml; a request with nothing to write does not. - invalidateConfigCaches.spec no longer asserts an order the parallel clears do not have. * 🧬 fix: Encode Config Keys in Objects Built in Another Realm The key encoder treated an object as plain only when its prototype was this realm's Object.prototype, and returned any other object unchanged, keys and all. Under Jest, structuredClone (which the secret pipeline uses) returns objects from the host realm, so the items of an array the pipeline had cloned, such as Azure groups or custom endpoints, reached the engine with their dotted keys raw. Node in production has one realm, but the encoding must not depend on prototype identity: a skipped object stores its dotted keys raw without an error. A plain object is now one whose prototype is null or a root Object.prototype from any realm. The encoding spec covers an object built in a vm context. * 🧪 test: Check Dotted Record Keys Reach the Store's Whole-Document Write dev's admin config route test asserted the keys on patchConfigFields, which the handlers no longer call; it now asserts them on the draft writeConfigDocument receives. * 🚩 feat: Publish the expectedRevision, prunesEmptyParents and awaitedInvalidation Config Flags GET /api/admin/config/meta now reports the three write-coherence behaviours this branch implements, so an admin client can drop the workarounds each one replaces: - expectedRevision: responses carry `revision`; PUT, PATCH /fields, POST /fields/tombstone and PATCH /active take `expectedRevision` in the body and both DELETE routes in the query. A mismatch answers 409 CONFIG_VERSION_CONFLICT with currentRevision, a malformed value 400 INVALID_EXPECTED_REVISION; unpinned writes re-read and re-apply up to 3 times. - prunesEmptyParents: a field delete or tombstone removes the objects it empties, stopping at arrays; shells-only documents count as empty for assign-only lifecycle calls. - awaitedInvalidation: writes answer after the config caches are cleared (broadcast with Redis), GET /base bypasses the merged-config cache, and a merge read before a clear is never cached. meta.spec probes each one against the behaviour: a stale and a malformed precondition on a PATCH, the store operations' unset and tombstone on nested objects and an array element, and a held invalidation, the GET /base read options and a merge raced by a clear. * 🔀 fix: Keep Config Keys Raw Where the Engine Stores Them, So Older Servers Read Them During Upgrades Servers before the key encoding (v0.8.9-rc1 among them) read every override key literally. The Mongoose binding encoded every write, so during a rolling upgrade the first write from an upgraded server turned a stored `gpt-4.1` or Bedrock inference profile into `gpt-4%2E1` for every server not yet upgraded, and an older server's restore of a deleted group or role config dropped the `keyEncoding` marker its schema lacks, after which upgraded servers read the encoded keys literally. The binding now sends keys raw first and encodes them only when the engine refuses a raw field name (DocumentDB, Cosmos, FerretDB or MongoDB 4.4 for `$` names): the refused write changed nothing, so it runs again encoded under the same revision precondition, and that process encodes later writes holding such keys directly. MongoDB 4.4+ stores dotted names (5.0+ also `$` names inside a value), so there an older server reads exactly what it wrote. A document whose raw keys spell escape sequences while none holds a raw `.`, `$` or NUL is still written encoded, since a raw read would decode it. A raw write clears the marker. Reads decode a marked document (raw keys an older server added beside encoded ones, or wrote under a marker it left, carry no escape sequence and read as stored) and an unmarked one unless some key holds a raw `.`, `$` or NUL, which no encoded document does; that reads an encoded document whose marker an older server dropped. Encoding stays in the binding for every engine that needs it (decision #15); the residual cases are in documentdb-compat.md. * ⏱️ fix: Remove Config Cache Writes a Clear Overtook in Flight With an asynchronous APP_CONFIG store (Redis or a custom Keyv store), a clear can bump the generation and finish its delete after a reload or merge checked the generation but before its `set` landed. The older value then repopulated `_BASE_` until the next write, or a merged config for the full override TTL. The base reload, the last-good restoration and the merge cache now check the generation again once their write lands and delete what they wrote if a clear overtook it. A deleted entry only costs the next read a reload or a merge; a newer base load cannot be removed this way, since it starts only after the stale one settles. |
||
|
|
23ac2700ab
|
🧪 test: Keep EndpointService Spec Mocks Complete When the Real API Package Loads (#17324)
The spec mocked the installed `@librechat/api` and `librechat-data-provider` packages as virtual modules and gave the data-provider mock only a few enums. On CI the real `@librechat/api` build is sometimes loaded instead of the mock; it then imports `@librechat/data-schemas`, which reads `ResourceType.AGENT` from the partial data-provider mock and throws, failing `Tests: api (shard 1/3)` on dev and on unrelated PRs. Mock both packages as the real modules they are, and spread the actual data-provider into its mock so every enum exists whichever API build loads. |
||
|
|
2591a15c10
|
🔑 feat: Keep Dotted Record Keys in Admin Config Writes and Publish the Config Contract (#17322)
* 🔑 feat: Keep Dotted Record Keys in Admin Config Writes and Publish the Config Contract Keep dotted record keys in admin config write bodies behind a path-scoped sanitizer, reject $-prefixed and prototype keys after auth, report dotted_key issues with segments, and publish GET /api/admin/config/meta (features, rules, limits, versions) so clients can gate on backend capabilities. * 🧪 test: Expect Issue Segments in the Config Override e2e Scenario Override validation issues now carry `segments`; assert the full issue shape. |
||
|
|
1871d31401
|
fix: Restore Explicit File Search Uploads (#17226)
* fix: Restore Explicit File Search Uploads * fix: Preserve Unified Assistants Upload Sources * style: Format Upload Provider Condition * fix: Keep Unified Code Uploads Implicit * fix: Respect File Search Upload Role Permissions * fix: Activate File Search After Upload Persistence * fix: Recover File Search Activation for Retained Drafts * fix: Distinguish File Search Choices From Preference Sync * fix: Preserve Upload Operation and Draft Ownership * fix: Bound Draft Recovery and Own Staged Upload Cancellation * fix: Preserve Composer Draft Ownership Across Navigation * style: Match Pinned Prettier Union Formatting * fix: Bind Deferred Uploads to Their Originating Composer * fix: Preserve Upload Ownership Through Acknowledged Composer Handoffs * test: Pass the New Conversation Sentinel as a String * fix: Refresh Composer Ownership Atomically on New Chat Reset * fix: Preserve Composer Ownership During URL Prompt Cleanup * fix: Refresh Composer Ownership After Project Route Changes * fix: Fence Upload Activation With Current or Retained Composer Ownership * fix: Retire Composer Ownership Across History and Reloads * fix: Preserve New-Chat Upload Ownership During Bootstrap * fix: Fence Retained Uploads During Composer Cache Recovery * fix: Transfer File Search Preferences Only on First Assignment * fix: Preserve Upload State Across Acknowledgement Races * test: Use Production Pending Draft Keys in Autosave Regressions * fix: Preserve Upload Ownership Through Assistants Sync * test: Supply Required Assistants Submission Metadata * fix: Remove Retired Upload Chips by File Identity * test: Fix Sync Fixture Type and Regression Formatting * fix: Preserve Retained Uploads and Final Tool Preferences * test: Align Final Frame Fixtures With Upload Retirement --------- Co-authored-by: Lia <lia@librechat.ai> |
||
|
|
b2aeb9c6a1
|
feat: add masked session replay lifecycle (#17194) | ||
|
|
8718338728
|
⏱️ fix: Bound Outbound Calls Made Inside a Request (#17263)
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
* fix: Bound Outbound Calls Made Inside a Request RAG queries for file search and message context, OCR provider calls, action HTTP calls, the moderation check, the stored-image fetch for base64 providers, and Flux result polling had no timeout. A stalled upstream hung the chat turn, the upload or the tool call indefinitely, and Flux kept polling forever on statuses that never become Ready. Each now runs under a budget from a new librechat.yaml timeouts block with finite defaults (getOutboundTimeoutMs in @librechat/api). Action calls also receive the run's abort signal, so stopping a run closes the socket. * test: Cover a Stalled RAG Query in the Mock Harness * fix: Share One Flux Budget Across Submit and Polls, Bound the Vertex Token Exchange * refactor: Poll Flux Results Through pollUntilSettled * refactor: Leave Flux Polling for a Separate Migration * fix: Cap Configured Timeouts at the Node Timer Limit * fix: Bound the Action Token Refresh and the Whole Image Download * fix: Cap Every Outbound Budget by Wall-Clock Time Axios's timeout only fires on an idle socket, so a RAG, OCR, moderation, action or token response that keeps trickling bytes never ended. outboundRequestBudget pairs each timeout with an AbortSignal deadline, and action calls combine it with the run's own signal. * fix: Name the Budget That Ran Out and Give Actions Five Minutes The actions default rises to five minutes, since action endpoints are arbitrary third-party APIs and the old minute could cut off legitimately slow ones after an upgrade. A budget overrun now fails with an error naming the timeouts key and its value, whether it was the idle timeout or the wall-clock deadline, and logAxiosError logs it as a warning so operators know what to raise. A deadline cancellation is no longer read as a user stop, so an action that runs out of time reports a timeout instead of looking like a stopped run. * fix: Hold Outbound Deadlines Weakly So Finished Requests Leave No Timers * fix: Check the Budget Before Reading an Error Message * fix: Report a Wrapped Deadline as a Failure, Not a Stop * fix: Bound the OAuth Code Exchange and Keep the OCR Budget Hint When Protected * chore: Sort Imports in axios.ts After Rebase |
||
|
|
f7b053789e
|
🔐 feat: Defer MCP OAuth Sign-In Until a Deferred Tool Is Used (#17225)
* feat: Defer MCP OAuth Sign-In Until a Deferred Tool Is Used Adds an oauthPrompt server option (on_start by default, or on_use) and an operator-declared oauthToolCatalog. With on_use, an operator-configured OAuth server whose selected agent tools are all deferred no longer prompts at turn start: tool search offers the declared catalog (or the user's own cached catalog), and sign-in happens on the first tool call through the existing in-run OAuth step. Without a declared catalog the turn-start prompt is kept. Both fields are operator-only. Related to #16765 * test: Cover MCP OAuth Sign-In on First Deferred Tool Use * fix: Bound the Declared OAuth Tool Schema to Non-Recursive Types * refactor: Move MCP OAuth Deferral Orchestration Into packages/api * refactor: Move the Cached-Catalog OAuth Prompt Branch Into packages/api * fix: Defer MCP OAuth Only When the Offered Catalog Covers the Selection * fix: Cover Runtime OAuth, Background Tools, and Tokenless Discovery in Deferral * fix: Match Legacy Keys, Honor Background Capability, and Reject Unsupported Schema Keywords * fix: Resolve Wildcard Background Opt-In and Tighten Declared Catalog Matching * fix: Validate Declared Tool Schema Types and Enums * fix: Accept Canonical Catalog Keys the Definitions Loader Accepts * test: Pin the Declared Catalog Requirement for Cached User Catalogs * fix: Resolve Deferred Tool Options Across MCP Spelling Aliases |
||
|
|
520e5c0597
|
fix: Match Image Media Types to Their Bytes (#17230)
Normalize uploaded image bytes in shared TypeScript and recover mislabeled image history without inferring codecs from generic HEIF brands. Co-authored-by: Lia <lia@librechat.ai> Co-authored-by: JeongCheolLee <jclee7503@gmail.com> |
||
|
|
698ee25fea
|
🧯 fix: Close Abandoned Download and Speech Streams and Cap Speech Input (#17270)
* fix: Contain Download and Speech Stream Failures and Cap Speech Input The code output download piped the Code API stream with .pipe, which adds no error listener, so a body that failed mid-stream (a bad gzip body, a reset) became an uncaught exception and the process exited. pipeToResponse uses stream.pipeline, ending the response and destroying the upstream when the client leaves. Text-to-speech piped provider streams the same way and waited only for 'end', so a provider error was uncaught and a client disconnect left the chunk loop waiting. pipeSegment resolves on end and rejects on an error or a disconnect, which ends the loop. A speech request had no length cap, so one request could fan out into thousands of serial paid provider calls. speech.tts.maxInputChars bounds it (default 20,000 characters). * docs: Document the Speech Input Cap in the Example Config * fix: Reject a Speech Segment When the Client Already Left * fix: Tear Down Both Ends of a Failed Speech Segment and Cap Streamed Speech A failed provider segment now destroys the response as well as the source, so a half-written answer cannot hang the client, and a response-side error rejects the segment instead of going unhandled. Automatic playback reads a message only up to speech.tts.maxInputChars, so long messages cannot fan out past the cap either. The download scenario now checks the behavior .pipe lacked: leaving a code download closes the upstream connection right away. * fix: Keep a Late Response Write Error From Going Unhandled * test: Key Slow Code Downloads by File and Send a Browser User Agent * fix: Read Speech Up to the Cap Instead of Refusing It Manual speech now synthesizes the text up to speech.tts.maxInputChars, the same as automatic playback, through capSpeechInput, so the CJS service only passes the capped text along and the request keeps its existing error contract. A streamed message that reaches the cap exactly now finishes, and a segment that fails before any audio went out leaves the response open for the caller's HTTP error. * fix: Count Only Text Against the Speech Cap |
||
|
|
4c6ea7e981
|
🔐 fix: Hash Passwords on a Worker Pool and Surface API Key Lookup Failures (#17261)
* fix: Hash Off the Event Loop and Surface API Key Lookup Failures Registration, email verification, password reset and verification resends hashed and compared with bcryptjs's synchronous calls. bcryptjs is pure JavaScript, so each call blocked the event loop for every request in the process. They now use the promise APIs, and the password reset dependencies are async. validateAgentApiKey caught its own query failures and returned null, so a database outage answered remote callers with 401 Invalid API key. It now lets the failure reach requireApiKeyAuth, which answers with a 500. * fix: Run bcrypt on a Worker Pool in packages/api bcryptjs's promise API still computes on the main thread, only in chunks of up to 100 ms, so concurrent registrations and resets kept stalling unrelated requests (four cost-10 hashes delayed a 5 ms timer by about 190 ms). hashSecret and compareSecret now run bcryptjs on a small worker_threads pool in packages/api, and AuthService.js calls them. * feat: Configure the Password Hashing Worker Count * fix: Verify Login and Step-Up Passwords on the Hash Pool |
||
|
|
8fab21d882
|
🧬 fix: Skip Re-Embedding Legacy File Search Files After Upgrade (#17206)
* fix: Skip Re-Embedding Legacy File Search Files an Agent Already Holds Files embedded before per-namespace tracking carry no embeddedEntities, so lazy provisioning treated them as unembedded and embedded them a second time on the first search after upgrading, duplicating every passage. A legacy record in the agent's own file_search resources was embedded for it, so trust its embedded flag there instead of re-queueing it. * fix: Adopt Legacy Search Embeddings Only for Their Sole Holder Trusting the embedded flag for every legacy File Search file left an agent that inherited one querying a namespace without its vectors. Legacy files held by no other agent now record the active agent as their namespace, a one-time write, and are not embedded again; a file another agent also holds keeps the per-namespace re-embed. Adds an e2e scenario that reshapes an uploaded agent file into the v0.8.7 record and checks that search queries it without a second embed. * test: Cover Legacy Search Files Shared With Another Agent * test: Read the Stored File Id in Legacy Search Scenarios * fix: Pin Legacy Search Adoption to Loaded Records and Wire Every Agent Init file_id is not unique, so adoption now matches each record by its owner and tenant as well, and only rewrites the records priming loaded. The added conversation and client agent initializations receive the dependency too, so their sole-holder legacy files are not embedded a second time. * fix: Adopt Each Legacy Search Record in One Conditional Write * fix: Count a Concurrent Same-Agent Adoption as Adopted * fix: Run Legacy Search Adoption Beside the Liveness Probe and Fall Back on Failure * fix: Keep Committed Legacy Search Adoptions When a Sibling Write Fails * fix: Confirm Legacy Search Embeddings With RAG Before Adopting Them Inferring the embedding agent from current File Search holders could adopt a file for an agent whose namespace held none of its vectors, for example after the agent that embedded it was deleted. Priming now asks RAG for one chunk of each legacy file under the agent's entity_id and records the namespace only on a hit; a miss or an unreachable RAG keeps the file queued for embedding. The data-schemas method no longer scans agents and matches untenanted records as untenanted. The fake RAG server answers these presence checks from the embeds it stores. * fix: Require the Entity's Own Chunks and Keep Confirmed Vectors RAG also returns chunks owned by the requesting user, so a presence check now counts only chunks recorded under the agent itself. Once vectors are confirmed, the turn skips the re-embed even if recording the namespace fails. * fix: Bound the Legacy Search Check and Keep the Fake RAG Query Shape The RAG presence check now times out (fileConfig.legacySearchProbeTimeoutMs, 5s by default) and falls back to embedding, so a stalled RAG cannot hang priming. The fake RAG server records presence checks in their own list and keeps the file_search query records it already returned. * fix: Check Any Unrecorded Namespace Before Embedding a Search File A file another agent embedded first lists only that agent, so the agent whose older vectors went unrecorded skipped the check and embedded a second copy. Priming now asks RAG for every agent File Search file that records no embedding for the active agent, and recording adds the namespace to the ones already there. * fix: Ask RAG for Several Chunks So a User Copy Cannot Hide the Agent's RAG ranks chunks across every owner of a file_id and, once the top one is authorized, returns them all. A copy of an agent file embedded for the requesting user could rank first with k: 1 and hide the agent's own chunks, so the presence check now asks for ten and checks every owner. * fix: Confirm Setup Embeddings in Shared-File Runs and Log Safely The run-file host primes an agent's setup files on its own, so it now receives the RAG presence check and the namespace recorder too; without them a shared-file run could embed a legacy setup file a second time. Failed checks are logged with getSafeErrorMetadata rather than the raw error, which carries the vector store's response body. |
||
|
|
aec11338e6
|
🪦 chore: Retire the DALL-E 3 Tool (#17205)
* chore: Retire the DALL-E 3 Tool OpenAI shut down dall-e-3 on May 12, 2026, so the built-in DALL-E 3 tool can no longer generate images on api.openai.com. Remove the tool, its manifest entry, registry definition, and env docs, along with the loadTools functions flag that only existed to register it. The OpenAI Image Tools cover the same use case. Stored agents that still list dalle load without it, and dalle stays in imageGenTools so past images keep rendering. * test: Cover the Retired DALL-E 3 Tool in Mock Scenarios * docs: Drop DALL-E from the README Image Generation List |
||
|
|
de9d46fcd4
|
🔎 perf: Index-Bound Word-Prefix Search for Users and Groups (#16719)
* perf: Debounce People Picker Search * perf: Index-Bound Word-Prefix Search for Users and Groups Principal search and admin user search matched name, email and username with case-insensitive regexes, which scan the whole users collection. Users and groups now store lowercase, accent-folded token arrays derived from each searchable field, indexed with tenantId, and searches match anchored token prefixes. Schema middleware keeps the tokens in sync on save, insertMany and update queries. Documents written before the tokens existed stay findable through a fallback branch until npm run migrate:search-tokens backfills them; startup warns while any remain. * perf: Build Search Token Indexes in the Backfill Migration * fix: Reconcile Stale Search Tokens and Close Write-Path Gaps The backfill now compares every document's tokens with its source fields and repairs stale ones, so writes from an older server during a rolling deploy are recoverable by rerunning it. Undefined assignments no longer clear tokens, upsert inserts initialize every token field, every query word is required, relevance scoring folds accents like the filter does, and the startup check counts both collections in parallel and owns its error logging. * perf: Drop the Second People Picker Debounce SearchPicker already debounces query changes by 500ms; the extra 300ms delay in UnifiedPeopleSearch stacked on top of it. * fix: Match Nothing for Queries Over the Word Cap Dropping the query word cap let one request build an unbounded filter. Restore a 16 word cap, but a longer query now matches nothing instead of ignoring its extra words, so a cap never produces a false positive. * test: Cover Word-Prefix People Search and the Token Backfill End to End * fix: Tokenize Fields an Upsert Copies From Its Filter MongoDB copies equality conditions from an upsert's filter into the inserted document, so their token fields now derive from that value instead of being initialized empty. * fix: Rank Accent-Folded User Matches Like the Search Filter * test: Run the Token Backfill Without Blocking the Playwright Worker * perf: Index Search Tokens Tenant First for Scoped Searches and Ignore Undefined Unsets * test: Skip the Module-Scope Index Rebuild When the Scenario Runs the Backfill * fix: Exit the Search Token Migration When Redis Clients Stay Open * perf: Probe for Missing Search Tokens at Startup Instead of Counting Them * test: Explain the Startup Probe the Warning Actually Issues * fix: Keep Search Token Fields Out of Serialized Users and Groups * fix: Keep the Admin Search Legacy Fallback Anchored at the Field Start * fix: Score Groups Only on the Fields Search Matches * perf: Start the Search Token Probe Alongside the Permission Checks * fix: Warn at Startup When the Search Token Indexes Were Never Built * fix: Score People Search Matches With the Filter's Word Separators * perf: Check the Token Indexes Before Probing for Unmigrated Documents * test: Drive the Failed Startup Probe Past the Index Check * fix: Score People Search Matches Independently of Word Order |
||
|
|
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 |
||
|
|
a03d90e1dc
|
🧩 feat: Add Skill Creation and File Deletion to Management API (#16878)
* feat: complete Skill management CRUD * fix: make Skill file deletion retryable * fix: delete local Skill files by recorded owner * fix: narrow skill management CRUD and honor blob owners * fix: preserve request-scoped storage deletion ownership |
||
|
|
ecd6943194
|
✂️ refactor: Remove Dead Helpers, Classes and Dependencies From packages/api (#17118)
* refactor: Remove Unused Agent Helpers and Superseded Wrappers * refactor: Remove Dead Auth, Middleware, Protection and Prompt Helpers * refactor: Remove Dead MCP, File, Skill and Endpoint Code * refactor: Remove Dead Stream, Telemetry, Utility and Type Exports * chore: Drop Unused packages/api Dependencies From bun.lock * refactor: Keep Published Compatibility and Deprecated packages/api Exports |
||
|
|
d0e253043a
|
🙈 fix: Mask Emails and Drop Personal Identifiers From Logs (#17048)
* fix: Mask Email Addresses and Drop Personal Identifiers from Logs * fix: Log User IDs in OpenID Admin Role and LDAP Domain Block Messages * fix: Mask Unicode Email Addresses in Log Redaction * test: Add Log Email Masking Scenarios * fix: Bound the Email Redaction Matcher and Handle Quoted Local Parts * fix: Mask Quoted and Special-Character Email Local Parts * fix: Redact Whole Email Tokens, Top-Level Log Fields and Metadata Keys * fix: Redact Top-Level Metadata Keys and Escaped Quotes in Email Local Parts * fix: Redact Truncated Emails, Address Literals and Request Paths in Logs * fix: Redact the Full Log String Before Truncating * fix: Preserve Colliding and Object Keys When Redacting Log Metadata * fix: Bound Log Redaction to a Window Past the Truncation Limit * fix: Redact the Truncation Window Without a Whitespace Cut * fix: Redact Serialized Quoted Addresses and Keep Key Collisions Linear * fix: Bound Every Log Redaction Path and the URL Credential Pattern * fix: Keep Long-Scheme Credential Redaction and Serialized Escaped Quotes * test: Cover Every Secret Shape Across the Log Truncation Cap * fix: Drop Unfinished Window Tokens, Mask Short TLDs and Redact Direct Error Stacks * fix: Treat Input End as a Token Boundary and Mask Parenthesized Identifiers * fix: Remove the Quoted Local Part Length Cap Without Quadratic Scans * fix: Drop an Unfinished Quoted Address at the Window Edge * fix: Check Quoted Locals Before Accepting a Window Delimiter * fix: Count Only Opening Quotes When Trimming the Window * fix: Track Unmatched Quoted Locals Instead of Counting Closing Quotes * fix: Lift Residual Email Caps, Keep Punctuated Credential URIs Masked and Move OBO Log Id to the API Package * fix: Mask Empty Quoted Locals and Tolerate Read-Only Log Fields * fix: Return a Sanitized Copy When a Log Field Cannot Be Replaced * fix: Treat a Failed Key Removal as a Failed Replacement and Guard Stack Writes * fix: Skip Heavy Error Graphs and Accept Escaped Backslashes in Serialized Locals * fix: Accept Lone Escaped Backslashes in Serialized Locals Without Rescans * fix: Compact Axios Request Info Before Redaction and Skip Heavy Splat Error Graphs * fix: Redact Address Keys on Nested Error Objects * fix: Materialize and Redact Enumerable Getters on Nested Errors * fix: Guard Throwing Top-Level Getters and Skip Heavy Fields Only on Error Records * fix: Skip Serialized Quotes When Trimming an Unfinished Address * fix: Bound Redaction With a Per-Record Node Budget and Accept JSON Control Escapes * fix: Match Credential URIs From the Separator So Scheme Length Is Unbounded * fix: Count Strings Against the Redaction Budget and Guard Nested Getters * fix: Rebuild the Log Record When a Top-Level Accessor Ignores Writes * fix: Rebuild the Log Record When a Stack Accessor Ignores Writes * fix: Guard the Initial Stack Read on Direct Error Logs * fix: Accept Escaped Solidus and Preserve the Outer Budget on Reentrant Logging * fix: Guard the Axios Marker and Error-Like Probes Against Throwing Getters * fix: Guard the Axios Marker on Nested Errors * fix: Replace Skipped Heavy Fields Up Front, Budget Top-Level Fields and Mask Encoded Emails * fix: Mask Encoded Address Keys and Guard Nested Axios Config Compaction * fix: Redact URL Objects in Compact Request Info * fix: Remove Encoded Email Caps and Strip Serializer Hooks From Clones * fix: Strip Serializer Hooks From Error Clones and Top-Level Records * fix: Neutralize Inherited Serializer Hooks on Log Records * fix: Guard the Serializer Hook Probe * fix: Replace Function Values in Log Records * fix: Mask Percent-Encoded Domain Separators in Logged URLs * fix: Bound the Encoded Email Domain at URL Delimiters * fix: Shadow Throwing Serializer Getters on Nested Errors * fix: Rebuild Accessor Messages and Mask Doubly Encoded Addresses * fix: Redact Multiply Encoded Address Keys * feat: Make the Log Redaction Node Budget Configurable * fix: Guard Message and Serializer Property Reads * fix: Contain Proxy Failures and Redact the Compact Request Method |
||
|
|
5fc4371c6a
|
🪦 refactor: Remove Dead Legacy API Modules and Root Tooling (#17114) | ||
|
|
e2b2839375
|
🗃️ refactor: Remove Dead Data Schemas Methods and Data Provider Exports (#17113) | ||
|
|
76192bdfd0
|
🛂 feat: Audit Resource Sharing Changes and Fail Closed on Reversible Audit Writes (#17053)
* feat: Audit Resource ACL Changes and Fail Closed by Default * fix: Keep Non-Reversible Admin Audit Handlers Fail-Open * docs: Narrow AUDIT_LOG_FAIL_CLOSED Description * fix: Audit and Restore ACL and Insights Changes in One Pass * fix: Break Audit and Insights Permission Type Cycle * test: Cover Resource ACL Audit Scenarios * refactor: Audit Resource Permission Changes Before Writing * test: Align Concurrent Revoke Audit Expectation * fix: Skip Deleting ACL Entries That Were Not Audited * fix: Read ACL Snapshots Through the Write Session * fix: Never Block Revocations on Audit Outages and Normalize Principal Keys * fix: Let an Explicit Public Disable Win Over a Public Update * fix: Audit Duplicate ACL Rows as Combined Permissions * fix: Audit Permission Changes Under One Target and Dedupe Revokes * fix: Audit Capability Grants Before Writing Them * feat: Serialize Resource Permission Updates With a Per-Resource Lease * fix: Fence the Resource Lease Before Writes and Always Audit Grant Assignments * fix: Renew the Resource Lease Before Each ACL Write Phase * fix: Serialize System Grant Assignment and Revocation With a Per-Grant Lease * fix: Keep Leases Alive During Audits, Bound Lock Index Wait, Canonicalize Audit Target IDs * fix: Retry Deferred Revoke Audits Under the Lease and Audit Canonical Principal and Role IDs * test: Expect Role IDs in Permission Audit Metadata * fix: Read Mutation Snapshots From the Primary Outside Transactions * fix: Flush Deferred Audits Before Cache Invalidation, Keep Renewals Monotonic, Keep Role Case in Grant Lease Keys * refactor: Map the Busy Permission Error to Its Code in the API Package * style: Sort Lease Imports and Type the Renewal Spec Read * fix: Keep Success Audits After Commit, Report Downgrades as Revocations, Code Audit Outages * refactor: Move the Audit Outage Code to Its Own Module * fix: Translate Lock Failures, Lease Non-Transactional Sessions, and Code Grant Audit Outages * fix: Sanitize Lease Renewal Failures at the Permission Boundary * fix: Annotate the Unavailable Error Code for Isolated Declarations * fix: Keep the Admin Route Fail-Closed Opt-In and Document Lease Clock Skew Safety * fix: Translate Grant Lease Store Failures to a Retryable 503 * fix: Log Failed Grant Audit Writes With Safe Metadata Only * test: Detect Raw Error Arguments in the Grant Audit Log Spec * feat: Make Permission Lease Limits Configurable and Localize Retryable Sharing Failures * fix: Bound Lock Index Readiness by the Lease Wait and Carry the Resource ID in Every Audit Entry * test: Cover Lease Config Reaching the Leases and the Sharing Dialog Failure Messages * fix: Load App Config on the Sharing and Grant Routes and Log Failed Lease Releases * perf: Load App Config Only on the Grant Mutation Routes |
||
|
|
219a48b55d
|
⏳ fix: Expire Dead-Lettered Trigger Deliveries and Clean Up Orphaned Image Uploads (#17049)
* fix: Expire Dead-Lettered Trigger Deliveries After a Review Window * fix: Delete Stored Image Uploads When Record Creation Fails * fix: Clean Up Stored Objects on Every Storage-Before-Record Upload Path * refactor: Resolve the Delete Strategy Lazily in Stored Upload Cleanup * test: Cover Dead Letter Expiry After the Review Window * fix: Carry Owner to Stored Upload Cleanup and Keep Batch Dead Letter Deadlines * refactor: Select the Stored Upload Cleanup Target in the API Package * fix: Check for a Committed Record Before Deleting an Upload and Keep Dead Letters Unless Configured * fix: Check the Persisted Record Id for Converted Assistants Images * fix: Arm a Dead Batch Root Deadline After Its Members Settle * fix: Settle Expired Dead Batches and Skip the Record Guard Before the File Write * fix: Skip the Record Guard for Pre-Write Failures and Build the Lookup in packages/api * fix: Build the Record Lookup Lazily in the Upload Service * fix: Pass the Dead-Letter Retention Window Through Experimental Startup * fix: Carry the Vector Copy Into Failed-Upload Cleanup * fix: Cover the Code Environment and Indeterminate Vector Copies in Upload Cleanup * fix: Give URL-Upload Cleanup a Request When the Caller Omits One * fix: Route Failed-Upload Cleanup Through Secondary-Storage Deletion * fix: Attempt Every Copy Independently When Cleaning Up a Failed Upload * fix: Track the Record Write in Every Upload Path Whose Retention Lookup Can Fail |
||
|
|
79b836d79f
|
📃 fix: Enforce Terms Acceptance on the Server and Mark Backfilled Consent (#17063)
* fix: Enforce Terms Acceptance on the Server When modalAcceptance Is On * fix: Mark Backfilled Terms Acceptance Timestamps * test: Cover Server-Enforced Terms Acceptance in the Mock Harness * fix: Gate Management Routes and Skill Sync and Resolve Terms Policy Fail-Closed * fix: Evict Cached Auth Documents When Terms Acceptance Is Reset * fix: Guard Skill Sync Behind Terms Acceptance for Every Skill List Route * fix: Move Terms Skill-Sync Guard Into the API Package and Evict All Users on Reset * fix: Batch Terms Reset Cache Eviction and Sign the Spec User In Fresh * fix: Let Stop Through the Terms Gate, Refresh Startup Config, and Wait Out Failed Eviction * refactor: Narrow the Terms Exemptions and Share One Refusal Path Across Clients * refactor: Compose the JWT Terms Gate Through an API Package Helper * style: Sort Imports for the Shared Terms Refusal Helper * test: Expose the Terms Gate Helper in the JWT Auth Spec Mock * test: Cover the Terms Refusal Code on Pre-Stream Upload Errors |
||
|
|
80e3707964
|
🪪 fix: Boot-Paint a Cached Theme Only for Its Signed-In Owner (#16926)
* fix: Boot-Paint a Cached Theme Only for the Tab's Signed-In Owner The boot script and DeploymentTheme's first commit replayed the deployment-theme cache without checking its owner, so a browser that last held one identity's theme painted it for another until the config answered. The tab now records its signed-in owner in session storage and both paths replay the cache only when it matches. * test: Assert Session Ends Forget the Tab Theme Owner * test: Hold the First-Paint Config Answer Until the App Paints * fix: Skip the Boot-Painted Theme Cache Once the Session Has Ended * fix: Bind the Readable Session Hint to the Signed-In Owner * test: End the Session for Real in the Expired-Hint Scenarios * fix: Clear the Session Hint When a Local Refresh Finds No Session * test: Give the Refresh Specs the Cookie Surface the Session Hint Uses * test: Count the Signed-Out Config Answer in the No-Cached-Paint Scenarios * fix: Retire the Session Hint on Every Rejected OpenID Refresh * fix: Retire the Session Hint When a Refresh Carries No Token * fix: Retire the Session Hint on Account Deletion and Password Reset * refactor: Own the Session Hint Lifecycle in the Typed Auth Cookies |
||
|
|
1994a4949d
|
🔏 fix: Encrypt Provider Keys With v3, Reject Plaintext in decryptV2 and Default to Strong Backup Codes (#17051)
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
* fix: Write User Provider Keys With Random-IV v3 Format * fix: Reject Undelimited Input in decryptV2 Instead of Returning It * fix: Default 2FA Backup Codes to the Strong Format * fix: Limit Admin Secret Preview to the Last Four Characters * fix: Re-Derive Stored Secret Previews Under the Last-Four Policy * test: Build Legacy Credential Fixtures With the Server Key * fix: Load Request Config for User Key Writes and Mask Legacy Previews |
||
|
|
a06ee14b75
|
🔐 fix: Encrypt User Plugin Credentials With Random-IV v3 Format (#16996)
* fix: Encrypt User Plugin Credentials With Random-IV v3 Format * test: Cover Credential Encryption Formats in Mock E2E Scenarios * test: Round-Trip Real Credential Helpers in PluginService Spec * 🙈 fix: Remove SharePoint Picker Payload Logging (#16997) * fix: Add credentials.writeFormat to Gate v3 Credential Writes During Rollouts * test: Expect 201 When the Legacy Write Format Override Is Created * 🔊 fix: Clear TTS Audio Cache On Session End and Hash Its Keys (#16998) * fix: Clear TTS Audio Cache On Session End and Hash Its Keys * fix: Read Manual TTS Replays From the Hashed Cache Key * fix: Purge Legacy TTS Cache Keys and Fence Writes Across Logout * fix: Keep TTS Cache Writes Off the Playback Path * test: Expect Hashed Keys in the StreamAudio Cache Lookup * test: Use a Single-Token Reply Label in the TTS Cache Scenario * fix: Settle TTS Cache Clear Before IdP Logout and Across Tabs * test: Cover the TTS Cache Fence When Another Tab Logs Out * test: Wait for the Second Tab Before Logging Out in the TTS Scenario * fix: Latch TTS Cache Writes Shut Until the Tab Authenticates Again * fix: Reopen TTS Cache Writes When Authentication Completes In Place * fix: Leave for the IdP Even When TTS Cache Cleanup Fails * fix: Retry a Failed Legacy TTS Purge and Fence Other Tabs on Manual Clear * fix: Rerun the Legacy TTS Purge After Each Clear and Sign-In * fix: Rerun the Legacy TTS Purge When Another Tab Clears * fix: Fence Pre-Auth TTS Writes, Retry Failed Clears, and Fall Back to Storage Events * fix: Version the Hashed TTS Cache Key Path * fix: Move TTS Audio to a New Cache and Keep It Closed Until a Failed Clear Succeeds * fix: Persist a Pending TTS Cache Delete Across Navigation * fix: Reopen TTS Caching Only on Session Start and Fence Cache Reads * fix: Keep the TTS Delete Fence in Cache Storage and Close Reads After Logout * refactor: Keep Read-Aloud Audio in Tab Memory Instead of Cache Storage * test: Return to the Conversation After Re-Login in the TTS Logout Scenario * test: Close the Phone Sidebar Before Replaying in the TTS Logout Scenario * fix: Bound the In-Memory TTS Cache by Size as Well as Count * fix: Scope Cached TTS Audio to the Signed-In User * fix: Keep the Settings Cache Delete Available While Legacy Audio Remains * fix: Recheck Legacy TTS Audio After a Settings Clear and on Unowned Handoff * fix: Fence TTS Writes Started Before an Account Signs In * test: Opt the Fresh TTS Account Into Enter-to-Send |
||
|
|
ee1d59e590
|
🕵️ fix: Redact Email Addresses and IPs From Auth Flow Logs (#16994) |