A subagent child thread is reachable only through the parent the requester
owns: /api/messages/<threadId> answers 404 by design, and the durable thread
view sends a bounded projection, not messages. A chat pane pointed at a child
thread therefore had nothing to load.
GET /api/convos/:parent/subagents/:thread/messages returns the thread's rows
with the conversation route's projection and tool-call previews, after the
thread view's parent, lineage and tenant check. An event thread's input is
the raw payload of an external event, so its row is sent with empty text, as
the thread view already does. A second route reads the full tool call behind
a preview, reusing the conversation route's reader.
* fix: prevent Action writes from expanding MCP access
* fix: fence MCP grant snapshots before Action token cleanup
* fix: reject Action writes after concurrent agent deletion
* fix: enforce MCP grant provenance across saves and server replacement
* test: expect reserved MCP names after server replacement
* 🫀 feat: Let a Job Owner Keep a Silent Run Alive
A generation job's idle clock advances only with emitted chunks, so a run that
works without output for 20 minutes is reaped while it is still alive.
touchJob refreshes the idle clock and the storage lifetimes an append would
have extended, fenced on the generation epoch and limited to the replica that
owns the runtime.
* 🧶 refactor: Share One Fold From Child Frames to Content Parts
readSubagentContent folded public child frames into content parts inline.
The fold is now a synchronous function a second caller can use, so a frame
can be folded and published without yielding in between.
* 🏷️ feat: Mark the Generation Job of a Background Subagent Task
Job metadata gains subagentTaskId and subagentParentConversationId, set only
by the subagent task store. A marked job is a child-thread job, so it stays
out of the active chat list, and isBackgroundChildJob tells it apart from an
event-bound child, whose job the chat controller owns.
* 🧵 feat: Run a Background Child as a Resumable Generation Job
createChildGenerationHost opens a generation job keyed by the child thread id
and feeds it the child's public step frames. Text deltas that queue behind a
slow write merge instead of dropping, the terminal state is claimed before the
caller persists and the final event is published only afterwards, and no
stream failure can fail the child: the run and its result carry on without a
live view.
* 🪢 feat: Stream a Background Child Through Its Own Generation Job
The subagent task store takes a childGenerations dependency. Once a child's
thread and input row are durable it opens a job keyed by the thread id, feeds
it each public frame, refreshes its idle clock on every lease renewal, and
settles it around its own persistence, so a reader sees the final event only
after the result row exists. A cancel, a failure and a job aborted from
outside all end both the child and its stream.
endpoints.agents.subagentActivity.generationJobs turns it off. A stream that
cannot be opened or written never fails the child.
* 🔌 feat: Give the Server's Task Store Its Child Stream
The host wiring builds the child generation host from the generation job
manager and hands it to the subagent task store, so a background child's
stream is reachable in the running server.
* 🚧 fix: Refuse Chat Abort and Steer on a Background Child's Job
The chat abort route saves a user row and a partial response and upserts the
conversation, and the steer route queues text only the chat controller drains.
Both authorized on the job's owner alone, so either could act on a background
child's job and write a chat-shaped history into a view-only thread, or accept
a steer nothing would ever apply. Both now answer 409 for a job the subagent
task store owns; the child is stopped and steered through its control
endpoint.
* 🧹 fix: Evict a Finished Job Before a Live One at Capacity
The in-memory job store made room by deleting its oldest job whatever its
status, so a full store could end a run somebody was still waiting on. It now
takes the oldest finished job first. Also covers a job manager that shuts down
while a background child runs: the child still persists its cancellation.
* 🛰️ test: Read a Background Child's Stream From Another Replica
Against real Redis: a second replica resumes with everything the child has
streamed, receives only newer deltas live, then the final event; a child that
streams past the manager's 5,000-event early buffer before anyone attaches
still resumes whole on both replicas; and the owner's touch keeps a silent
child's job alive.
* 🧽 chore: Sort Imports in the Child Stream Files
* 🧪 test: Expect the Child Stream Lever in the Activity Defaults
* 📜 feat: Store What a Background Child Streamed as Standard Content (#18173)
A child's result row carried its text and a bounded activity projection, not
the content parts every agent message stores, so a reader had to rebuild the
child's output from the projection. The row now also carries what the child
streamed, on completion, failure and cancellation, in the standard shape.
endpoints.agents.subagentActivity.generationContentBytes bounds it (4 MiB by
default, 0 stores none). Content over the bound is left off, so the row always
fits and keeps its text and projection as before.
* 🛟 fix: Keep a Stalled or Failing Child Stream From Touching Its Child
Four ways the stream could still reach the run it only observes. A frame that
could not be copied threw into the child's own progress report. A job store
that never answered held the child's start behind job creation and its result
behind the terminal claim. And a stream that had stopped being written was
never ended, so its job read as a live child for twenty minutes after the
child finished.
Frames are now copied defensively, opening and settling are bounded, a job
that arrives after its child stopped waiting is ended, and a detached stream
is still touched and still settled with its full final event.
* 🧯 fix: Let a Child Stream Observe Its Run Without Ever Stopping It
Review round 1.
A failed Redis append retires the job's runtime by aborting its controller,
and the child stream forwarded every abort of that controller to the task
store as a cancellation. A stream-store outage therefore stopped the child's
model and tool work. The stream no longer signals the child at all: deletion,
shutdown and the control endpoint already stop a child through the task
store, and an aborted, reaped or retired job now only ends the live view.
The in-memory store's capacity eviction preferred any terminal job, including
one that still owed persistence, a host action, a schedule reconciliation or
a provider drain. Those are no longer treated as finished.
The chat abort route's refusal for a background child's job moves out of the
CJS route into createBackgroundChildAbortGuard, registered ahead of it.
* ♻️ fix: Replace a Dead Background Child's Job on Its Thread
A background child's job outlives an owner that crashed, or a settlement that
could not reach the store, for up to twenty minutes. A continuation of the
thread in that window was refused its own stream, because the dead job still
read as live. The caller of open holds the thread's lease, so a background
child's job still marked live there has lost its owner: it is replaced and its
readers are told to refetch. A live job that is not a background child's, such
as an event-bound child paused for approval, is still never replaced.
* 🧱 fix: Fail the Abort Guard Closed and Budget Content Against the Whole Row
Review round 2.
The abort guard passed the request on when its job lookup failed, so a
retried lookup in the route could run the chat-shaped abort on a child the
guard never saw. A failed lookup now ends the request at the error boundary.
A child's streamed content was checked against its own limit only. A result
row also carries the text and the transcript, so content that passed the
limit could push the document past MongoDB's 16 MiB and turn a successful
child into a failed one. The content is now the optional field: it is left
off whenever the row's large fields together would exceed the budget.
Also accounts for the guard's job read in the two abort route specs that
sequence it, and gives the limiter spec's api mock the guard.
* 🪶 refactor: Settle a Child Stream Once and Fold a Frame It Cannot Copy
The task store settles a child's stream on its outcome path and again in its
cleanup. The second call made another terminal claim that could only lose;
the stream now remembers that it claimed and only persists. A frame that
cannot be copied is still folded from the original, so the stored content
stays whole when the stream detaches over it.
* 🧪 test: Cover the Child Stream's Failure Branches and the Content Fold
The change-risk report showed the stream's fail-open branches untested: a
terminal claim that lands after its wait, a claim or a final publish that
throws, the settle timeout, the backlog limit, and a rejected touch. Each now
has a case. The shared content fold gets direct cases for a closed step, a
commentary phase and an applied steer.
* fix: Advance Slack Account Linking in Place
* fix: Narrow Slack Reply Transport Contract
* fix: Make Slack Link Reply Updates Monotonic
* fix: Clear Invalidated Slack Link Cards After Delayed Writes
* fix: Allow Admins to Remove Disconnected Slack Workspaces
* fix: Use Workspace Status Chips and One Confirmation Action
* fix: Confirm Workspace Removal in a Stacked Dialog
* fix: Align Confirmation Cancel Action to the Left
* 🔐 fix: Authorize Restored MCP Tools Before Agent Revert Writes Them
Reverting wrote the version snapshot, including its mcpServerNames, before
filterAuthorizedTools ran. Agent-scoped MCP access is granted from that index,
so a restored server vouched for itself and an editor without access to it
could re-attach it. A snapshot without mcpServerNames also left the current
index in place, keeping agent-scoped access to servers no tool used.
The handler now authorizes the restored tools against the agent as it stands,
treating only its current tools as existing, and passes the authorized tools
and rebuilt index to revertAgentVersion so the restore is one write pinned to
the revision it was checked against. revertAgentVersion always rewrites the
index for the restored tools.
* 🔐 fix: Exclude the Target Agent's Own Grant When Authorizing a Revert
Moves the restore authorization into authorizeAgentRestore in packages/api,
leaving the revert controller as wiring.
A newly restored MCP tool whose server the user reaches only through agents
must now be reachable through an agent other than the one being reverted,
checked fresh against the database. The target's current or cached index
(including one left stale by an earlier revert) no longer vouches for it.
Prior server names are matched through their normalized aliases, and only for
tools the agent already had. When nothing resolves, the pre-restore index is
kept instead of deriving names from tool keys.
A revision-filtered restore that misses is reported as a 409 conflict.
The route spec restores the real ~/config so the MCP registry is consulted
rather than reported unavailable.
* 🔐 fix: Check Newly Restored MCP Servers Against Live Grants
The restore gate now runs for every approved MCP tool, not only consumeOnly
ones. A tool the agent doesn't already have, on a DB-backed server, is
admitted when a current tool still uses that server, or on a live direct
server grant, or through another viewable agent. A grant the registry still
caches after revocation no longer becomes durable through the restored index.
Admission is memoized per server. A snapshot tools array that sanitizes to
nothing restores an explicit empty set. Active-server matching no longer
reuses the index fallback, so a stale entry is never read as in use.
* 🔐 fix: Treat Legacy Cached DB Configs as User-Sourced in the Restore Gate
A config cached before an upgrade may carry a dbId without source. The
restore gate now uses isUserSourced, so such configs get the live access
check instead of passing as operator-managed.
* 🔐 fix: Recheck Unindexed Existing MCP Tools in the Restore Gate
Holding a tool no longer exempts it from the live check. Only a current tool
whose server the agent's index already lists skips it. Otherwise an unindexed
tool on a legacy agent could pass on a revoked grant the registry still
caches, and the restore would add its server to the index.
* ⚡ perf: Run Restore Admission Checks for Distinct Servers Concurrently
filterAuthorizedTools now starts every admission check during its single pass
and awaits them together, so each distinct DB-backed server no longer adds a
serial lookup wave to the revert. Tool order is preserved and server names
are recorded only for admitted tools.
* fix: Count Memory Tokens After the o200k Encoding Loads
Memory create and update routes, the by-id handler, and the memory agent's
set_memory tool persisted Tokenizer.getTokenCount, which returns the UTF-8
byte length for long text while o200k_base is still loading. Await
countTokens instead so the stored tokenCount is the real count.
Related to #17842
* test: Cover Memory Token Counts Saved Before the Tokenizer Loads
* test: Mock countTokens in Memory Tool and Route Specs
Multer assumes latin1 for multipart filenames, and the skills routes have no decode step, so a non-ASCII name reached the handlers garbled. A file name content filter could not match it on import, and the file upload route stored the garbled name.
- Let agents use Langfuse prompts by production label or pinned version,
with the existing permission and usage checks.
- Add a configuration switch, disabled by default. Preserve saved links
while disabled, without resolving them or falling back to inline text.
- Share source-specific production and exact selections across agent
links and the prompt service. Reject source mismatches.
- Add revision lists for the Agent Builder version picker. Resolve
Langfuse instructions on each initialization without caching.
- Improve disabled and unavailable states and test source changes,
revision loading, and permission failures.
The login tests reach getAppConfig through the balance middleware, which
loads librechat.yaml from the repository root by default. The file is
gitignored, so a developer who keeps one locally runs the spec against
their own config; an unresolved `${VAR}` MCP URL in it makes
configSchema.safeParse throw and every login returns 500. Point
CONFIG_PATH at a missing file so the spec runs with no config, as CI does.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* perf: Serve JWT Bearer User Lookups From the Auth User Cache
* perf: Batch Agent Permission Reads on the File Access Path
* perf: Remember a Loaded Google Service Key Across Endpoint Config Reads
* perf: Run Independent Startup, Tool, Skill and Erasure Reads Concurrently
* fix: Drop JWT User Cache Writes That Race a User Mutation
Confirm each cache write with a second read and evict when the user changed,
so an in-flight lookup cannot repopulate an entry a credential change just
evicted. The cache mode now arrives through the loader dependencies.
* refactor: Move Agent Skill Access Reads Into packages/api
The chat-completions and Responses controllers call loadSkillAccess instead of
orchestrating the three reads in CJS. The preview route spec mocks the batched
file access helper the middleware now calls.
* test: Cover Agent File Access, JWT Bursts and Remote Skill Reads End to End
* fix: Serve a Cached JWT User Only While Its updatedAt Is Current
A cache hit now reads the stored updatedAt and deletion fence instead of the
fence alone, so a document cached from a read that raced a user mutation is
never served, even when the write landed after that mutation's eviction.
* refactor: Move Startup Migration Checks Into packages/api
* refactor: Inject the Startup Migration Checks Instead of Mongoose Models
* fix: Serve Cached OpenID Users Only While Their updatedAt Is Current
Moves the freshness check into getCurrentCachedAuthUserDoc and uses it on the
OpenID bearer path as well as the local JWT one, so a document cached from a
read that raced a credential or role change is never served there either.
Fixesberry-13/LibreChat#432
* fix: Compare Authorization Fields on Every Auth Cache Hit
updatedAt has millisecond resolution, so the freshness read also compares the
token retirement stamps, role, tenant and two-factor state.
* fix: Annotate the Auth Freshness Projection for Isolated Declarations
* perf: Reuse the OpenID Cache Freshness Read for Deletion Admission
A cache hit already proved the deletion fence is clear, so only users read from
the database take the separate fence query.
* refactor: Keep the OpenID Cache Freshness and Fence Decisions in packages/api
* test: Exercise JWT Cache Freshness Against Real User Methods in MongoDB
* fix: Stamp the JWT User Lookup So the Cache Write Fence Applies
* fix: Reload a Google Service Key File When It Changes or Disappears
The availability check remembers a loaded key only while the file's mtime and
size are unchanged, and fetches URL sources every time as before.
* fix: Recheck a Service Key File After a Permission Change
openid-client's Passport Strategy replaces the authorization request's state with a random one
when the IdP's discovery metadata does not list S256 in code_challenge_methods_supported and the
request has no nonce. Azure Entra ID omits that field, so the admin callback could not find the
admin panel's PKCE challenge under pkce:<state> and issued an exchange code that any
code_verifier, or none, could redeem.
The admin strategy now adds a nonce in that case, so openid-client keeps the admin route's state
and checks the nonce against the ID token on the callback. The chat OpenID flow is unchanged.
* perf: Index Hot Lookups and Make Message Cursor Pagination Stable
Add narrow indexes for session refresh-token deletes, user-only tool call deletes, queued-turn delivery and reconciliation claims, agent code environment references, and updatedAt message pages. Add a TTL index to the KeyvMongo collection. getMessagesByCursor now sorts and pages on a unique (sortField, _id) tiebreaker with a millisecond-precise cursor while still accepting legacy cursors, and GET /api/messages caps pageSize in a TypeScript helper.
* fix: Keep the Message Id for the Cursor Under the Client Projection
* fix: Declare select on the Message Cursor Method Type
* feat: Make the Message Page Size Ceiling Configurable
* fix: Clamp the Default Message Page Size to the Configured Ceiling
* test: Cover Message Cursor Paging and Page Size Cap End to End
* fix: Continue Message Cursors Whose Sort Value Is Empty
* fix: Include Missing Sort Values When Paging Messages Descending
* perf: Resolve the Message Page Ceiling Beside the Ownership Read
* fix: Observe the Ownership Read While the Page Size Resolves
* style: Sort Imports in the Message Page Module
* refactor: Move Page Size Read Observation Into the API Package
* fix: Keep Missing and Empty Sort Values Distinct in the Message Cursor
* fix: Page Past Messages With a Missing Timestamp
* perf: Bound client hygiene paths (lodash imports, timeouts, listener cleanup, upload concurrency)
* feat: Make client request timeouts configurable
* test: Cover the configured refresh deadline end to end
* feat: Rename client timeouts to client limits and expose upload concurrency
* fix: Keep the published refresh deadline for the next page load
* 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
- GET /resolved resolves a group or user profile in the partition its document belongs to, as
writes judge it: for an admin without a tenant reading a tenant's profile, that tenant's
librechat.yaml and __base__. GET /catalog resolves such a scope there too, instead of
answering 404, and GET /effective finds a user by id the way profiles are addressed and
resolves them in their own tenant: their role, groups and documents there.
- findPartitionUser becomes findPrincipalUser, which also returns the user's tenant.
- Admin role operations address the role of the caller's tenant partition: the role lookup
(getPartitionRole), listing, creation's name check, the members a rename migrates or a deletion
reassigns, the members listed and counted, and the ACL entries (deletePrincipalAclEntries) and
grants a deletion removes. A member added or removed by id must be a user of that partition.
- getRoleByName, which every request's permission checks read, reads the role of the caller's
partition too: outside a tenant and under the system context the platform-level one, never an
older tenant role of the same name. updateRoleByName without an id and updateAccessPermissions
for a role read without its _id write that role, so the legacy permission route changes the
platform role. The grants route checks a role exists with getPartitionRole.
- runInPartition moves a read into another partition only from outside a tenant, and rejects
leaving an active one.
- deleteGrantsForPrincipal and findGrantsForPrincipal without a tenantId reach only
platform-level grants, as moveGrantsToPrincipal does.
- updateRoleByName takes { id } to change one role document; renames, their rollback,
description updates and updateAccessPermissions write the document they read.
- The exported keyed rename helpers (applyConfigChange rename, renameConfigEntryTombstones)
refuse a new name no keyed path can address, as the admin routes do.
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>
* 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>
Reject edits, deletes, new revisions, promotion and revision deletes on
prompt groups whose source is not native with a read_only service error,
mapped to 403 "Externally managed prompts are read-only". The guard reads
the stored group, so the MANAGE_PROMPTS bypass is covered. Sharing,
usage counts and resolution are unchanged.
The client hides Edit and Delete for external groups, shows a read-only
detail view with a Langfuse notice and keeps Share.
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.
* feat(prompts): add source identity to prompt groups
Add source, sourcePromptName, sourceProjectId and sourceDestination to
PromptGroup. productionId is required only for native groups. A unique
partial index on the source identity covers only groups that have
sourcePromptName, so native groups need no migration.
The create path drops client-supplied source fields, and the native
create upsert does not match langfuse groups. Records map a missing
source to native.
* fix(prompts): centralize sources and restrict native group matching
* feat(langfuse): test prompt listing and resolution from settings
Add a dry-run dialog in Settings > Langfuse that lists Langfuse prompts
and resolves one text prompt (production label or an exact version)
through the tenant's Langfuse connection. Nothing is written. A tenant
user's prompt reads never use the central env keys, even while
TENANT_ISOLATION_STRICT is off.
DevOps makes the feature available with LANGFUSE_PROMPT_SYNC_AVAILABLE
(timeout LANGFUSE_PROMPT_SYNC_TIMEOUT_MS). The tenant admin turns it on
with langfuse.promptSync.enabled.
Related: Linear AI-2271, ClickHouse/ai#4032
* fix(langfuse): isolate prompt credentials and expose prompt settings
Use stored credentials with deployment headers for prompt reads.
Show the settings tab when connection editing or prompt sync is available.
Keep connection controls and trace links under their existing gates.
Audit prompt-sync updates and reuse shared prompt response types.
* 🧬 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.
* 🏷️ feat: Hide and Rename Custom Endpoints by Name in Config Profiles
Config profiles merge `endpoints.custom` over librechat.yaml entry by entry on `name`, but
could not take one entry away. A tombstone that named one, such as `endpoints.custom["Name"]`,
passed every check, was stored with a 200 and did nothing, because the merge removes object
paths only and stops at arrays; a tombstone at a position (`endpoints.custom.0.headers`) was
stored and did nothing either. Renaming a profile's own endpoint through PUT or PATCH lost its
stored key, since the `renames` hint covered MCP servers only.
POST `/fields/tombstone`, DELETE `/fields` and the `tombstone` and `unset` ops of a change
batch now take a keyed path, `endpoints.custom["<name>"]` or
`endpoints.custom["<name>"].<path>`, whose name is a JSON string compared as the merge folds
it. A tombstone hides the inherited endpoint, or one of its fields or record keys, for the
profile's principals and removes the profile's own entry or path; hiding an endpoint also hides
the model specs that select it, whether librechat.yaml or a lower profile defines it. An unset
resets the profile's own entry or path with the keyed tombstones at or below it, and writing an
entry clears the tombstone that hides it whole. Malformed keyed paths, keyed paths after arrays
not merged by key, the entry's name, its key, preview or destination fingerprint, keyed writes
and positional tombstones answer 400, and the store's keyed mutations refuse a location whose
stored tombstone would name another path. A `segments` target names keys as written on every
route, so a segment such as `custom["Name"]` never reaches an entry past these guards: a write
by it stores a key of that spelling and clears none of the entry's tombstones. A stored
tombstone reads as keyed only after an array merged by key, so an older one such as
`mcpServers.a["b"]` keeps hiding that server.
PUT and PATCH `renames` also take `{ path: 'endpoints.custom', previousName, name }`: the
renamed entry gets the stored ciphertext and preview, and the keyed tombstones of the old name
move to the new one, as they do for a batch `rename`. The carried key stays bound to its
destination (400 `CONFIG_SECRET_REENTRY_REQUIRED` when the renamed entry sends it elsewhere)
and keeps the destination fingerprint it was entered with; a hint that cannot apply answers 400
`CONFIG_RENAME_INVALID` with a reason. Removing the destination of a profile's own keyed entry
beside its stored key needs the key again, and removing an inherited one drops the inherited
key at merge and lists it in `ignored`.
The merge-key registry moves to its own module so mutations can match entries by identity
without an import cycle. Meta reports `keyedTombstones` and `renameHints`,
`rules.renameHintPaths` and `limits.maxEntryKeyLength`, and `docs/endpoint-overrides.md`
documents the contract.
* 🙈 fix: Scope Hidden Endpoint Allow-Lists and Refuse Duplicate Rename Sources
- A hidden custom endpoint leaves endpoints.agents.allowedProviders as it
leaves modelSpecs; scopeHiddenEndpointSpecs becomes
scopeHiddenEndpointReferences.
- modelSpecs collapses only when no spec and no added endpoint remain, so
unrelated addedEndpoints survive when the hidden endpoint owned every spec
(tenant scoping shares the helper).
- An addedEndpoints or allowedProviders list that names only hidden endpoints
is kept whole: an empty list allows every endpoint.
- Two endpoints.custom rename hints from one previousName answer
CONFIG_RENAME_INVALID duplicate_source; MCP hints may still duplicate a
server.
* 🔀 fix: Keep Keyed Tombstones Whole Across Dev's Patch Steps, Write Report and Resolved API
- PATCH resets (dev's request-ordered steps) still move a renamed entry's
keyed tombstones, in validation and in the stored state; lifted
tombstones come from one data-schemas helper for both paths.
- The write report of POST /fields/tombstone and DELETE /fields names a
keyed location by its keyed path, collection, key and entryPath, as a
change ref does, instead of the bare collection.
- resolveConfigLayers scopes the model specs and allow-lists of hidden
endpoints as getAppConfig does, so the resolved API keeps its parity.
- GET /meta reports maxEntryKeyLength beside dev's catalogModelsTtlMs.