Commit graph

794 commits

Author SHA1 Message Date
Dustin Healy
8596615d1d
🌐 feat: Wire Responses and Channel Lifecycle APIs (#17611)
* 🌐 feat: Wire Responses and Channel Lifecycle APIs

* fix: Align Channel Application Policy and Source Authority

* fix: Preserve Configured App Budgets in Canonical Response Commits

* Expose Fenced Channel Receipt Reconciliation Routes

* fix: Keep Ordinary Chat Capture In Its Existing Owner

* fix(channels): scope worker authority and defer browser activation

* fix(responses): gate admission on canonical queue readiness

* fix: Recover Durable Response Dispatch Across Queue Shutdown

* fix: Preserve Upstream Endpoint Config Insertions

* test: Align Channel Runtime Configuration Contract
2026-11-10 21:04:03 -08:00
Dustin Healy
a1ac175544
💾 feat: Persist and Continue Stored Agent Responses (#17605)
* 💾 feat: Persist and Continue Stored Agent Responses

* fix: unify response persistence and terminal ownership

* fix: Commit Canonical Responses With Conversation History

* test: Keep Interrupted Erasure Payloads Private

* fix: Fence Canonical Response Materialization During Rolling Upgrades
2026-11-10 21:04:01 -08:00
Dustin Healy
8552368176
🔄 fix: Restore MCP Sign-In Prompts After Reload (#17604)
* 🔄 fix: Restore MCP Sign-In Prompts After Reload

* wip: Separate OAuth Presentation and Publication Lifecycles

* wip: Verify OAuth Publication and Presentation Ownership

* fix: Fence OAuth Publication and Preserve Tool Outcomes

* fix: fence first-turn OAuth recovery by durable identity and retention

* test: Cover Canonical OAuth Recovery Replay in Manager

* fix: Unify Startup OAuth Prompt Lifecycle Ownership
2026-11-10 21:04:00 -08:00
Dustin Healy
7e51963f2b
📊 feat: Preserve Response Accounting and History (#17599)
* 📊 feat: Preserve Response Accounting and History

* fix: preserve accounting completeness and invocation provenance

* fix: retain invocation receipts across repeated contextualization

* feat: Own Foreground Response History and Terminal Publication

* fix: Retain Complete Submitted Response History

* test: Exercise Artifact and Response Completion Together

* chore: Validate Foreground Types and Lint

* style: Use Narrowed Canonical Outcome

* fix: Own Foreground Completion Through Tracked Persistence

* refactor: Keep Foreground Request Contract Storage Independent
2026-11-10 21:03:58 -08:00
Dustin Healy
9d14eb5b35
🛡️ fix: Retain Execution Ownership Until Terminal Persistence (#17598)
* 🛡️ fix: Retain Execution Ownership Until Terminal Persistence

* wip: separate execution attempt and persistence authorities

* test: prove execution ownership and persistence boundaries

* refactor: settle execution before returning its captured outcome

* test: verify signed channel execution at controller ingress

* fix: Unify Source Ingress and Execution Settlement Contracts

* test: Preserve Real Resume Guard in Chat Route Fixtures

* fix: Persist Terminal Journal Ownership and Remove Unused Chat Channel Lane
2026-11-10 21:03:58 -08:00
Dustin Healy
7dd4fafdf3
📬 feat: Persist Channel Events and Delivery Receipts (#17595)
* 📬 feat: Persist Channel Events and Delivery Receipts

* fix: enforce channel run identity and fenced recovery

* fix: fence and erase channel state during account deletion

* refactor: share channel owner admission with private persistence

* refactor: name channel account-erasure boundary explicitly

* fix: prove channel identity and delivery authority at storage boundaries

* refactor: enforce channel delivery protocol and terminal lifecycle

* fix: enforce channel tenant and operation boundaries

* fix: initialize channel config from its composition owner

* test: verify config installs channel storage reader

* test: complete config initializer contract in model mocks

* test: include channel config reader in migration fixture

* test: await SSE subscription before advancing keepalive time

* test: Observe and Drain Concurrent Fixture Work
2026-11-10 21:03:57 -08:00
Danny Avila
60a74e6cd4
🧷 fix: Promote Unapplied Steers to Durable Queued Turns at Run End (#18028)
* 🧷 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.
2026-11-10 22:43:32 -05:00
Marco Beretta
91fd4b6833
🧭 perf: Validate Agent Models Against Their Own Endpoint Catalog (#17972)
* 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
2026-11-10 17:33:29 +01:00
Marco Beretta
9554046d5a
fix: Preserve Unknown-Provider MCP Display Images (#18000) 2026-11-10 17:29:45 +01:00
lia-by-librechat[bot]
b9994b9ead
🦣 fix: Honor Trace Policy in Memory Runs (#18006)
Co-authored-by: Lia <lia@librechat.ai>
2026-11-10 10:35:59 -05:00
lia-by-librechat[bot]
ea8c133c0b
🥸 fix: Resolve Directory Principals Through Trusted Integration Data (#17825)
* 🥸 fix: Resolve Directory Principals Through Trusted Integration Data

* fix: Verify Permission Principals Concurrently and Preserve Stored Groups

* fix: Refresh Stored Directory Group Membership Before Sharing

* fix: Preserve Directory Membership and Surface Principal Failures

* fix: Stage Principal Reads Before Bounded Permission Persistence

* test: Classify Historical Code Capability Name Expansion

* fix: Bound Directory Verification and Propagate Graph Denials

* test: Await Principal Collections Before Transaction Verification

* test: Isolate Theme Paint Measurements From DOM Trace Capture

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-11-10 09:22:08 -05:00
dvorak33
a3868fdbe8
🖼️ fix: Bound Flux Tool Images and Preserve Original Attachments (#13749)
Bound model-facing Flux images to the 5 MiB base64 budget for standard and finetuned generation. Preserve original image data for attachment storage under the existing resolution policy.

Fixes #6954.
2026-11-09 22:41:29 +01:00
Marco Beretta
4e0f242557
⚡ fix: Parallelize Setup Cancel Lookups and Keep Attachment Drafts on Reload (#17963)
* fix: Read the Account and Session Together and Test Cancel on a Real Database

- Start the setup user and refresh session lookups together in the cancel controller instead of one after the other, as the opt-in confirmation already does
- Run the cancel controller spec on mongodb-memory-server with the real data-schemas methods, so the session and compare-and-swap predicates under test are the production ones, and add a negative case for each
- Keep only a module wiring test in the CJS controller spec, since the database behavior is now covered where it can run for real

* test: Pin the Cancel Response When the Session Lookup Fails

Both lookups now run before any cookie or write, so a failed session lookup answers 500 with the browser and the stored state untouched. Cover that on the real database.

* fix: Keep the Saved Files Draft Until the File List Loads

After a reload the live file map is empty until the server's file list arrives, and the restore that rebuilds it needs that list. The save effect rewrote the stored draft from the empty map in between, so a pasted-text chip or any other attachment was gone before it could be restored. It now waits for the list. This is what turned the composer-attachments restore scenario red on dev.
2026-11-09 21:57:01 +01:00
Marco Beretta
7a927fb19e
🚪 fix: Let Users Sign Out of Required Two-Factor Enrollment (#17956) 2026-11-09 17:40:50 +01:00
lia-by-librechat[bot]
b4afbb3a1e
🛝 perf: Render Chats Independently of Catalog Discovery (#17692)
* 🛝 perf: Render Chats Independently of Catalog Discovery

* Preserve Target Authorization and Passive Startup Intent

* Keep Startup Selection, Readiness, and Catalog Keys Consistent

* Preserve Remembered Targets and Validate Scoped Presets

* Retain Remembered Assistant Resource Aliases Across Endpoint Switches

* Apply URL Targets Before Waiting for Send Readiness

* Fix First-Page Agent Discovery and Await Model Selection

* Preserve Spec Access and Refresh Selected Assistant State

* Preserve Builder Deletion State and Start History Reads Earlier

* fix: Preserve Startup Recovery and History Read Ownership

* fix: Retain Express Query Routing in Assistant Lookups

* fix: Prioritize Route Reads and Recover Credential Changes

* fix: Bind Credential Revocation to Its Requested Scope

* fix: Refresh Credential Metadata After Pending Key Reads

* fix: Revalidate Inactive Credential Metadata on Target Mount

* fix: Preserve Reviewed Chat Resolutions After Rebase

* fix: Resolve Dev Conflicts and Preserve Startup Boundaries

* test: Preserve the ChatView Slot Target Boundary

* fix: Defer Terminal Delivery Until Subscription Attachment Completes

* fix: Contain Deferred Terminal Callback Failures

* test: Classify Historical Tool Name Capability Reads

* fix: Activate Requested Catalogs and Isolate Provider Failures

* fix: Keep Healthy Provider Choices Available During Catalog Recovery

* test: Exclude Copied Trace Bundles From Dependency Comparison

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-11-09 11:11:22 -05:00
Marco Beretta
bffa50e7a8
🚦 fix: Keep the Gateway Message on Classified Rate Limit Errors (#17903)
* fix: Keep the Provider Message on Classified Rate Limit Errors

* fix: Honor maxProviderErrorChars for Classified Generation Errors

* test: Cover Classified Gateway Errors in the Mock Harness

* test: Cover a Zero Provider Detail Limit on Generation Errors

* refactor: Resolve Classified Provider Errors in the TypeScript Backend

* fix: Redact Provider Details Before Truncating Them
2026-11-09 15:44:02 +01:00
Marco Beretta
db083e1cf3
🗑️ fix: Drain Assistants Runs Before Erasing the Account (#17937) 2026-11-09 15:35:31 +01:00
Marco Beretta
9bd44801ec
⏳ fix: Bound Blob Storage Image Reads by the Image Fetch Budget (#17932) 2026-11-09 15:35:11 +01:00
Danny Avila
57ab67cbac
📏 fix: Measure Usage Percent Against the Allowance Each Period Granted (#17850)
* 📏 fix: Measure Usage Percent Against the Allowance Each Period Granted

Store the credits granted at the start of each balance period on the record and measure the usage percent against it, so changing refillAmount or startBalance no longer moves a user's percent until their next grant. Legacy records fall back to the configured amount.

* 🕰️ fix: Ignore a Stored Allotment a Later Refill Has Replaced

Stamp each stored allotment with the time of its grant and measure against it only while no refill is more recent, so a refill by a replica that predates the field falls back to the configured amount instead of reporting usage against the prior period's allowance.

* 🔒 fix: Write the Allotment Grant Atomically and Return Its Period Start

Insert lastRefill with the credit, allotment and grant time when a balance record is created, so a racing creator never moves another's period start past its grant. Return lastRefill even without auto-refill so the client can place a stored allotment in its period, and fall back when it cannot.
2026-11-09 08:27:13 -05:00
Danny Avila
d875425ed2
🔐 fix: Authorize Restored MCP Tools Before Agent Revert Writes Them (#17843)
* 🔐 fix: Authorize Restored MCP Tools Before Agent Revert Writes Them

Reverting wrote the version snapshot, including its mcpServerNames, before
filterAuthorizedTools ran. Agent-scoped MCP access is granted from that index,
so a restored server vouched for itself and an editor without access to it
could re-attach it. A snapshot without mcpServerNames also left the current
index in place, keeping agent-scoped access to servers no tool used.

The handler now authorizes the restored tools against the agent as it stands,
treating only its current tools as existing, and passes the authorized tools
and rebuilt index to revertAgentVersion so the restore is one write pinned to
the revision it was checked against. revertAgentVersion always rewrites the
index for the restored tools.

* 🔐 fix: Exclude the Target Agent's Own Grant When Authorizing a Revert

Moves the restore authorization into authorizeAgentRestore in packages/api,
leaving the revert controller as wiring.

A newly restored MCP tool whose server the user reaches only through agents
must now be reachable through an agent other than the one being reverted,
checked fresh against the database. The target's current or cached index
(including one left stale by an earlier revert) no longer vouches for it.

Prior server names are matched through their normalized aliases, and only for
tools the agent already had. When nothing resolves, the pre-restore index is
kept instead of deriving names from tool keys.

A revision-filtered restore that misses is reported as a 409 conflict.

The route spec restores the real ~/config so the MCP registry is consulted
rather than reported unavailable.

* 🔐 fix: Check Newly Restored MCP Servers Against Live Grants

The restore gate now runs for every approved MCP tool, not only consumeOnly
ones. A tool the agent doesn't already have, on a DB-backed server, is
admitted when a current tool still uses that server, or on a live direct
server grant, or through another viewable agent. A grant the registry still
caches after revocation no longer becomes durable through the restored index.

Admission is memoized per server. A snapshot tools array that sanitizes to
nothing restores an explicit empty set. Active-server matching no longer
reuses the index fallback, so a stale entry is never read as in use.

* 🔐 fix: Treat Legacy Cached DB Configs as User-Sourced in the Restore Gate

A config cached before an upgrade may carry a dbId without source. The
restore gate now uses isUserSourced, so such configs get the live access
check instead of passing as operator-managed.

* 🔐 fix: Recheck Unindexed Existing MCP Tools in the Restore Gate

Holding a tool no longer exempts it from the live check. Only a current tool
whose server the agent's index already lists skips it. Otherwise an unindexed
tool on a legacy agent could pass on a revoked grant the registry still
caches, and the restore would add its server to the index.

* ⚡ perf: Run Restore Admission Checks for Distinct Servers Concurrently

filterAuthorizedTools now starts every admission check during its single pass
and awaits them together, so each distinct DB-backed server no longer adds a
serial lookup wave to the revert. Tool order is preserved and server names
are recorded only for admitted tools.
2026-11-09 07:20:31 -05:00
Marco Beretta
4bded120a9
🛂 fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts (#17904)
* 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.
2026-11-08 23:40:21 +01:00
Marco Beretta
654ce897e9
🗄️ fix: Skip Attachments Deleted by Storage Retention Instead of Failing the Turn (#17910)
* 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.
2026-11-08 23:38:47 +01:00
Marco Beretta
d0d9a30327
🧩 fix: Accept Content-Array Tool Outputs in the Responses API (#17900)
* fix: Accept Content-Array Outputs in Responses function_call_output

The Open Responses spec allows function_call_output.output to be a string or
an array of input_text, input_image and input_file parts, but request
validation refused anything that was not a string. Validate the array parts
and convert them with the same part mapping the message path uses, so the
replayed tool result keeps its text and images in order.

* fix: Inspect Tool-Output Media Against File Policies

Image URLs and file names in a function_call_output content array reached the
model without the file-policy fragments the same parts get in a message.
Collect those fragments for both item types in packages/api and call that
from the Responses controller.

* test: Cover Content-Array Tool Outputs in the Responses API
2026-11-08 19:22:29 +01:00
Marco Beretta
76c25680ce
🔐 fix: Retire Credentials by Their Committing Write and on Opt-In 2FA (#17504)
Some checks failed
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Vote Gate / Gate (push) Waiting to run
Codegraph E2E Votes / vote (shard 1/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 10/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 2/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 3/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 4/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 5/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 6/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 7/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 8/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 9/10) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/chat (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Has been cancelled
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Has been cancelled
* 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
2026-11-05 22:53:11 +01:00
lia-by-librechat[bot]
f4154b649e
🦿 chore: Bump Agents SDK to 4.2.1 (#17664)
Some checks failed
Publish `@librechat/client` to NPM / pack (push) Has been cancelled
Publish `librechat-data-provider` to NPM / pack (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / pack (push) Has been cancelled
Docker Dev Images Build / publish (push) Has been cancelled
Sync Helm Chart Tags / Ignore non-main push (push) Has been cancelled
Sync Helm Chart Tags / Sync chart tags (push) Has been cancelled
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Has been cancelled
* 🦿 chore: Bump Agents SDK to 4.2.0

* test: Adapt Compaction Fixtures to Retained Recent Turns

* test: Preserve the Azure Reasoning Token Contract

* chore: Bump Agents SDK to 4.2.1

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-31 15:17:05 -04:00
Atef Bellaaj
05e7f1d2e6
🔗 feat: Link Langfuse Prompts as Agent Instructions (#17294)
Some checks failed
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Vote Gate / Gate (push) Waiting to run
Codegraph E2E Votes / vote (shard 1/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 10/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 2/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 3/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 4/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 5/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 6/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 7/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 8/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 9/10) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/chat (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Has been cancelled
Main Promotion Policy Tests / Main promotion denial and fast-forward tests (push) Has been cancelled
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Has been cancelled
- Let agents use Langfuse prompts by production label or pinned version,
  with the existing permission and usage checks.
- Add a configuration switch, disabled by default. Preserve saved links
  while disabled, without resolving them or falling back to inline text.
- Share source-specific production and exact selections across agent
  links and the prompt service. Reject source mismatches.
- Add revision lists for the Agent Builder version picker. Resolve
  Langfuse instructions on each initialization without caching.
- Improve disabled and unavailable states and test source changes,
  revision loading, and permission failures.
2026-10-30 17:28:37 +01:00
lia-by-librechat[bot]
f03a4686ff
🚋 fix: Scope Document Name Traversal to Bedrock Agents (#17627)
* 🚋 fix: Scope Document Name Traversal to Bedrock Agents

* test: Preserve Replay Content Across Token Cache Refreshes

* fix: Include All Bedrock Replay Recipients in Document Naming

* fix: Include Lazy Provider Metadata in Document Naming

* perf: Short-Circuit Reachable Agent Predicates

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-30 13:53:36 +01:00
Marco Beretta
2ad2c1c14b
🔑 perf: Cache JWT Users and Batch Auth-Path Reads (#17466)
* 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.

Fixes berry-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
2026-10-30 00:24:08 +01:00
lia-by-librechat[bot]
3d3edaff01
🐘 fix: Preserve Authored Skills Across Approval Resumes (#17630)
* fix: preserve authored skills across approval resumes

* fix: complete authored skill resume contracts

* fix: keep restored skill identity authoritative across batches

* fix: reject replacement skills during authored recovery

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-29 22:17:03 +01:00
Marco Beretta
0bcb0aaec1
🛟 fix: Promote Reconciled Compaction Snapshots to the Terminal Row (#16553)
* 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
2026-10-28 11:13:50 +01:00
Marco Beretta
65d0ba8563
🧯 fix: Return Approved Tool and Generation Error Text Instead of Raw Exceptions (#17508)
* fix: Return approved tool and generation error text instead of raw exceptions

* fix: Redact generation error text without the data-schemas helper

* fix: Redact credentials and emails from shown generation errors

* refactor: Move the Wolfram status policy into packages/api

* test: Fix the Wolfram probe constructor and jest summary match

* test: Match the jest pass count through color codes

* fix: Redact credentials a tool input error echoes from its arguments

* fix: Drop free-text fields from typed generation errors under a content policy

* fix: Keep only the code and numeric fields of typed errors under a content policy
2026-10-28 00:39:01 +01:00
Marco Beretta
a0f063b1c7
🔐 fix: Fence ACL Viewers and Surface Revocation Failures When Removing Shared MCP Servers (#17506)
* fix: Fence ACL Viewers and Surface Revocation Failures When Removing Shared MCP Servers

Account erasure and server deletion now enumerate users the view ACL names
directly or through a group, so viewers without a personal OAuth token are
fenced and disconnected too. Erasure runs the OAuth teardown in strict mode,
which clears local credentials and then fails when the provider refuses a
revocation, keeping the server as the retry anchor, and holds every user's
teardown fence until the server delete commits.

* test: Type the Revocation Failure Cleanup Fixtures

* fix: Renew Retained OAuth Teardown Fences Before Deleting the Server

A teardown lease lasts 15 minutes, so a large erasure could outlive the
first fences it holds. Leases can now be renewed by their owner, and
erasure renews every retained fence right before the delete, failing
without deleting when one lapsed and another writer took it.

* fix: Report Refused MCP Revocations Without Blocking Account Erasure

A provider that refuses revocation, combined with a viewer who signs in
again between attempts, could keep an erasure failing indefinitely. The
strict teardown now throws a coded MCPOAuthRevocationError after clearing
local state and handing over its fence; server removal collects those as
refusals, logs each user and token type whose grant may remain valid, and
proceeds. Local failures (token delete, fence, ACL) still fail closed.

* fix: Annotate the Revocation Error Code for Isolated Declarations
2026-10-28 00:37:07 +01:00
Marco Beretta
784582850a
🧯 fix: Guard SSE Writes and Interval Cleanups Against Crashes (#17462)
* fix: Harden Timer Sweeps, SSE Writes, and Violation Counters

Guard SSE writes against ended or destroyed responses through one helper, catch and single-flight the job store and TTL cache cleanup timers, serialize in-process counter updates, cap the violation log, prune stale OAuth failure records, batch the active-job lookup, and count Redis keys with DBSIZE.

* refactor: Drop the redundant violation log entry copy

* refactor: Log single-flight sweep failures from the API package

* test: Cover active generation listing and client disconnect mid-stream

* refactor: Configure violation log retention and move title timeout into the API package

* feat: Configure OAuth failure retention through mcpSettings

* fix: Prune OAuth failures promptly under short retention
2026-10-27 23:06:58 +01:00
lia-by-librechat[bot]
0f868baf26
🍘 fix: Separate Runtime Context From User Input (#17454)
* 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>
2026-10-26 15:51:16 +01:00
Danny Avila
aa8e5849e0
⬆️ feat: Migrate to Zod v4 (#17442)
* ⬆️ feat: Migrate to Zod v4 (GHSA-mrhx-c7xc-m3w5), openai 6.49, zod-openapi 6

* 🔒 chore: Regenerate bun.lock

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

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

* fix: Require Agents SDK 4.1.1 for Zod 4 Accounting

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-26 14:16:22 +01:00
lia-by-librechat[bot]
5cf87548cd
🩰 fix: Keep Subagent Guidance in Main Chat Order (#17394)
* fix: Keep Applied Subagent Guidance in Main Chat Order

* fix: Preserve Pending Controls and Unmatched Legacy Guidance

* fix: Type Retained Control Read Parameters

* fix: Keep Guidance Receipts Truthful Across Delivery States

* fix: Retain Projected Steering Client Identities

* fix: Retain Ordered Guidance Across Terminal Child States

* style: Keep Public Observation Parsing Flat

* fix: Preserve Usable Legacy Activity During Reprojection

* test: Type the Legacy Recovery View Adapter

* fix: Preserve Shared Progress Identity and Public Reasoning

* fix: Forward Host Steering Through Shared Progress

* fix: Replace Tool Argument Placeholders Before Streaming

* fix: Retain Late Child Calls and Parent Steering Content

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-24 12:12:57 +02:00
lia-by-librechat[bot]
f18b16baed
🚿 fix: Bound Chat Message IDs and Remove Backtracking (#17388)
Some checks are pending
Docker Dev Images Build / publish (push) Waiting to run
Sync Helm Chart Tags / Ignore non-main push (push) Waiting to run
Sync Helm Chart Tags / Sync chart tags (push) Waiting to run
* 🚿 fix: Bound Chat Message IDs and Remove Backtracking

* fix: Reserve the Preliminary Response ID Suffix Budget

* fix: Annotate Message ID Limit Exports for Declaration Builds

* fix: Accept Preliminary Response IDs as Compaction Anchors

* fix: Keep Derived Compaction Error IDs Within the Response Bound

* fix: Bound Regeneration Placeholders Across Client and API

* test: Complete Turn Protocol Regression Fixture Contracts

* fix: Validate Effective Turn IDs and Align Queued Parent Bounds

* test: Preserve Shared Constants in OAuth Controller Mocks

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-24 10:16:25 +02:00
lia-by-librechat[bot]
39ecd5563c
✒️ fix: Bind Assistant Avatar Updates to Authorized Owners (#17391)
* ✒️ fix: Bind Assistant Avatar Updates to Authorized Owners

* test: Keep Avatar Regression Checks Lintable and Typed

* fix: Preserve Provider-Only Assistant Avatar References

* fix: Preserve Assistant Identity and Avatar Access Across Legacy References

* test: Align Legacy Avatar Authorization Projection

* fix: Initialize Managed Assistant References With the Provider Author

* fix: Require Verified Ownership Before Initializing Private Avatars

* fix: Commit Assistant Avatar Identity Before Owner-Aware Cleanup

* test: Seed Indexed Avatar Users With Unique Emails

* fix: Serialize Assistant Avatar Publication and Cleanup

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-24 10:16:16 +02:00
Danny Avila
f05f50460a
🔭 feat: Admin Config Read APIs (Resolved and Effective Config, Scope Catalog, Env Status) (#17383)
* 🔭 feat: Admin Config Read APIs (Resolved and Effective Config, Scope Catalog, Env Status)

Admin clients could read one config document at a time, or the deployment's merged config,
but nothing showed what a profile or a user resolves to: a client had to re-implement the
merge (Base-first precedence, merge keys, tombstones, the interface permission filter,
base-only fields, runtime stops, secret rebinding, the env allowlist) to preview it, and had
no way to see why part of a profile is ignored. Endpoint, model and tool pickers came from the
end-user routes, called as the signed-in admin, so they showed the admin's own scope and keys
and needed a browser User-Agent.

The admin config API now has four read routes. GET /resolved/:principalType/:principalId and
GET /effective?userId= return librechat.yaml, the documents that merge over it in merge order,
each with the parts the merge does not apply and why, and the result, in librechat.yaml shape.
They come from resolveConfigLayers, which tracks the same fold the served merge runs and is
pinned to it by parity tests, and from the stored documents rather than the override cache.
GET /catalog lists the endpoints (with the reason one is not served), models (served,
configured and defaults), MCP servers and tools a scope serves, resolved for the scope rather
than the caller and never with a user's stored key; GET /env-status reports whether each env
name the config uses is set, never its value. Every read is filtered to the sections the caller
can read, redacted as reads redact, and scoped to the caller's tenant. The admin Langfuse routes
now say why a deployment offers no connection settings. Meta reports resolvedApi, catalogApi,
envStatus and limits.catalogModelsTtlMs.

* 🪞 fix: Report Duplicate Custom Endpoints from the Served Definition

When librechat.yaml defines a custom endpoint name twice, or both `Ollama` and `ollama`, the
catalog kept the first definition for a name's env names, reason and models, while
`loadCustomEndpointsConfig` serves the last servable one. An entry could pair the served config
of one definition with the env names of another.

`resolveServedCustomEndpoints` now holds the runtime rule (the last definition with a name, key,
base URL and models wins under its served name), and `loadCustomEndpointsConfig`,
`loadConfigModels` and the catalog all use it. A name with no servable definition is reported
from its last one.

* ⏱️ feat: Make the Admin Catalog Model-List Lifetime Configurable

`GET /api/admin/config/catalog` reused a scope's model lists for a fixed two minutes. The new
librechat.yaml field `endpoints.catalogModelsTtlMs` sets that lifetime (milliseconds, `0` to one
hour, two minutes by default); `0` resolves the lists on every read. It is a base-only path, so a
profile cannot change it and `GET /meta` reports one value, now read from the deployment's config
on each request as `limits.catalogModelsTtlMs`.
2026-10-24 09:23:22 +02:00
lia-by-librechat[bot]
532214c022
🐡 fix: Bound Tool Approval Admission Work (#17387)
* 🐡 fix: Bound Tool Approval Admission Work

* style: Normalize HTTP Regression Formatting

* fix: Validate Persisted Options Before Runtime Alias Expansion

* fix: Preserve Option Limits Across Reset and Initialization

* fix: Keep Legacy Approval Options Readable in Management Responses

* fix: Retain Option Limit Provenance Through Runtime Normalization

* test: Use a Typed MCP Configuration Fixture

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-24 08:58:17 +02:00
lia-by-librechat[bot]
a51c45bbf3
🌳 fix: Preserve Primary Files Until Secondary Cleanup Succeeds (#17228)
* fix: Preserve primary files until secondary cleanup succeeds

* test: Use a flat deletion-strategy lookup

* fix: Preserve erasure retries and reconcile removed embeddings

* test: Match deletion regression formatting

* fix: Preserve search intent after vector cleanup

* fix: Repair retained project search files before tool execution

* fix: Normalize Retained Project File Runtime Types

* test: Use the Storage Source Enum in Project Repair Coverage

* fix: Confirm Secondary Cleanup and Preserve Repair Policy

* test: Correct Repair Fixture Types and Cleanup Retry Assertions

* fix: Reconcile Code Copies Compatibly and Charge Shared File Budgets

* fix: Reserve Admitted File Budgets Before Deferred Screening

* fix: Retain Concurrent File Copies and Scope Cleanup by Tenant

* fix: Bound Erasure File Checks and Correct Cleanup Fixtures

* fix: Preserve Provider-Only Assistant File Deletion

* fix: Reconcile Primary Vector Deletions Before Finalization

* fix: Finalize Successful Files in Mixed Cleanup Batches

* test: Load Real File Finalizer in Cleanup Integration Tests

* fix: Preserve Project Routing MIME and Fence File Storage Operations

* fix: Validate Provisioning Principal and Type Project Repair Fixtures

* fix: Recover Provisioning Claims and Retain Uncertain Storage Outcomes

* fix: Normalize File Recovery Results and Reconcile Transport Attempts

* test: Preserve Deployment Routes in Host Provisioning Fixtures

* fix: Recover Deletion Claims and Fence Generated Output Writes

* fix: Preserve Generated Output Commit Snapshots

* test: Use Persisted Owner Type in Generated File Fixture

* test: Type Generated Output Fixture with Its Commit Contract

* fix: Preserve Publication Error Handling and Cleanup Test Boundaries

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-23 07:00:20 +02:00
Danny Avila
db225c0919
🔐 feat: Admin Config Secrets v2 (MCP and Azure Credentials, Re-entry, Env Allowlist, Rebinding) (#17353)
* 🔐 feat: Admin Config Secrets v2 (MCP and Azure Credentials, Re-entry, Env Allowlist, Rebinding)

The admin config API stored MCP server credentials and Azure group keys in plaintext, returned
them to config readers, let an admin who cannot read a stored credential send it to a host of
their choosing, and let override values reference any environment variable. MCP credentials
and Azure keys, in `groups` and in the `groupMap` the Azure clients read, are now encrypted
with masked previews, hidden from every read and decrypted once after the merge. A write that
keeps a stored MCP credential or web search key while changing where it is sent must enter it
again, judged by the value the written document holds. `${VAR}` references in overrides are
limited to an allowlist, named where a change batch leaves them, and the merge drops a
credential a layer moves to a new destination without entering it, listing it in write
responses only for sections the caller can read. A custom endpoint's key is bound to its base
URL, its provider and the destination options in addParams and dropParams (such as the
anthropicApiUrl the native Anthropic client sends to), matched across layers under the name the
merge folds (ollama is Ollama). A restated `${VAR}` counts as entered, so allowlisted names
are not bound to a destination. Azure's `${INSTANCE_NAME}` and `${DEPLOYMENT_NAME}` stay
templates in a group's `baseURL`, and a scheduled job's MCP consent no longer depends on the
masked previews that change when an admin rotates the key in place.

* ♻️ refactor: Move the MCP Key Re-entry Guard Out of the Binding Helpers to Break an Import Cycle

With #17351's OpenID provisioning on dev, the app config service reached itself through the
rebinding guard: app/service -> app/overrides -> app/rebinding -> mcp/registry/binding ->
mcp/errors (and mcp/types) -> mcp/oauth/obo -> utils/identity -> auth/openid -> auth/provision
-> app/resolve -> app/service. The binding helpers are pure diffs; only
requireApiKeyReentryForRebinding needs the MCP error class, so it moves to
mcp/registry/reentry.ts, and the helpers take MCPOptions from librechat-data-provider as
mcp/headers.ts does. No behaviour changes.

* 🧪 test: Drop a Base-Held Endpoint Key That a Lower-Priority Profile Moves

Base merges first since #17352, so a profile below Base's priority still
lands over it. The rebinding guard drops the key Base stores for a custom
endpoint whose baseURL the profile changes, and the PATCH response lists
it in `ignored`.

* 🔐 fix: Serve Admin Azure Group Keys and Keep Deployment Keys at Their Own Destinations

Azure groups a profile writes now take effect: the merge resolves a layer's
`endpoints.azureOpenAI.groups` as AppService resolves librechat.yaml's
(`resolveAzureGroups`, shared with `azureConfigSetup`) into the `groupMap`,
`modelGroupMap`, model list and assistant models the Azure clients read. A
layer's groups replace the groups below whole, as its array does; groups that
do not resolve stay unread with a warning. The rebinding guard judges the
resolved groups like any `groupMap` entry, and an Azure group's destination now
also covers a deployment name its base URL takes its host from and the
destination options of its `addParams`/`dropParams`.

A write that keeps a stored Azure group key (in `groups` or `groupMap`) while
changing where the group sends it answers 400 `CONFIG_SECRET_REENTRY_REQUIRED`
on PUT, PATCH, field deletes, tombstones and change batches, judged as the
document resolves over librechat.yaml and on each `groups` item as written.

OCR fills an empty key from `OCR_API_KEY` only for its default destination (no
base URL, or `${OCR_BASEURL}`), so a key the guard dropped for an override's
`${VAR}` base URL is not replaced by the deployment's. The env reference policy
includes the `${OCR_API_KEY}` loading fills in for an `ocr` section without a
key, so a client can write back what GET `/base` returned.

The custom endpoint guard no longer needs the layer's overrides to name an
entry: an entry changed some other way is judged as inherited (positional
tombstones inside the list are not applied by the merge, so none reached one).

A web search URL a layer points at a `${VAR}` other than librechat.yaml's
without entering its key is set back: web search sends the deployment's key,
or its client's environment default, to any `${VAR}` URL.

* 🔐 fix: Keep Azure Assistants Served, Opaque Keys as Entered and Batch Env Checks on the End State

Azure assistants: a profile's `groups` replace the groups below whole, so
groups with no model that supports assistants under librechat.yaml's
`assistants: true` left `assistants` on with an empty `assistantModels`, and
the Azure Assistants initializer picked `assistantModels[0]` (undefined).
`azureConfigSetup` refuses that combination at startup; the merge now turns
`assistants` off when none of the models it leaves supports them, with a
warning, judged on the merged result so a later layer whose groups serve
assistants keeps them on. The check is `lacksAzureAssistantModels`, shared
with `azureConfigSetup`.

Opaque credentials: every runtime reader of the OCR, speech, web search and
Langfuse keys uses the decrypted value as is (`resolveConfigSecret`,
`resolveStoredConfigSecret`, `decryptConfigSecret`), so a `${...}` inside a
key the write encrypts is part of the key. Those fields are marked `opaque`:
the write-time check skips a value the write encrypts there, and the runtime
pass keeps their ciphertext instead of blanking it. A whole `${VAR}`
reference there, which the field passes through and its reader resolves, is
still checked, and so is stored plaintext. Custom endpoint (`initializeCustom`),
Azure group (`mapModelToAzureConfig`) and MCP (`processMCPEnv`) credentials
are expanded by their clients once decrypted and stay checked; the Assistants
keys have no reader yet and stay checked too.

Change batches: env references are judged on the document the batch leaves,
as its other issues are. An issue counts only when the end state still holds
a disallowed reference (ciphertext by its plaintext) where the batch sent one,
at a location the batch changed, so a value a later op removes or replaces
(`set ocr.baseURL`, then `unset ocr`) is no longer refused, and a stored
reference the batch puts back where it was is left to merge time.

* 🔐 fix: Proxy-Bound OAuth Secrets, Consistent Azure Group State, Batch Issues by Entry Key and Loaded Web Search References

- The MCP proxy is part of the OAuth client secret's binding (user tier, admin re-entry and the
  merge's rebinding guard share `getChangedOAuthSecretBindingFields`): the access token the
  secret obtains travels through it.
- A tombstone of `endpoints.azureOpenAI.groups` resolves the groups to none in the merge (empty
  `groupMap`, `modelGroupMap` and model lists, so the model list does not fall back to the
  environment's defaults), and removes what they resolve to in `applyConfigTombstones`.
- The merged Azure model lists name only models a merged group serves
  (`narrowAzureServedModels`), so an override's `assistantModels` no group serves no longer keeps
  Azure assistants on.
- `/changes` env issues are held by entry identity (`toConfigIdentityPath`), followed through
  renames and resolved on the batch's end state, so a removal or rename no longer shifts them.
- References loading librechat.yaml introduces (OCR's `${OCR_API_KEY}`, the web search defaults)
  are allowed at the location they are loaded at, so GET /base's sections are accepted written
  back, and nowhere else.

* 🔐 fix: Re-entry for Endpoint, OCR and Speech Keys, Own Keys Bound Over Base and User Key Destinations Kept

- The document that stores a custom endpoint, OCR or speech key can no longer
  move its destination without the key: PUT, PATCH, field deletes, tombstones
  and change batches answer CONFIG_SECRET_REENTRY_REQUIRED at the changed field
  (getBoundKeyReentryIssues), judged by value as the document alone sends it.
- A profile's own key for an endpoint, MCP server, OCR or speech service, or
  Azure groupMap group that Base defines is bound to that destination when it
  is entered: the rebinding guard reports a fingerprint of where it goes, the
  write stores it beside the key (<secret>Binding), and the guard keeps the key
  there until a lower layer moves it. Reads and the merged config leave the
  fingerprint out; kept keys carry it; client values are replaced.
- An inherited custom endpoint or MCP server that sends a credential each user
  holds (user_provided, customUserVars, apiKey.source user, OpenID or Graph
  token placeholders) keeps its destination: a layer's move is set back and
  listed in ignored.
2026-10-23 06:37:54 +02:00
Danny Avila
6189220697
🏷️ fix: Resolve endpoints.all Title Settings per Field and Fold Ollama Endpoint Names (#17316)
Some checks failed
Codegraph E2E Votes / vote (shard 10/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 2/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 3/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 4/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 5/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 6/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 7/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 8/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 9/10) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/chat (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Publish `@librechat/client` to NPM / pack (push) Waiting to run
Publish `@librechat/client` to NPM / publish-npm (push) Blocked by required conditions
Docker Dev Images Build / publish (push) Waiting to run
Sync Helm Chart Tags / Ignore non-main push (push) Waiting to run
Sync Helm Chart Tags / Sync chart tags (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Has been cancelled
Publish `librechat-data-provider` to NPM / pack (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / pack (push) Has been cancelled
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Has been cancelled
* 🏷️ fix: Resolve endpoints.all Title Settings per Field and Fold Ollama Endpoint Names

Conversation titles picked `endpoints.all` as a whole block, so any `all`
block (even one holding only streamRate, headers or activity label keys)
hid every per-endpoint titleConvo, titleModel, titleMethod, titleEndpoint
and title prompt. `resolveTitleConfig` resolves each field from `all`,
then the named endpoint, then the custom endpoint entry, keeping
titleEndpoint and titleModel as one choice from the first layer that sets
either.

Config overrides merged `endpoints.custom` by exact name while the runtime
serves names through `normalizeEndpointName`, so an override `ollama`
survived beside the YAML `Ollama` and split the endpoint between two
baseURLs and keys. The merge key now folds the same way (the YAML spelling
is kept), merge-key issues, issue attribution and secret preservation use
the same identity, and the effective config serves
`modelSpecs.addedEndpoints`, `modelSpecs.list[].preset.endpoint` and
`endpoints.agents.allowedProviders` in served names without repeats.

A stored document that already names one endpoint in two spellings is
combined at merge in document order, so requests keep the host and key
of the first item instead of moving to the YAML entry; omit-to-keep
secret preservation reads the same combined entry. A new write naming
both spellings is rejected as a duplicate.

An agent saved as `Ollama` now runs on the served `ollama`: the model
catalog lookup (`resolveModelCatalogKey`) falls back to the served name,
and `initializeAgent` folds the provider before the allowedProviders
check and provider setup.

* 🏷️ fix: Report Per-Field endpoints.all Title Resolution in the Admin Config Meta

resolveTitleConfig resolves endpoints.all title settings one field at a time, so GET /api/admin/config/meta now reports rules.titleResolution as 'field'. meta.spec ties the reported value to resolveTitleConfig: with endpoints.all = { streamRate: 1 } and openAI.titleModel = 'x', the rule is 'field' exactly when the endpoint's titleModel survives.

* 🧪 test: Expect Segments on the Folded duplicate_merge_key Write Issue

Admin config write issues carry segments since #17322; the folded Ollama/ollama duplicate test now asserts them.

* 🏷️ fix: Match Folded Custom Endpoint Names in Admin Config Change Ops

The changes endpoint from dev matched entry keys exactly, while the config
merge, merge-key issues and secret preservation fold `Ollama`/`ollama` into
one custom endpoint. An upsertEntry `ollama` over a stored `Ollama` copied the
stored key, appended a second entry and failed as duplicate_merge_key;
removeEntry `ollama` left a stored `Ollama` in place; a rename onto another
spelling passed entry_exists; and the librechat.yaml entry check missed
`ollama` against the YAML `Ollama`.

- data-schemas: `getConfigEntryIdentity` folds a key by its override path;
  `getConfigEntryMatcher` backs upsertEntry, removeEntry, rename, written-path
  attribution and the stored-counterpart lookup; issue locations use the same
  identity. A rename of an entry stored in two spellings moves the one entry
  the runtime merge combines (`combineFoldedConfigEntries`).
- api: the YAML-entry rename guard and the per-batch duplicate check compare
  entries by the same identity.
- Tests: unit coverage for each op across spellings, and handler integration
  tests against MongoDB for upsert with secret preservation (single and
  two-spelling documents), removal, entry_exists, inherited_entry and
  duplicate changes in one batch.
2026-10-22 16:57:42 +02:00
Danny Avila
8c51a3f9f8
🙈 feat: Let Config Profiles Hide librechat.yaml MCP Servers and Remove Their Fields (#17327)
* 🙈 feat: Let Config Profiles Hide librechat.yaml MCP Servers and Remove Their Fields

Config profiles are the `__base__`, role, group and user documents written through `/api/admin/config`. A profile can tombstone `mcpServers.<name>`, and the merge then removes that server from the principal's resolved `mcpConfig`.

* 🛡️ fix: Apply MCP Hiding to Server Instructions, Failed Removals and the Startup Audit

- Server instructions bound for the model now leave out librechat.yaml servers hidden from the acting user, including one a model spec pins. `applyContextToAgent` passes the request user through `formatInstructionsForContext`, which drops the user's hidden set from the user-less catalog it reads.
- A config-tier candidate that removes a librechat.yaml value (a field, or a key of a record such as `headers`) and fails inspection now stands as a failed config-source entry instead of falling back to the librechat.yaml base that still carries the removed value. A failed change that removes nothing still falls back, and an entry with no transport (fields written over a hidden server) keeps the documented librechat.yaml fallback.
- The startup tombstone report reads every tenant's profiles in the system tenant scope, so it also runs from entry points without an outer system scope under strict tenant isolation, and names each profile's tenant.

* 🗂️ fix: Project the Startup MCP Tombstone Report Query and Run It Alongside Connections

* 🔑 fix: Keep Removed OAuth Headers Out of the MCP OAuth Callback

* 📝 docs: Note That Removed OAuth Headers Stay Out of MCP Sign-In

* 🔐 fix: Recheck the MCP OAuth Flow's Server Before Initiation Redirects

OAuth initiation redirected to a flow's stored authorization URL, or started
a new authorization from the flow's stored server URL, without resolving the
server again, so a principal whose profile hid the server after the flow was
created could still be sent to its authorization endpoint. The callback's
active-server check and its OAuth header fallback lived in the CJS route.

resolveMCPOAuthTarget (packages/api/src/mcp/oauth/target.ts) now owns both:
it resolves the server in the principal's current config with a strict read,
refuses a flow admitted for another server, a server the principal can no
longer use, or a redefined one, and selects the headers the flow sends (the
initiation snapshot, else the principal's config). Initiation calls it before
either redirect (404 or 400); the callback calls it before the exchange and
from the token-store fence.

* 📝 docs: Note That a Hidden MCP Server Ends OAuth Sign-Ins Already Started

* 🚩 feat: Publish the yamlMcpHide Admin Config Meta Flag

Profiles can hide librechat.yaml MCP servers and a hidden server is an
access boundary, so GET /api/admin/config/meta now reports
features.yamlMcpHide for the admin panel to gate its hide UI on. The
meta.spec probe checks the behaviour itself: the admin API stores an
mcpServers.<name> tombstone, the merged config drops the server, the
registry withholds it from principal lookups and checkout but not from
app-level lookups, process-backed servers stay, and an unreadable
principal config withholds every hideable server.

* 🧪 test: Align MCP Tombstone Specs With the Portable Config Store

The admin config handlers now write whole documents through
writeConfigDocument, so the end-to-end tombstone spec wires it in place
of the removed upsertConfig/patchConfigFields deps. A reset of a whole
MCP record now also prunes the parents it leaves empty.
2026-10-22 14:10:31 +02:00
lia-by-librechat[bot]
eac18f4656
🥼 fix: Separate Agent Inference Settings From SDK Configuration (#17220)
* 🥼 fix: Separate Agent Inference Settings From SDK Configuration

* fix: Load Typed Inference Controls and Preserve Legacy Bedrock Preferences

* fix: Resolve Trusted Inference Profiles Consistently

* fix: Keep OpenRouter Cache Policy Independent of Reasoning

* fix: Enforce Final Parameter Policy Across SDK Aliases

* fix: Enforce Inference Policy Through Production Initialization

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-22 13:07:16 +02:00
Marco Beretta
4c6ea7e981
🔐 fix: Hash Passwords on a Worker Pool and Surface API Key Lookup Failures (#17261)
* fix: Hash Off the Event Loop and Surface API Key Lookup Failures

Registration, email verification, password reset and verification resends
hashed and compared with bcryptjs's synchronous calls. bcryptjs is pure
JavaScript, so each call blocked the event loop for every request in the
process. They now use the promise APIs, and the password reset
dependencies are async.

validateAgentApiKey caught its own query failures and returned null, so a
database outage answered remote callers with 401 Invalid API key. It now
lets the failure reach requireApiKeyAuth, which answers with a 500.

* fix: Run bcrypt on a Worker Pool in packages/api

bcryptjs's promise API still computes on the main thread, only in chunks
of up to 100 ms, so concurrent registrations and resets kept stalling
unrelated requests (four cost-10 hashes delayed a 5 ms timer by about
190 ms). hashSecret and compareSecret now run bcryptjs on a small
worker_threads pool in packages/api, and AuthService.js calls them.

* feat: Configure the Password Hashing Worker Count

* fix: Verify Login and Step-Up Passwords on the Hash Pool
2026-10-19 22:13:31 +02:00
Marco Beretta
b1cf65c7e9
🗂️ perf: Index Hot Lookups and Project the Remote Models List (#17259)
* 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
2026-10-19 21:39:10 +02:00
Marco Beretta
e57aa3aa5b
🙊 fix: Keep API Keys and Internal Errors Out of Logs and Responses (#17258)
* 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
2026-10-19 21:36:46 +02:00
Marco Beretta
8fab21d882
🧬 fix: Skip Re-Embedding Legacy File Search Files After Upgrade (#17206)
* fix: Skip Re-Embedding Legacy File Search Files an Agent Already Holds

Files embedded before per-namespace tracking carry no embeddedEntities, so
lazy provisioning treated them as unembedded and embedded them a second
time on the first search after upgrading, duplicating every passage.

A legacy record in the agent's own file_search resources was embedded for
it, so trust its embedded flag there instead of re-queueing it.

* fix: Adopt Legacy Search Embeddings Only for Their Sole Holder

Trusting the embedded flag for every legacy File Search file left an agent
that inherited one querying a namespace without its vectors. Legacy files
held by no other agent now record the active agent as their namespace, a
one-time write, and are not embedded again; a file another agent also
holds keeps the per-namespace re-embed.

Adds an e2e scenario that reshapes an uploaded agent file into the v0.8.7
record and checks that search queries it without a second embed.

* test: Cover Legacy Search Files Shared With Another Agent

* test: Read the Stored File Id in Legacy Search Scenarios

* fix: Pin Legacy Search Adoption to Loaded Records and Wire Every Agent Init

file_id is not unique, so adoption now matches each record by its owner and
tenant as well, and only rewrites the records priming loaded. The added
conversation and client agent initializations receive the dependency too,
so their sole-holder legacy files are not embedded a second time.

* fix: Adopt Each Legacy Search Record in One Conditional Write

* fix: Count a Concurrent Same-Agent Adoption as Adopted

* fix: Run Legacy Search Adoption Beside the Liveness Probe and Fall Back on Failure

* fix: Keep Committed Legacy Search Adoptions When a Sibling Write Fails

* fix: Confirm Legacy Search Embeddings With RAG Before Adopting Them

Inferring the embedding agent from current File Search holders could adopt a
file for an agent whose namespace held none of its vectors, for example after
the agent that embedded it was deleted. Priming now asks RAG for one chunk of
each legacy file under the agent's entity_id and records the namespace only
on a hit; a miss or an unreachable RAG keeps the file queued for embedding.

The data-schemas method no longer scans agents and matches untenanted records
as untenanted. The fake RAG server answers these presence checks from the
embeds it stores.

* fix: Require the Entity's Own Chunks and Keep Confirmed Vectors

RAG also returns chunks owned by the requesting user, so a presence check now
counts only chunks recorded under the agent itself. Once vectors are
confirmed, the turn skips the re-embed even if recording the namespace fails.

* fix: Bound the Legacy Search Check and Keep the Fake RAG Query Shape

The RAG presence check now times out (fileConfig.legacySearchProbeTimeoutMs,
5s by default) and falls back to embedding, so a stalled RAG cannot hang
priming. The fake RAG server records presence checks in their own list and
keeps the file_search query records it already returned.

* fix: Check Any Unrecorded Namespace Before Embedding a Search File

A file another agent embedded first lists only that agent, so the agent
whose older vectors went unrecorded skipped the check and embedded a second
copy. Priming now asks RAG for every agent File Search file that records no
embedding for the active agent, and recording adds the namespace to the ones
already there.

* fix: Ask RAG for Several Chunks So a User Copy Cannot Hide the Agent's

RAG ranks chunks across every owner of a file_id and, once the top one is
authorized, returns them all. A copy of an agent file embedded for the
requesting user could rank first with k: 1 and hide the agent's own chunks,
so the presence check now asks for ten and checks every owner.

* fix: Confirm Setup Embeddings in Shared-File Runs and Log Safely

The run-file host primes an agent's setup files on its own, so it now
receives the RAG presence check and the namespace recorder too; without
them a shared-file run could embed a legacy setup file a second time.
Failed checks are logged with getSafeErrorMetadata rather than the raw
error, which carries the vector store's response body.
2026-10-17 19:19:14 +02:00
Marco Beretta
aec11338e6
🪦 chore: Retire the DALL-E 3 Tool (#17205)
* chore: Retire the DALL-E 3 Tool

OpenAI shut down dall-e-3 on May 12, 2026, so the built-in DALL-E 3 tool can no longer generate images on api.openai.com. Remove the tool, its manifest entry, registry definition, and env docs, along with the loadTools functions flag that only existed to register it. The OpenAI Image Tools cover the same use case. Stored agents that still list dalle load without it, and dalle stays in imageGenTools so past images keep rendering.

* test: Cover the Retired DALL-E 3 Tool in Mock Scenarios

* docs: Drop DALL-E from the README Image Generation List
2026-10-17 18:24:22 +02:00