* 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 the Snapshot When the Terminal Write Settled for Reconciliation
* fix: Promote a Reconciled Compaction Snapshot to the Terminal Row
* fix: Anchor and Envelope the Reconciled Snapshot by Its Claim
* test: Cover the Abandoned Compaction Settling After Its Run in E2E
* fix: Withhold the Disconnect Snapshot of Any Durably Settled Turn
* fix: Promote Only a Same-Epoch Reconciled Snapshot and Settle Stopped Compactions
* fix: Plan the Disconnect Snapshot in packages/api and Check the Response Row Before Promoting
* fix: Read the Disconnect Snapshot Rows in the Response Conversation
* fix: Check the Anchor-Derived Error Row Before Promoting a Reconciled Snapshot
* fix: Log a Failed Disconnect Snapshot Plan Instead of Rejecting the Listener
* fix: Let a Reconciled Compaction Promote After an Earlier Live Snapshot
* refactor: Decide the Repeat Disconnect Write in the Snapshot Plan
* refactor: Report Failed Snapshot Row Reads Through the Plan
* fix: Stamp a Promoted Disconnect Snapshot and Read Its Rows Together
* fix: Derive the Compaction Error Row ID Through the Shared Helper
* fix: Plan a Saved Live Compaction Snapshot Again Once Its Turn Settles
* refactor: Queue Disconnect Snapshots and Settle Them in packages/api
* fix: Never Count the Compaction Anchor as Its Own Terminal Row
* fix: Settle Disconnect Snapshots Before Terminal Cleanup Releases the Turn
* 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
* fix(agents): skip the empty-memory notice for agents that cannot use memory
Since #16301 formatMemoryContext('') returns the bare memory instructions sentence, and
prepareRuntimeAgent applied it to the primary agent whenever the user had no saved memories.
An agent with no memory tools and no automatic memory extraction can neither read nor write
memory, so the sentence told the model nothing it could act on, yet it reached the model as
per-turn context. The empty-store notice is now added only when the agent has memory tools or
automatic extraction is on. Saved memories are still injected as before.
* fix(agents): distinguish relocated context from user input
* fix(agents): narrow runtime context types
---------
Co-authored-by: shars <32410570+Shabonasar@users.noreply.github.com>
Co-authored-by: Lia <lia@librechat.ai>
* 🔭 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`.
* 🔐 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.
* 🏷️ 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.
* 🙈 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.
* 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
* perf: Index Hot Lookups and Project the Remote Models List
checkBan reads the KeyvMongo logs collection by key on every request when
bans are enabled, BYOK requests read Key by user and name, and agent tool
loading reads Action by agent_id or assistant_id. None of those fields had
an index, so each read scanned its collection. The Key and Action schemas
gain indexes, and the KeyvMongo store builds a key index on first use
unless the deployment disables auto indexing.
The remote /v1/models routes loaded whole agent documents, including the
unbounded versions history, to read six fields. getAgentModelSummaries
loads only those fields.
* test: Authenticate the Models List Scenarios With an Agent API Key
* fix: Keep API Keys and Internal Errors Out of Logs and Responses
The log redaction patterns did not cover the appid query parameter, so a
failed Wolfram request logged its AppID with the axios request URL. appid
now joins the redacted token and query names.
OpenWeather returned a fetch error's message to the model verbatim, and
node-fetch puts the full request URL, appid included, in that message. The
tool now passes it through redactMessage, as ToolService does.
The public startup config route and the unauthenticated password reset
route sent raw error text on unexpected failures. Both now answer with a
fixed message and keep the detail in the server log.
* refactor: Format Tool Error Text in packages/api
* fix: Redact appid Metadata Keys in Structured Logs
* 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.
* 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
* fix: Price 1-Hour Prompt Cache Writes at the 1-Hour Rate
* test: Cover 1-Hour Cache Write Pricing End to End
* test: Price Cache Scenario on the Configured Mock Model
* fix: Accept a 1-Hour Cache Write Rate in Endpoint Token Configs
* fix: Keep Temporary Chats Out of Langfuse
* fix: Gate Forced-Ephemeral and Open Responses Turns From Langfuse
* fix: Treat Legacy and Chat Completion Temporary Turns as Untraced
---------
Co-authored-by: Joel Hirzel <joel.hirzel@eps.ch>
* 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
* fix: release OpenID delivery lease when the client disconnected before delivery
A refresh whose client disconnects before the response is sent claims the
delivery lease and then arms finish/close listeners on a response that has
already closed. Neither event fires again, so the lease is never released and
every later refresh for the same generation polls until the 30-second lease
expires.
Arm the listeners only while the response is open; otherwise release the lease
directly after the send.
* fix: defer the silent refresh until a prerendered page is shown
A prerendered page runs the startup silent refresh before the user sees it.
When the browser discards the prerender, the refresh is aborted mid-flight
after the server has already rotated the refresh token, and the page the user
actually opens has to recover from a session it never received.
Wait for prerenderingchange before refreshing so a prerender has no effect on
the session.
* refactor: move OpenID response delivery into packages/api
* 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
* fix: Remove Group Dependents Before Deleting the Group
* feat: Audit Code Worker Pairing and Langfuse Connection Changes
* feat: Audit Skill Sync Credential Changes
* feat: Audit Passkey Enrolment and Removal
* feat: Audit Audit Log Reads and CSV Exports
* feat: Audit Audit Log Retention Purges
* feat: Audit MCP Server Create, Update and Delete
* fix: Keep Purge Result When the Purge Audit Write Fails
* test: Cover Admin Integration Audit Scenarios
* fix: Tighten Admin Integration Audit Scope and Group Cleanup Order
* fix: Run Security Fences Before Awaiting Audit Writes
* fix: Move MCP Post-Commit Audit Ordering Into the Auditor and Audit Verify Reads
* fix: Fail Closed When Recording Audit Log Access
* fix: Audit Group Deletion Before the Cascade and Restore Dependents on Failure
* fix: Restore Only Config Overrides When Group Deletion Fails
* fix: Audit Worker Pairing and Export Before the Work and Append Failures
* fix: Record Group Deletion as Pending Without Delaying Revocation
* fix: Skip Config Restore When a Concurrent Delete Removed the Group
* fix: Restore Group Config When the Existence Recheck Fails
* fix: Keep Group Config Restricted When Delete State Is Unknown
* fix: Record Worker Pairing and Revocation as Pending Until Confirmed
* fix: Deliver the Pairing Code Before the Terminal Audit Write
* test: Assert Pairing Code Delivery Precedes the Terminal Audit Write
* fix: Send Revocation and Group Deletion Responses Before the Terminal Audit Write
* fix: Snapshot Group Config Before the Destructive Cascade Step
* refactor: Type the Group Config Snapshot Dependency Without Mongoose Shapes
* fix: Fence Shared MCP Users Before the Deletion Audit and Correlate Audit Attempts
* fix: Diff MCP Server Audits Against the Committed Config
* fix: Read the Committed MCP Config at Commit Time for the Audit Diff
* refactor: Start the Committed MCP Config Read Inside the Auditor
* fix: Audit Langfuse Patches When Activation Fails and Surface Failed Group Config Restores
* fix: Record Member Removals When Group Deletion Completes After a Failed Restore
* test: Serve the Committed Config on the MCP Update Audit Reread
* fix: Audit the Group Returned by the Compensating Deletion
* fix: Keep Member Removal Audits Fail-Open During Group Deletion
* fix: Retry ACL Cleanup After a Compensating Group Deletion
* fix: Mark Unavailable Audit Detail and Order Member Removals After the Pending Deletion
* fix: Guard Synchronous Committed-Config Read Failures in the MCP Auditor
* fix: Return the Persisted MCP Config and Audit Commits That Outlive Cache Invalidation
* style: Sort Imports in MCP Audit Files
* style: Sort Imports After Restack
* fix: Audit MCP Commits That Outlive Any Post-Write Step and Pend Audit Exports Until Complete
* test: Provide the Fail-Closed Setting in the Code Route Mock
* fix: Refresh MCP Read Caches When a Repository Step Fails After the Write
* fix: Finish Audit Exports on Response Completion and Keep Error Details Out of Messages and Logs
* fix: Watch Response Completion Before the Truncation Footer Write
* fix: Skip Audit for No-op MCP Deletes and Close Remaining Post-Failure Audit Gaps
* fix: Keep Causes Out of Structured Logs and Treat a Lost Compensating Delete as Not Found
* fix: Mark Failed MCP Post-Commit Steps and Null Langfuse Activation in Audits
* 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
* fix: Run the Erasure Cascade in Admin User Deletion
* refactor: Share Generation Stop Logic Between Self-Service and Admin Deletion
* refactor: Move Admin Erasure Dependency Assembly Into packages/api
* fix: Bind getCleanupJob When Waiting for Generation Persistence
* test: Pin the Deletion Fence Before Admin Generation Stop
* fix: Resolve the Erasure Target Config Fail Closed
* fix: Carry the Target Profile Into Admin Erasure Storage Cleanup
* fix: Keep the Erasure Target Contract Storage Neutral and Reuse the Loaded Identity
* fix: Refuse New Generations Once Account Deletion Has Begun
* fix: Enforce Account Deletion Admission Once in createJob and Narrow the Erasure File Type
* fix: Install the Admission Guard in Every Entrypoint and Purge Refused Jobs
* fix: Guarantee Refused Job Purge and Sanitize Admission Failures
* fix: Route Remote Admission Through createJob and Keep Refusal Cleanup Sanitized
* fix: Log Admission Cleanup Failures With Safe Error Metadata
* refactor: Check Account Deletion Before Creating a Generation and Drain Twice
* refactor: Order Admission Against the Deletion Marker Without a Grace Period
* fix: Sanitize Post-Commit Admission Retirement Failures
* fix: Wire Shared-Server MCP OAuth Cleanup Into Admin Erasure
* fix: Scope Admin Erasure Lookups to the Target Tenant and Await Shared-Link Cleanup
* fix: Resolve the Erasure Target Config Under the Target Tenant
* fix: Run Admin Erasure OAuth Fencing in the Target Tenant
* fix: Match the Split OAuth Invalidate and Disconnect Hooks in Admin Erasure
* refactor: Inject the Tenant Executor Into the Erasure Resolver
* fix: Route Delete-User CLI Through the Shared Account Erasure Cascade
The operator CLI ran raw deleteMany calls that dropped File metadata while leaving storage objects, skipped skills, MCP servers and agent checkpoints, and used the wrong field for agent API keys. Account self-deletion and the CLI now share eraseUserData in packages/api, so both remove stored file objects before metadata, open checkpoint deletion around conversations, and clear skills, MCP servers and shared links with ACL cleanup.
* fix: Erase Favorites, Projects, Queued Turns and Refresh Bridges With the Account
Account erasure left tool favorites, chat projects, queued agent turns and their sequences, and OpenID refresh token bridges behind. The shared eraseUserData cascade now clears them, adding deleteUserToolFavorites and deleteUserChatProjects where no delete-by-user method existed.
* fix: Move MCP Server Erasure Queries Into Data Methods and Propagate Their Failures
* test: Cover Delete-User CLI and Self-Service Erasure Scenarios
* fix: Delete Stored Files When Account Deletion Arrives Without a Body
* fix: Delete Stored Files Before User Keys and Keep Provider Failures Best Effort
* fix: Propagate Agent and Prompt Erasure Failures Before Deleting the User
* fix: Delete Erasure Retry Anchors Last When Removing User-Owned Resources
* fix: Retire Session Hint From the Shared Erasure Cascade After Sessions Are Revoked
* fix: Propagate Skill and Agent Reference Cleanup Failures Before Deleting the User
* fix: Scope CLI Account Erasure to the Deleted User's Tenant and Legacy Refresh Bridges
* fix: Clean Shared-User MCP OAuth State When Account Erasure Removes a Server
* fix: Keep CLI Erasure System-Scoped Except ID-Keyed Cleanup and Await Shared-Link ACL Cleanup
* fix: Scope CLI MCP OAuth Lookups to the Tenant and Fail Erasure When Shared-User Cleanup Fails
* fix: Run CLI MCP OAuth Teardown and Allowlist Resolution Per User in the Tenant
* fix: Tear Down Shared-User MCP OAuth State Before Removing the Server Retry Anchors
* fix: Pin Agent Reference and MCP Token Cleanup to the Deleted User's Own Tenant
* 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
* fix: Log User IDs Instead of Emails in Admin Panel Auth Flow
* fix: Sort Imports in Admin Middleware Spec
* test: Cover Admin Exchange and Access Denial in Mock Scenarios
* test: Remove the Generated User After the Admin Denial Scenario
* 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
* 🧯 feat: Recover Conversations Whose Attachments Keep Failing
Once a branch carries a problem attachment, every turn resends it and
fails the same way. A failed response whose branch carries files now
offers "Retry without files" (re-asks the failed turn with no files as a
new version) and, when earlier turns carry files, "Branch without files"
(a copy up to the last good answer with every upload and code output
left out, with the failed message restored to the composer). File-shaped
errors say so in the card.
The edit view shows a user message's files as removable chips; "Update &
rerun" sends only the kept files and Save is disabled after a removal.
Fork is offered on a failed turn and gains a "Leave out files" option,
backed by a new `excludeFiles` fork option that drops `files`,
`attachments` and the conversation's `files` from the copy.
Bedrock rejects a request whose documents share a name, and history
resends every earlier document, so repeated names are now numbered
before formatting.
* 🧯 fix: Cover Steered Files, Hand Off the Whole Failed Turn, Name Replayed Documents Once
- Excluding files from a fork also strips attachments steered into a
response (`content[].files` on steer parts), which replay like uploads,
and the decision lives in `forkFileScope` in packages/api.
- The recovery card counts steered attachments as files, and reads the
specific code inside a generic `error` envelope, so a rate limit is not
offered files as the fix.
- "Branch without files" hands the failed turn to the copy's composer the
way a message is put back for editing: text through the in-memory
handoff, quotes, manual skills and the reasoning override through their
compose-time atoms.
- Document names are deduplicated over the formatted payload after the
steer stamp, so replayed steer documents are numbered too.
- Fork stays withheld on a failed response, whose copy would carry the
error as an ordinary answer; the card's branch action copies up to the
turn before.
- Remove-file buttons are natively disabled while the editor is locked.
* 🧯 fix: Keep Search Sources, Scope Root Retries, Skip Legacy Rate Limits
- A fork without files keeps metadata-only attachments (search sources,
file search results) and drops only file-backed ones; the recovery card
likewise counts only file-backed attachments as files.
- A turn sent at the root takes none of the conversation's file refs: its
siblings' uploads (an edited first message, or one retried without its
files) no longer come back through the unanchored-continuation fallback.
- Rows that carry a legacy LangChain model, key or rate-limit code are not
offered files as the fix.
* 🧯 fix: Align File Exclusion With Replay's File Shapes, Skip Assistants, Verify the Copy
- Shared `messageCarriesFiles` (with `isFileContentPart`,
`hasContentPartFiles`, `isFileAttachment`) in data-provider names every
shape historical replay reads a file by: uploads, file-backed
attachments, attached `files` on any content part, and `image_file`,
`file` or direct `file_id` locators. The fork drops all of them and the
recovery card detects all of them.
- Assistants conversations get no recovery actions: their upstream thread
keeps every attachment, and those endpoints offer no fork either.
- "Branch without files" checks the returned copy; a server that ignored
`excludeFiles` gets an error toast instead of a false recovery.
* 🧯 fix: Type Replay's Provider-Native File Locators for the Part Predicates
* 📴 fix: Stamp Legacy Failure Parts When Settling a Compaction Row
* 📴 fix: Redirect the Collision Error Row to the Live Response Id
* 📴 fix: Withhold the Anchor-Colliding Error Row and Keep Pending Rows Fallbacks
* 📴 fix: Scope the Settled-Job Guard to Compactions and Copy Stamped Parts
* test: Cover the Underscore-Leaf Compaction Failure and Abandoned Replies in E2E
* test: Fail the Underscore-Leaf Compaction Through the Blank Summarizer
* refactor: Return the Final Error Row Id From the Settlement
* feat: Filter OpenRouter Reasoning Efforts by the Selected Model
* fix: Address Review Findings on OpenRouter Per-Model Reasoning Efforts
* fix: Report Catalog Failures, Share Lookups and Honor Direct Endpoints for Reasoning Efforts
* fix: Move Capabilities Handler Into packages/api and Harden Catalog Lookups
* fix: Scope Reasoning Capabilities to One Endpoint and Gate Editors Until They Load
* fix: Skip Catalog Reads for Explicit Definitions and Keep Staged Efforts While Loading
* fix: Retry the Reasoning Capabilities Query on Focus and Reconnect After a Failure
* fix: Remember Failed Catalog Lookups, Reject Locked Overrides Early and Keep Restored Efforts
* fix: Hide Efforts Until the Catalog Is Known, Keep Unlisted Models Unknown and Accept Auto
* fix: Mark OpenRouter Endpoints by Their Resolved Host so the Client Fetches Capabilities
* fix: Share One OpenRouter Catalog Rule, Build the Catalog URL Safely and Make the Lifetime Configurable
* fix: Forward Static Catalog Headers, Resolve Relative Next Links and Align Client Freshness
* fix: Limit Capabilities to Exposed Models and Revalidate Against the Server Entry Expiry
* fix: Hide Efforts After a Failed Refresh, Reject Malformed Pagination and Skip User-Scoped Catalogs
* fix: Use Own-Property Lookups, Skip the Catalog for Auto and Revalidate From the Remaining Lifetime
* fix: Treat Request Metadata Headers as Shared, Store Catalogs as Own Entries and Hide Efforts During Refresh
* fix: Keep Configured Query Parameters Across Catalog Pages and Treat Expired Idle Data as Unknown
* fix: Expose Only Configured Variants, Skip Identity Headers on Fixed Lists and Keep Staged Efforts
* 🏝️ fix: Apply the No-Workspace Decision Wherever an Agent's Code Route Resolves
A conversation set to run without attached workspaces failed mid-turn with
"Choose an attached workspace before using this agent." when its agent's
default machine was attached and the turn loaded a skill or another tool at
execution time. Request-start initialization honoured the decision, but the
execution-time tool loader re-resolved the agent's attached default and then
demanded a workspace selection the conversation intentionally never made.
The per-agent code rule now lives in one typed function,
resolveAgentCodeExecution (packages/api/src/code/agent.ts): it applies the
conversation's no-workspace opt-out, the run-code grant, the stateful
capability and the stateful environment policy, then resolves the base route.
Request-start initialization, lazy subagent metadata and graph members, the
execution-time and definition tool loaders, and the legacy execute_code
loader all go through it, so an opted-out agent lands on the managed default
route with no code tools at every site. Per-call subagent machine choices
offer and accept no attached machine in such a conversation, and a source
invariant test keeps new resolver call sites on the shared rule.
* fix: Pass the Implicit Stateful Route Rollout Into the Shared Code Rule
The per-agent code rule read the implicit stateful route rollout from the environment itself. It now takes it as a parameter, and the request boundaries (initializeAgent and withRequestCodeInputs) resolve it from the deployment configuration, so the rule stays a pure function of its inputs.
* fix: Carry the Initializer's Code Opt-Out Into Tool Definition Loading
initializeAgent hands the tool loaders a partial agent record (id, tools, provider, model) together with the code route it already resolved. Without the agent's route fields the definition loaders could not see a no-workspace opt-out and recomputed code execution as enabled, so tool classification could advertise the programmatic bash tool that execution then refuses. initializeAgent now passes attachedEnvironmentOptOut through every tool loader, and the shared rule keeps an opt-out its caller already decided.
* 📴 fix: Finalize Compaction Snapshots and Move Abort Policy Into packages/api
* 🔕 fix: Inspect Every Part When Finalizing and Reuse the Loaded Row
* 📴 fix: Settle Finalized Compaction Rows and Verify Their Anchor
* 📴 fix: Withhold the Unanchored Abort Final and Settle Marked Snapshots
* 📴 fix: Consolidate the Compaction Abort Policy Into One Injected Operation
* 📴 fix: Settle the Live Compaction Row Past an Anchor-Shaped Collision
* 📴 fix: Lift the Failed-Turn Settlement Into the Compaction Module
* 📴 fix: Keep a Removed Round's Failure and Guard Settled Jobs From Snapshots
* ⚡ perf: Read Only the Anchor Id in the Abort Existence Check
* 📴 fix: Withhold the Abort Final Only When a Row Needed Writing
* test: Cover Stopped Compaction Finalization and the Missing Anchor in E2E
* fix: Withhold a Stopped Compaction That Carries No Anchor Id
* fix: Settle Stopped Compactions, Announce Finalized Rows, and Own the Abort Read in packages/api
* test: Accept the Model Spec Query on the Stopped Reply Conversation URL
* fix: Report the Anchor Read Failure Beside a Withheld Compaction Abort
* fix: Synthesize a Compaction Failure Only for a Round After the Latest Outcome
* fix: Skip the Anchor Read When a Stopped Turn Writes No Row
* fix: Decide the Disconnect Snapshot Gate in packages/api
The last-subscriber partial save now asks resolveDisconnectSnapshotMode for
the settled-job decision instead of branching on the job record in the CJS
controller.
* fix: Leave an Already Settled Compaction Row to the Path That Settled It
* 📴 fix: Persist Cancelled Compactions With Their Identity
* 🧪 test: Build the Cancelled-Compaction Leaf on a Real Conversation
* 🧪 test: Assert the Withheld Controls on the Live Cancelled Compaction
* 📴 fix: Keep Live Disconnect Compaction Rows Free of a Synthesized Failure
* 🧪 test: Cover the Compaction Flag in the Redis Job Round Trip
* 📴 fix: Keep a Stopped Compaction Honest and Its Anchor Untouched
* 🏝️ fix: Let a No-Workspace Turn Carry a Remembered Approval Mode
A conversation set to run without attached workspaces failed every turn with
"The selected code approval mode is not permitted by the current policy" when
the reader had picked Accept edits or Full access for a workspace earlier.
With no attached target, the server validated the requested mode against an
empty policy that only allows ask. A turn with no attached target now accepts
any known mode, resolves it to ask for the run, and keeps the conversation's
stored mode instead of overwriting or unsetting it. Unknown values are still
rejected, and any attached target, including a subagent's, keeps the strict
check.
The composer treated an explicit no-workspace chat as still running on the
agent's default machine, so it kept offering and submitting the remembered
mode. It now offers no attached mode there, and the submit path sends ask
whenever the turn resolves to run without a workspace.
* fix: Leave an Unset Approval Mode Unset on a No-Workspace Turn
A turn without an attached target seeded the conversation's approval mode
from the request when the row stored none. A current client sends the gated
ask there, so the first no-workspace turn of a new chat wrote ask and
replaced the remembered pick the composer would otherwise keep offering.
Such a turn now only carries forward a mode the conversation already stores;
a stored mode still comes only from a turn that validated it against its
attached targets.
* fix: Gate the Approval Menu on the Resolved Workspace Mode and the Saved Conversation
The composer hid attached approval modes only for a chat that recorded a
no-workspace decision, while useCodeWorkspace also resolves one for a saved
chat with no recorded decision and for a draft still choosing. The approval
menu, the queued-turn snapshot, and the submit path now read the mode the
composer resolved, so the control matches what the turn sends.
A no-workspace turn kept the mode of the row admission loaded, but a turn
sent with overrideConvoId is saved under another conversation; the stored
mode is now read only when that row is the conversation being saved.
* fix: Preserve the Saved Conversation's Approval Mode Through a No-Workspace Turn
A no-workspace turn chose what to record from the row admission loaded, but
a turn sent with overrideConvoId is saved under another conversation while
its unsets are still computed from that loaded row, so either the source
row's mode was copied onto the target or the target's own mode was unset.
Such a turn now records no mode and declares codeApprovalMode preserved:
the conversation write skips it when computing unsets, so the stored mode of
whichever conversation the turn is saved under stays as it is, and a chat
that stores none keeps offering the remembered pick. Turns with attached
targets record exactly the mode they validated, as before.
* 🧭 feat: Let a Parent Choose Its Subagent's Code Machine Per Call
A parent agent can now pass optional `machine` / `workspace` arguments on a
subagent call to pick where the child runs, using the host-argument
extension point added to @librechat/agents.
- Each lazy child declares enums built only from machines it may reach:
admitted in the conversation's sealed codeWorkspaces, on its default or
allowlist, in the requesting principal's tenant-scoped list, and served by
a ready worker. A child the conversation pinned to a machine offers only
that machine; a child with no reachable machine declares nothing.
- On use, a request-scoped routing session in packages/api re-validates the
choice against the current request and live worker status and refuses an
invalid one with a typed, model-visible error instead of falling back. A
routed child is pinned to the chosen machine at every routing site,
overriding parent inheritance.
- Omitted arguments keep inherit-by-default routing, extended so a child
follows the machine a per-call-routed parent runs on (passing through
agents without code). A subagent keeps one machine for the whole request.
- A child whose default workspace is unavailable stays guarded unless it has
per-call choices; then it stays callable and its description asks the
parent to pick a listed machine.
- Routed children keep their tool context per execution for tool loading,
provisioning and artifact handling.
- Paused-approval bindings, the attached-machine policy hook, skill-file
priming and tool-output references account for per-call choices.
The declarations are gated on the installed SDK exporting
SubagentHostArgumentError, so this change is inert until LibreChat depends on
an @librechat/agents release that includes it.
* 🧭 fix: Reserve Default Routes Early and Route a Routed Subagent's Graph Members
- Reserve a subagent's default machine when it is placed, as
initializeAgent will resolve it (including parent inheritance), so a
concurrent call cannot claim another machine during initialization.
- Graph members spawned by a per-call-routed subagent follow its machine
when they may, unless they already initialized on their own route this
request.
* 🧭 fix: Settle Concurrent Inherited Routes and Register Routed Graph Members
- Re-read a subagent's inherited route after resolving targets, so two
concurrent calls from differently routed parents settle on one machine.
- Attribute a workspace-only conflict to the workspace argument.
- Register graph members a routed subagent initialized, so each gets the
attached-machine policy of the machine it actually runs on.
* 🧭 fix: Re-read Inherited Routes After Resolving Subagent Targets
- Re-read a subagent's inherited route after the target resolution await,
so two concurrent omitted-machine calls from differently routed parents
settle on one machine.
- Attribute a workspace-only conflict to the workspace argument.
* 🧪 test: Prove a Routed Graph Member Takes Its Machine's Policy Through createRun
- Register a resolved child's graph members inline in the lazy resolver
instead of through an exported generic helper whose test did not
typecheck.
- Drive the check through createRun's real PreToolUse hook: a member
routed to a deny machine flips from its metadata machine's allow to deny
once its parent resolves.
* 🧭 fix: Hold a Lazily Loaded Graph Member's Default Machine While It Initializes
- Pass a graph member's code flags when it initializes on its default
route, so the routing session reserves that machine before the
asynchronous initialization instead of only after it, and a concurrent
call cannot place the same agent on another machine meanwhile.
* 🧭 fix: Validate the Approval Mode Against Every Machine a Subagent May Use
- Collect each agent's default attached route and each attached machine a
parent may route it to per call, and validate the requested approval
mode against that set in createRun and both client checks.
- A child whose default is unavailable but whose per-call machine permits
accept edits no longer fails run creation; full access still requires
every such machine to permit it.
* 🧭 fix: Admit, Prime, and Cancel Per-Call Subagent Routes Conservatively
- Build scheduled pause admission from every attached machine a parent
may route an agent to, so a permissive default does not hide a
per-call machine that asks.
- Walk lazy graph-member metadata when collecting execution routes, so
historical skill files are primed for every machine such a member may
run on.
- Stop placing a canceled call after its target resolution resolves, so
it never claims a machine for an execution that will not initialize.
* 🧭 fix: Release Unused Route Claims and Scope Per-Call Machines to Their Run
- Hold a subagent's route claim per placement: a failed or canceled
initialization gives the machine back unless another execution still
holds it, and a claim is permanent once a child on it attaches.
- Fold an agent's default route into its per-call choice digest, so each
agent contributes at most one paused-approval binding target.
- Use only an agent's route policies for pause admission when it has
them, so a missing default does not make a decided route look asking.
- Drop a routable child's provisional attached-machine membership when it
resolves off attached machines.
- Offer and accept no attached machine per call while run files are
shared, since shared children must run on managed code.
* 🧭 fix: Give Back a Route When Its Placement Verification Fails
- Release a placement's hold when attach finds the child initialized on a
different machine than the one it was routed to, so a retry that
follows the unavailable-machine guidance may name another machine.
* 🧭 fix: Commit a Lazy Child's Routes Only When Its Whole Resolution Succeeds
- Keep the routes a lazy child and its routed graph members hold pending
through the child's entire resolution (settleExecution), committing them
on success and giving them back on failure or cancellation unless
another execution still holds them.
- Placements outside any call (shared graph members) still commit when
they attach.
* 🧭 fix: Drop a Failed Lazy Resolution's Config from the Graph Cache
- When a lazy child's graph resolution fails or is canceled after its
config was cached for graph reuse, remove that entry with its route, so
a later graph never reuses a config for a machine the child gave back.
* 🧭 fix: Follow a Routed Agent Through Self-Spawned Runs and Scope Routed Member Configs
- A call whose parent run was never placed (an allowSelf spawn reuses its
routed inputs) inherits the routed claim of its parent agent, which keeps
one machine per request.
- Never share a graph member initialized for a routed parent's execution
through the graph-member cache, so a failed resolution leaves no config
behind for a route it gave back.
- Race lazy target discovery with the request signal.
* 🧭 fix: Pass a Machine On Through Self-Spawned Runs of Agents Without Code
- Record the machine each agent without stateful code passes on, and let a
call from that agent's unplaced run (an allowSelf spawn) follow it when
the agent passed on exactly one machine this request.
* 🧭 fix: Keep a Pass-Through Route Only When Its Resolution Succeeds
- Record the machine an agent without code passes on with the rest of its
call's routing state: kept when the resolution deciding it succeeds,
dropped when it fails, so a self-spawn never follows a failed attempt.
* 🧭 fix: Settle a Lazy Child's Routing State at the SDK Handoff
- Wrap the run's whole lazy resolution, through the inputs handed to the
SDK, in the descriptor's settle hook, so a cancel after the host
resolver returns still gives the call's routes back.
- Roll back the per-agent tool context a pending placement set (restoring
the entry it replaced) when its resolution fails, so a retry on another
machine seeds its own context.
- Drop a failed call's shared config from the graph cache through the
same settle hook.
* 🧭 fix: Keep Per-Agent Tool Contexts on Live Placements and Queue Target Probes
- Track every pending placement that uses an agent's per-agent tool
context: a committed one sets it, a failed one hands it to a surviving
placement, and only the last failure restores the earlier entry.
- Let an unplaced run of an agent (an allowSelf spawn) defer to the routed
run of the same agent that encloses it when looking up tool contexts.
- Queue live target probes at eight in flight, below the shared status
poller's ceiling, so concurrent descriptors never misreport a healthy
machine as unavailable.
* 🧭 refactor: Load Routed Graph Members Through a packages/api Service
- Move the routed graph-member load (shared reuse, skip list, view check,
execution identity, failure policy) into createRoutedGraphMemberLoader;
the initializer only injects its dependencies.
- Thread the request and call signals into target resolution so queued
probes are skipped once canceled.
- Probe nothing in shared-file runs, where every per-call target is
attached and unusable.
- Retire pending tool-context ownership when a committed placement
installs the per-agent entry.
* 🧭 fix: Share a Lazy Child's Config with Later Graphs Only After It Commits
- Publish a default-placed lazy child's config to the shared graph cache
from the settle hook's commit, so no concurrent graph can borrow a config
whose route may still be given back.
- Resolve a child's own appearance in its graph to the child config itself.