* 🚪 fix: Refuse Interactive MCP Sign-in on Remote Agent API Runs
A run started through the remote agent API (API key or OIDC bearer) has no
signed-in browser reading its response. When one of the agent's MCP servers
needed OAuth, the run still published LibreChat's sign-in prompt into the
OpenAI-compatible response and waited up to two minutes for a sign-in the
caller could not complete.
The remote auth middleware now marks the response it admits. The prompt
emitters refuse to write to a marked response, and tool loading skips the
turn-start wait when no reader exists. Background Responses keep their
prompts: those go to the generation stream the owner follows in LibreChat.
* 🧭 refactor: Pass the Unattended Fact Explicitly and Release Unattended Callers From Shared Sign-in
Review feedback on the first commit:
- The response registry coupled the auth middleware to MCP through module
state. The remote controllers now supply `unattended` as an argument
(chat completions always; Responses through the runtime's tool context,
foreground only) and it is passed through tool loading to the manager and
the prompt transports. The registry and the middleware side effect are gone.
- A remote run that reached a server while its owner had a sign-in open in a
browser joined that recovery and waited for the person. The manager now
guards an unattended caller at its two entry points: the first sign-in
prompt, from the caller's own flow or from a recovery it waits on, ends that
caller's wait with a typed error and leaves a shared recovery running for
its other waiters. A recovery announces a sign-in request so waiters that
registered no prompt handler are released too.
* 🧪 test: Cover Unattended Sign-in Through the Real MCP SDK
The shared-sign-in tests replaced the production OAuth handler with a
synthetic listener, so they did not exercise the SDK lifecycle whose
cancellation and shared-recovery behaviour the change depends on.
They now run against the real Streamable HTTP test server, the real
connection factory handler and the real flow manager: an unattended tool
call alone, alongside the owner's open sign-in, joining a recovery that
then stops being silent, recovering through a silent refresh, and opening
a connection that needs sign-in. The synthetic-handler versions are removed.
* fix: Advance Slack Account Linking in Place
* fix: Narrow Slack Reply Transport Contract
* fix: Make Slack Link Reply Updates Monotonic
* fix: Clear Invalidated Slack Link Cards After Delayed Writes
* fix: allow members to connect agents to installed Slack workspaces
* fix: clarify Slack destination assignment actions
* fix: align Slack assignment status with destination heading
* fix: explain Slack agent assignments in terms of the connected bot
* fix: separate Slack connection setup, management and confirmation
* fix: name replaced agents only when the member can view them
* perf: avoid redundant Slack assignment identity lookups
* 👤 feat: Link and Revoke Personal Channel Accounts
* fix: Own Channel Link Lifetimes and Complete Channel Entry Points
* fix(channels): activate trusted link URLs with account page
* fix: Preserve Personal Consent for Channel Managers
* test: preserve channel fixture in upstream agent selection cases
* 🧷 fix: Promote Unapplied Steers to Durable Queued Turns at Run End
A steer the server accepted (202) but the run never applied was handed back
in FINAL as `pendingSteers` and re-owned by the browser as a tab-local queued
message. A reload, closed tab, or a predecessor race before the drain lost it.
At terminal publication, a normally completed run now promotes such steers
into server-owned agent queued turns (parent: the ended response, epoch: the
ended generation's createdAt, chained behind any turn already queued against
that epoch). The job store hands the parked copy over atomically
(`promoteSteerLeftover`: parked item removed, receipt settled `recovered`), so
status recovery, lost-ACK retries and legacy recovery starts cannot queue the
same words again. FINAL reports the receipts in `promotedSteers`; the client
adopts them as server rows instead of converting the steer locally.
Promotion is opt-in per steer (`promoteLeftover`, sent only by clients that
adopt receipts and only for steers with no tab-only context), so older
clients keep the legacy path unchanged, and older servers simply never
report `promotedSteers`.
* 🔒 fix: Settle a Promoted Steer's Hand-Off at Admission, Not Only at FINAL
The job-store hand-off of a promoted steer now returns an outcome and stamps
the receipt with the owning queued turn, so it is idempotent for that turn.
The queued-turn resolver repeats it before admitting a promoted turn: it
completes a hand-off a crash interrupted, and cancels the turn when the
parked copy was discarded or recovered elsewhere, so the words never run
twice. At FINAL, a row whose hand-off was refused and whose retirement cannot
be confirmed is withheld from `pendingSteers` and left for that admission
check. The conservative reconcile frame keeps `promotedSteers`, and the
client adopts it there before sweeping local chips.
* 🔏 fix: Give Promoted Steers Durable Ownership, Their Run's Queue Lineage and Approval Mode
A turn promoted from an unapplied steer now records its source on its own
row: the steer's ids, the generation that accepted it, and a mark set only
once the job store handed the parked copy to that row. Admission runs a
promoted turn on that mark or on a hand-off the job store confirms now;
without proof (the store's evidence expired, or the host cannot ask) the
turn is held for review instead of running.
- Hand-off replies that are lost no longer cancel the row. The row stays as
the client's handle and its admission settles ownership, so a committed
hand-off can no longer leave the steer with no runnable copy.
- A replayed promotion never hands the parked copy to a row that was
cancelled or failed.
- Promoted turns join the queue lineage of the generation that accepted
the steer, so a sibling still queued behind that run no longer strands
them with a predecessor mismatch.
- The steer request carries the sender's code approval mode onto the
promoted turn; an unreadable mode keeps the steer on the client path.
- A steer whose quotes its owner stripped stays on the client path.
- The queued-turn receipt names the promoted steer by both ids, and the
receipt list retires a pane's local copies even when it missed FINAL.
* 🚧 fix: Fence Promoted Turns to Workers That Prove Steer Ownership
A promoted row without an approval mode was published under the v1 queued
turn capability, so during a rolling deploy a worker that predates the
ownership check could claim it and run an unsettled row while the parked
steer was still recoverable elsewhere.
Promoted rows now publish under a new agent_queued_turn_v3 capability and a
v3 delivery identity, always reserved before insertion. A replica that
projects an older version can neither publish the reserved delivery nor
claim it, and enqueue refuses a promoted row without a reservation.
* 🪦 fix: Keep a Dead Promoted Turn Answering for Words It Held
A pane that learns of a promoted steer from the receipt list dropped the
mapping for every dead row. A row quarantined as ADMISSION_INDETERMINATE can
still settle as admitted, and a row that died after it was proven the sole
owner of the words is their only surface, so in both cases the pane kept a
chip whose recovery could never run.
The receipt now says whether the turn owned its steer's words, and a dead
receipt keeps answering for them when it did or when its admission is
indeterminate. A replayed promotion applies the same rule to a settled row.
* 🧾 fix: Find Promoted Turns by the Steer a Pane Holds, Join Root Lineages, Redact Hand-off Errors
- A promoted turn's request id is now derived from the client steer id, and a
pane asks for the receipts of the steers it still holds a local copy of
(recovery rows and failed chips). A promoted turn that already ran is only
listed when asked for by name, so a pane that missed FINAL now finds it
and retires its copy. A client steer id too long to key a queued turn is
not promoted.
- The lineage lookup includes a generation admitted from a root queued turn,
which has a parent and no epoch. The promoted turn joins that lineage
without an epoch instead of opening a second one.
- A failed hand-off at admission reports a fixed message. The job store's
own error text stays out of the dead-letter record a client can read, and
promotion logs carry safe error metadata instead of error text.
* 🔢 fix: Ask for Held Steers First Under the Receipt Lookup Limit
The receipt list answers for at most 100 request ids, and a pane's server
rows were listed ahead of the steers it still holds, so a full server queue
could push every held steer out of the request. A promoted turn that had
already run was then never found.
Held steers now come first. An active server row is listed whether or not
it is asked for, while a settled promoted turn is found only by name.
* perf: Validate Agent Models Against Their Own Endpoint Catalog
* perf: Share In-Flight Model List Fetches
* test: Cover Agent Model Validation Across Endpoints
* test: Check Agent Model Catalog Parity With the Real Loaders
* perf: Look Up MCP Server Catalogs Concurrently for Tool Definitions
* test: Cover MCP Sign-In Order for Concurrent Catalog Lookups
* docs: Widen the mcpCatalogLookups Comment in the Example Config
* test: Cover the Catalog Lookup Bound Passed to the Definitions Loader
* fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts
The OpenID reuse path in refreshController and the post-refresh fallback in
getOpenIDAppAuthToken returned the cached access token as the app auth token
whenever its exp was in the future. Entra issues Microsoft Graph access tokens
to sign-in clients by default; their aud names Graph, so the bearer verifier
rejects them and every protected request answers 401 until the client loops.
Both paths now require the access token's aud to name the client id or an
OPENID_AUDIENCE entry, the same audiences the verifier accepts. The reuse path
refreshes with the IdP instead, and the post-refresh fallback keeps opaque
tokens as before. Audience parsing is shared with openIdJwtStrategy.
Related to #17791
* test: Exercise Real OpenID Audience Helpers in AuthService Spec
The AuthService spec stubbed the audience helpers as pass-throughs, so it
could not catch a foreign-audience access token escaping the post-refresh
fallback. Use the real exports and cover Graph-audience, configured-audience
and opaque access tokens through setOpenIDAuthTokens.
* fix: Skip Attachments Deleted by Storage Retention Instead of Failing the Turn
A file that storage retention removed from an earlier message made every
later turn of the conversation fail, because the encoders rethrew the
storage miss and the user has no way to remove an attachment from history.
History replay now passes a handler to the encoders, which leave missing
files out of the request and report them; the message's file context tells
the model which files were deleted and were not read. Current-turn
attachments keep the strict error, since the user can remove and re-upload
them. Code Interpreter priming names files missing from storage in the
tool context and only requires resource recovery for other failures.
* refactor: Keep Code Reupload Failure Policy in packages/api
Tally priming reupload failures in createCodeReuploadFailures so the
decision that a file deleted from storage is named instead of requiring
resource recovery lives in TypeScript, and add mock e2e scenarios for a
follow-up after an attachment is deleted from storage.
* fix: Classify Code Files as Deleted Only at the Storage Read
A 404 from the Code API upload was counted as a source file deleted from
storage, which skipped resource recovery. openCodeFileSource marks a miss
where the stored object is read, and only that error counts as deleted.
Move the history replay of attachments with tolerated misses into
replayMessageAttachments so BaseClient only calls it.
* fix: Name Local Code Files Whose Stream Reports a Missing Object
Local storage returns a read stream that raises ENOENT only once read, so
openCodeFileSource now holds a stream until its first chunk or error and
names a miss there. The missing-files context assignment moves into
setMissingCodeFilesContext so both tool loaders only call it.
* fix: Close a Held Code File Stream When Priming Is Cancelled
openCodeFileSource waits for a source stream's first chunk; when that
wait fails, as on cancellation, the caller never receives the stream, so
destroy it before rethrowing instead of leaking its file descriptor.
* fix: Retire Credentials by Their Committing Write and on Opt-In 2FA
Re-date password reset and enrollment cutoffs once the write that set them commits, so a credential minted while the write is in flight is retired. Opt-in 2FA confirmation now stamps twoFactorEnrolledAt and rotates the session like required enrollment. OpenID refresh ends a session established before a reset or enrollment instead of spending its IdP grant.
* fix: Bind Opt-In 2FA Rotation to the Caller's Refresh Session
Confirmation now requires the refresh session the request was issued with, rotates it in place and revokes only the others, so an access token on its own cannot trade enrollment for a long-lived session. The OpenID retirement check moves into the refresh recovery service and ends the session through the existing session-missing path, leaving the CJS controller unchanged.
* fix: Clear a Retired OpenID Session Against the User It Was Checked For
* refactor: Inject the Refresh Secret Into OpenID Recovery
* fix: Report a Reset Whose Cutoff Could Not Be Re-Dated
A failed re-stamp now propagates as RETIREMENT_RESTAMP_FAILED. The reset controller still revokes sessions and passkeys and answers CREDENTIAL_RETIREMENT_INCOMPLETE; the CLI re-stamps after its revocations and exits non-zero; enrollment revokes sessions before the re-stamp and mints nothing when it fails.
* fix: Re-Date the Reset Cutoff Only After the Link Is Consumed
The web reset re-stamps credentialsChangedAt in the controller once resetPassword has committed, consumed the token and sent the notice, so a failed re-stamp can no longer leave the link replayable. Revocations still run and the response reports CREDENTIAL_RETIREMENT_INCOMPLETE.
* fix: Retire Credentials on Every Exit Path After a Reset Commits
resetPasswordWithToken owns the post-commit steps: deleting the link and sending the notice no longer throw, and a link issued before the account's last credentialsChangedAt is refused, so it is spent even when its deletion fails. The reset write is conditioned on the cutoff it read, so one link commits once. The controller re-dates the cutoff and revokes sessions and passkeys whenever the password changed, and answers CREDENTIAL_RETIREMENT_INCOMPLETE if any of that fails.
* fix: Spend Undated Reset Links and Move the Reset Notice Into TypeScript
* fix: Tell the User When a Reset Could Not Sign Out Every Session
The reset page now recognizes CREDENTIAL_RETIREMENT_INCOMPLETE, shared from librechat-data-provider, and shows a localized warning that the new password is active with a sign-in action, instead of reporting the spent link as invalid.
* perf: Re-Date the Reset Cutoff From the Committed Write
The committed reset hands its credentialsChangedAt back through PasswordResetResult, so the controller re-stamps without a second user read.
* fix: Retire Every Superseded Credential Before Minting on 2FA Enrollment
Opt-in confirmation and setup finalization now revoke sessions, re-date twoFactorEnrolledAt and wait for the auth cache to drop the pre-enrollment document, running every step even when one fails. If any step fails they mint nothing and answer CREDENTIAL_RETIREMENT_INCOMPLETE; the settings dialog keeps 2FA on with a warning and the setup screen sends the user back to sign in with the new factor.
* test: Cover the Settings Warning When 2FA Enrollment Leaves Sessions Behind
* fix: Send the User Back to Sign In After an Incomplete Opt-In Enrollment
Enrollment retires the confirming tab's bearer, and an incomplete retirement mints no replacement, so the settings dialog now shows the backup codes and then signs out to the login page, whether the user completes setup or closes the dialog.
* test: Run the Retirement Warning Scenarios Against Their Own Signed-Out or Fresh Accounts
* test: Open the Sidebar Drawer Before the Account Menu on Phones
* fix: Report a Committed Opt-In Enrollment When Rotating the Session Fails
Once 2FA is promoted, a later failure in confirm2FA withdraws whatever session it may have minted and answers CREDENTIAL_RETIREMENT_INCOMPLETE, so the settings dialog hands over the backup codes and signs the user in again instead of reporting an invalid code.
* test: Prove an Incomplete Reset Does Not Resume the Retired Session
The Sign in action sends a browser with a live session through /login for about 150 ms before it lands in chat, so the signed-in version of the warning scenario only passed when the URL check caught that window. The warning scenario runs signed out, and a new scenario holds a pre-reset session and asserts its refresh is refused and the user stays on the login page.
* fix: Settle the Auth Cache After the CLI Reset's Final Cutoff Write
* test: Require the Login Form After Signing In From a Signed-Out Reset
* fix: Explain an Incomplete Session Retirement Before Restarting Sign-In After Required 2FA Setup
* perf: Start the Opt-In Enrollment User and Session Reads Together
* 🔎 fix: Keep Scoped Package Frames Out of the Log Email Redactor
The log redactor read node_modules/@scope/pkg/... as an address and replaced
whole stack frame locations with [REDACTED_EMAIL], in file, console and
OpenTelemetry output alike. An @ between path separators now names a scoped
package; addresses beside such frames are still masked.
* 🪪 feat: Name the Build and Loaded Config on OpenTelemetry Records
service.version now defaults to the image's BUILD_COMMIT ahead of the npm
package version. Each successful librechat.yaml load records a short digest
of the parsed file, which exported log records and request spans carry as
librechat.config.digest, and applies telemetry.stackTraceLimit to
Error.stackTraceLimit; unset keeps the process default.
* fix: Publish telemetry settings with the accepted base config
* fix: Initialize process settings before adopting cached config
* fix: Preserve runtime settings when cache writes are refused
* fix: Keep telemetry identity local and propagate Redis write errors
* fix: Partition merged config caches by the local base
* fix: Keep config cache failures recoverable
* test: Verify cache recovery contracts with typed fixtures
---------
Co-authored-by: Lia <lia@librechat.ai>
* 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
* 🚤 fix: Keep Host Tool Loading Independent of Worker Status
* fix: Classify Workspace Tools at the Agent Boundary
---------
Co-authored-by: Lia <lia@librechat.ai>
* 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
* 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
* 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
* 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
* 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
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>
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: 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.