Bump @modelcontextprotocol/sdk from ^1.30.0 to ^1.32.1 in api and
packages/api. 1.31.0 binds stored OAuth credentials to the issuing
authorization server; LibreChat does not use the affected auth()/
authProvider path and already pins refreshes to the stored token endpoint.
1.32.0 makes the client transports follow same-origin redirects
themselves, which would re-issue requests the connection fetch declined
(hop cap, reauthorized tools/call). Set redirectPolicy: 'follow' so
redirects stay with the connection fetch, and cover both transports with
real-SDK tests.
* 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
* feat: Extend the Audit Action Vocabulary to Admin, Sync and Credential Mutations
* feat: Audit Admin Role, Group and Config Mutations
Role deletion now removes the role's grants, ACL entries and config
overrides before the role itself and returns ROLE_CLEANUP_FAILED instead
of success when any of them fails, so a recreated role cannot inherit
leftover privileges.
* feat: Audit IdP and Startup Role Changes
* fix: Keep the Startup Role Sync Running When Its Audit Verification Read Fails
* test: Cover Admin Role Audit Trail End to End
* fix: Audit a Remote Agent Role Sync Only After It Persists
* fix: Restore Role Dependents When Role Deletion Fails Midway
* fix: Restore Role Dependents Only When the Role Still Exists
* style: Sort Role Admin Imports
* fix: Keep the ACL Snapshot When Role Cleanup Fails Ambiguously
* test: Read Role Audit Entries From the Audit Log Route
* fix: Audit Only Real Membership Changes and Restore Deleted Role Config in Full
* fix: Restore Deleted Role Grants in Full and Sanitize Audit Write Logging
* fix: Audit and Report a Role Deletion Confirmed After a Lost Response
* fix: Never Restore Dependents Onto a Recreated Role
* fix: Snapshot Role Dependents Before Deleting and Detect Membership Changes Atomically
* fix: Restore From the Data a Cascade Step Actually Removed
* fix: Restore Only Config Overrides When a Role Delete Fails
* fix: Log Only Safe Metadata When the Startup Audit Read Fails
* fix: Audit Grants Removed by a Failed Role Delete
* fix: Audit Removed Grants on Unverifiable Role Delete Exits
* fix: Honor Fail-Closed Auditing in the Admin Config, Group and Role Routes
* fix: Bind Role Deletion to the Captured Id and Audit Only Atomic Role and Config Changes
* fix: Skip the Config Restore When the Targeted Role Is Gone
* fix: Audit Initial Group Members and Skip No-Op Role Description Updates
* fix: Record Role Deletion as Pending Before Cleanup and Append Its Outcome
* fix: Audit Reassigned Role Members and Return the Persisted Config After a Tracked Toggle
* fix: Keep a Committed Role Deletion Successful When Cascade Audit Writes Fail
* fix: Decide Group Update Audits From the Atomic Write and Sanitize Permission Update Logs
* fix: Audit Grants From a Snapshot, Fail on Member Lookup Errors and Chunk Member Audit Entries
* fix: Audit Group Deletion Members and Previous Role Removal, Abort on Grant Snapshot Failure
* fix: Invalidate Config Caches After Partial Secret Writes
* fix: Retry Failed Cascade Restores, Report Changed Group Fields and Audit Every Reassigned Member
* fix: Log Safe Metadata When Cache Invalidation Fails After a Partial Write
* fix: Keep Error Messages Out of the Audit Write Failure Log
* style: Sort Audit Log Spec Imports
* fix: Sanitize Admin Handler Error Logs and Dispatch System Audit Writes Without Waiting
* 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: Expire Dead-Lettered Trigger Deliveries After a Review Window
* fix: Delete Stored Image Uploads When Record Creation Fails
* fix: Clean Up Stored Objects on Every Storage-Before-Record Upload Path
* refactor: Resolve the Delete Strategy Lazily in Stored Upload Cleanup
* test: Cover Dead Letter Expiry After the Review Window
* fix: Carry Owner to Stored Upload Cleanup and Keep Batch Dead Letter Deadlines
* refactor: Select the Stored Upload Cleanup Target in the API Package
* fix: Check for a Committed Record Before Deleting an Upload and Keep Dead Letters Unless Configured
* fix: Check the Persisted Record Id for Converted Assistants Images
* fix: Arm a Dead Batch Root Deadline After Its Members Settle
* fix: Settle Expired Dead Batches and Skip the Record Guard Before the File Write
* fix: Skip the Record Guard for Pre-Write Failures and Build the Lookup in packages/api
* fix: Build the Record Lookup Lazily in the Upload Service
* fix: Pass the Dead-Letter Retention Window Through Experimental Startup
* fix: Carry the Vector Copy Into Failed-Upload Cleanup
* fix: Cover the Code Environment and Indeterminate Vector Copies in Upload Cleanup
* fix: Give URL-Upload Cleanup a Request When the Caller Omits One
* fix: Route Failed-Upload Cleanup Through Secondary-Storage Deletion
* fix: Attempt Every Copy Independently When Cleaning Up a Failed Upload
* fix: Track the Record Write in Every Upload Path Whose Retention Lookup Can Fail
* fix: Enforce Terms Acceptance on the Server When modalAcceptance Is On
* fix: Mark Backfilled Terms Acceptance Timestamps
* test: Cover Server-Enforced Terms Acceptance in the Mock Harness
* fix: Gate Management Routes and Skill Sync and Resolve Terms Policy Fail-Closed
* fix: Evict Cached Auth Documents When Terms Acceptance Is Reset
* fix: Guard Skill Sync Behind Terms Acceptance for Every Skill List Route
* fix: Move Terms Skill-Sync Guard Into the API Package and Evict All Users on Reset
* fix: Batch Terms Reset Cache Eviction and Sign the Spec User In Fresh
* fix: Let Stop Through the Terms Gate, Refresh Startup Config, and Wait Out Failed Eviction
* refactor: Narrow the Terms Exemptions and Share One Refusal Path Across Clients
* refactor: Compose the JWT Terms Gate Through an API Package Helper
* style: Sort Imports for the Shared Terms Refusal Helper
* test: Expose the Terms Gate Helper in the JWT Auth Spec Mock
* test: Cover the Terms Refusal Code on Pre-Stream Upload Errors
* feat: Paint the Operator Theme on a First-Ever Visit
The server embeds the deployment's base interface.theme in the HTML shell, with both modes the build resolved for a bundled name, so the boot script and the first commit of DeploymentTheme paint it before /api/config answers. A tab's owned cache still outranks it, shared links skip it, and a request scoped by a trusted X-Tenant-Id header gets the shell without it.
* test: Type the Inline Shell Theme Fixture as Raw JSON
* test: Tag the First-Visit Scenarios Literally
* fix: Ignore a Theme Boot File That Is Not an Object
* fix: Keep the Base Theme for a Tenant Header the Config Rejects
* fix: Report a Theme Boot File That Exists but Cannot Be Read
* fix: Embed the Base Config Theme in the Experimental Shell
* test: Stand In the Shell Theme for an Owned Copy Whose Session Ended
* 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: Write User Provider Keys With Random-IV v3 Format
* fix: Reject Undelimited Input in decryptV2 Instead of Returning It
* fix: Default 2FA Backup Codes to the Strong Format
* fix: Limit Admin Secret Preview to the Last Four Characters
* fix: Re-Derive Stored Secret Previews Under the Last-Four Policy
* test: Build Legacy Credential Fixtures With the Server Key
* fix: Load Request Config for User Key Writes and Mask Legacy Previews
* 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
* fix: Stop Cache Audit From Logging Cache Keys and Values
* fix: Keep Cache Audit Output to Counts and TTL
* fix: Log Cache Audit at Info So the Debug Toggle Still Emits
* test: Cover Cache Audit Redaction in the Mock Lane
* test: Run Cache Audit Scenario Against In-Memory Stores
* test: Parse Cache Audit Probe Output Before Asserting
* fix: Render Cache Audit Statistics in the Message and Move Formatting to packages/api
* feat: Let Users Connect Their Own Account for Pull Request Lookups
* fix: Refuse Cross-Tenant Pull Request Callbacks and Surface Key Failures
* fix: Keep Pull Request Grants Through Outages and Remove Them on Disconnect
A token endpoint server error is an outage even with an OAuth error body, so
it no longer deletes the grant, and a refresh outage reaches the lookup as
unavailable instead of falling back to no token. Disconnect removes every
pr_oauth row of the user, whatever app or host is configured now. A grant that
never expires extends its retention when used, and the flow, request and
retention limits are configurable. The connection routes are built in
packages/api, mounted behind the pre-auth tenant middleware in both servers,
and answer failures with stable codes.
* fix: Keep the Pull Request OAuth App Out of Overrides
A role, group, user or tenant override can no longer change or remove pullRequests.oauth, so the connect capability and the callback see the operator's app.
* fix: Read a User's Pull Request Token Only With the Feature On
* fix: Report a Malformed Stored Pull Request Grant as a Failure
* fix: Remove a User's Stored Tokens When an Administrator Deletes the User
* fix: Answer No Pull Request for a Conversation Without a Lane When the User Token Fails
* fix: Share One Grant Read Between Concurrent Callers and Report an Expired Grant Disconnected
* fix: Remove a Pull Request Grant Only on a Definite Refusal and Past Its Retention
* fix: Version Pull Request Grants and Coordinate Refresh, Refusal and Retention Through Them
* fix: Invalidate a Refused User Token and Read It Only for a Lane That Needs It
* fix: Finish a Pull Request Connection Under the User's Effective Config Behind the Login Limiter
* fix: Type the Pull Request User Token for Isolated Declarations and Settle Retention Before Answering
* fix: Bind a Pull Request Connection Flow to the Generation a Disconnect Replaces
* fix: Start a Batch's User Token Read Only Within Its Deadline
* fix: Fence Pull Request Token Reads Against a Disconnect and Report a Failed Retention Cleanup
* fix: Fence Connection Status Like Token Reads and Keep a Newer Read Joinable
* fix: Report a Pull Request Grant Without Its App and Name the Sign-In That Made It
* fix: Read a User's Unexpired Pull Request Grants Newest First
* fix: Mark the Connection Callback as an OAuth Navigation and Report a Failed Extension
* fix: Name the Pull Request Sign-In Flow on Its Landing Page
* fix: Remove a Pull Request Grant of a Replaced App When It Is Read
* fix: Keep a Replaced App's Grant Untouched and Extend Retention From Each Day's Use
* fix: Accept a Pull Request Grant Only Under the User's Current Connection Generation
* fix: Renew the Connection Generation With a Grant Still in Use
* fix: Restore the Previous Connection When a Sign-In Cannot Store Its Grant
* fix: Decide a Sign-In by What Was Stored When a Write Does Not Answer
* fix: Roll Back a Sign-In's Generation Along With a Grant It Must Remove
* fix: Refresh an Access Token a Lookup Was Refused With Before Ending the Connection
* fix: Undo a Sign-In Only for a Confirmed Fence, Not a Failed Check
* fix: Read a User Token Again When the Connection Changes Under the Read
* fix: Apply the Current Retention Again When Another Replica Changed the Grant First
* test: Answer Each Concurrent Sign-In by Its Own Code
* fix: Skip Retention Rewrites for Grants That Expire Without a Refresh Token
* fix: Retry a Token Rejection That Loses to a Concurrent Grant Write
* fix: Skip User Token Reads for Lanes Without a Commit and Reread Status After a Reconnect
* feat: Share Pull Request Lookups Across Replicas Through Redis
* fix: Bound the Shared Pull Request Cache and Drop Commands at Their Deadline
* fix: Pass the Cache Config to the Pull Request Store and Check It Before a Local Cooldown
* fix: Keep Batch Lookups Apart by Cache and Sharing Policy
* fix: Share Only Found Pull Requests and Rate Limits, Never Moving Them Backwards
* feat: Look Up Bitbucket Cloud Pull Requests
* fix: Keep the Pull Request Host Out of Overrides and Per-Host Keys
A role, group, user or tenant override can no longer change or remove pullRequests.host, so feature gating and link recording see the operator's host. Links are recorded only from the configured host, and the batch share key and the rate limit cooldown are scoped by host.
* fix: Compare Pull Request Link Hosts Through the Host Resolver
* test: Add Pull Request Scenarios Against a Fake GitHub Enterprise Host
* fix: Keep the Pull Request Provider Out of Overrides and the Batch Share Key
A role, group, user or tenant override can no longer change pullRequests.provider, so feature gating and link recording agree with the lookup, and a batch lookup for one provider is never joined by a request for another.
* fix: Read GitLab History Apart From Open Merge Requests
Merged and closed merge requests are listed on their own, so open fork merge requests on the branch name cannot crowd them out. Rate limit cooldowns are scoped by provider, and a workspace repository with a dot segment is rejected.
* fix: Revalidate Bitbucket Pull Requests and Skip Ones Without a Source Commit
Read a full closed page so a newer closed fork cannot hide an older pull request from the repository, recheck the source branch and fork status on the detail, and treat a pull request without a source commit as unmatchable instead of failing the lookup.
* fix: Follow Bitbucket's Next Link When Listing Pull Requests
* fix: Record the Lane Pull Request Without an Aggregation Pipeline Update
* fix: Match an Empty Lane Repository as Unknown
* fix: List Locked GitLab Merge Requests With the Open Ones
* fix: Replace an Expiring Fake Git Host Certificate
* 🧯 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
* feat: Show the Conversation Pull Request in the Sidebar List
Add a batch lookup route and a sidebar row mark: the state icon with the CI dot, opening the same card beside the row on hover. The row keeps the conversation's own title.
* fix: Address Review Findings on the Sidebar Pull Request Batch and Row Mark
Cap the whole batch with a configurable deadline, make the row mark a keyboard-reachable button that opens the card on focus, refresh rows when the window regains focus through the shared batch, and show a retryable failure state instead of treating a failed first lookup as no pull request.
* fix: Send Sidebar Pull Request Batches One at a Time
Queue every batch request behind the one before it, so an oversized list or an overlapping flush cannot multiply the server's configured lookup concurrency, and bound how long one request may hold the queue so a request that never answers cannot stop the rest.
* fix: Keep the Batch Request Timeout Above the Server Deadline
Default the client's request timeout to just past the longest batchTimeoutSeconds a deployment may configure, so a queued request never starts while the previous request's server-side lookups are still running.
* fix: Keep Batch Lookups Inside the Concurrency Limit and Per-Entry Failures Per Entry
Share one lookup limiter across every batch request so lookups that outlive a request's deadline keep their slot, answer a missing token only for the conversations that needed it, and point the row at its pull request description only while that text is in the page.
* fix: Bound Batch Reads, Scope Concurrency Per Credential, and Gate the Sidebar on the Batch Version
Start the batch deadline when the request arrives and bound the config and lane reads, count lookup slots per credential, advertise a batch route version and ask only a server that has it, take no row space for an absent mark, show a failed refresh over a cached empty answer, keep a malformed response from stalling the request queue, and repair the lane recording tests that still used a mock removed on dev.
* fix: Move Capability Resolution Into the Package and Harden the Batch Route and Queue
Resolve the pull request startup capabilities in packages/api so the route stays wiring only, bound the config and lane reads by the configured deadline, merge identical lanes before taking limiter slots, fall back to the single route when a replica has no batch route, and dispose the batch queue when the signed-in user changes.
* fix: Abort the Batch Fallback With Its Request So the Queue Never Overlaps It
Give the batch fetcher the request's abort signal and pass it to every single-route call, abort a request that times out or is disposed, and stop the fallback workers from starting more calls once it has.
* fix: Forward the Abort Signal to the Batch POST
Pass the request's abort signal through the batch fetcher, the data-provider call and Axios, so a batch request that times out or is disposed is cancelled instead of continuing beside the next one, and settle a request promptly when it is aborted.
* fix: Close the Pull Request Lookup Follow-Ups and Cancel Abandoned Sidebar Rows
* feat: Show the Conversation Pull Request in the Chat Header
A header chip shows the pull request a code conversation opened: the agent picture with a CI status dot, the pull request icon and a truncated title. It opens a card with the number, added and removed lines, a link to GitHub, and state and checks badges. The chip renders nothing while loading, when there is no pull request, or when the first lookup fails.
* feat: Place the Pull Request Chip Beside the Model Controls and Move It to the Overflow Menu on Small Screens
On desktop the chip sits with the left header controls and its card opens to the right as an Ariakit hovercard that slides in from the left, on hover or keyboard focus. Small screens offer the same card from the header overflow menu through a dialog, following the dialog-item contract.
* fix: Address Review Findings on Pull Request Polling, Badges and Tooltip Layering
Advertise pullRequestsEnabled in the startup config and skip the lookup without it, keep polling a finished pull request while its checks run, render the card badges with the shared Chip, and portal the GitHub tooltip into the card's own layer.
* fix: Address Second Round Review Findings on the Pull Request Dialog and Chip
Scope the mobile dialog to the conversation it opened for and expose dialog semantics on its menu entry, only use the chat agent's avatar for the routed conversation, and make the hover tests move the pointer the way a browser does so they pass under NODE_ENV=development as CI runs them.
* 🏝️ 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.
* feat: Record Lane Git State and Serve Conversation Pull Requests
A conversation now stores the branch, head and repository its code lane last reported, written only by the server after a finished bash command and excluded from ordinary reads, generic saves, unset fields and imports. GET /api/convos/:conversationId/pull-request finds the pull request for that branch through an injected GitHub source with a bounded cache, answers null for an absence, and maps failures to stable codes without upstream text. The feature is off unless endpoints.agents.pullRequests is enabled with a token reference.
* fix: Address Review Findings on Pull Request Lookup and Lane Writes
Scope the lookup cache, shared in-flight request and rate limit cooldown to the credential, so one tenant's token never serves another. Ask for open pull requests on their own before falling back to the newest closed one, read every page of check runs up to a bound and never report an incomplete rollup as passing, order lane writes per conversation so an older write cannot land last, and name both required token permissions in the example config.
* fix: Address Second Round Review Findings on Pull Request Lookup
Clear the stored lane when the conversation moves to another workspace or leaves attached execution, so the previous workspace's pull request is never served. Fence the lane write on the time it was reported, so an older report from another replica cannot replace a newer one. Honor GitHub's reset window up to an hour instead of ten minutes, and expose the request timeout, whole lookup timeout and check run page limit as endpoints.agents.pullRequests settings with the previous values as defaults.
* fix: Authorize Pull Request Repositories and Fence Lane Writes
Require an administrator allowlist of repositories before the server token is used, since a worker reports its own repository. Match a pull request to the commit the conversation last ran at, so a reused branch name does not return another pull request. Fence the lane write on the workspace the command ran in, so a write queued before a move cannot bring the old lane back, and record a subagent thread's lane on the visible root conversation. Key the lookup cache and shared request by the recorded commit and the lookup policy, and document the worker flag in the example config.
* fix: Order Lane Reports by a Database Sequence and Tighten Head Matching
Replace wall clock ordering of lane reports with a per conversation counter reserved in the database when the command settles, so replica clock skew cannot reject a newer report. Treat a pull request whose head is behind the recorded commit as no match, and expose the candidate and comparison bounds of the history search as settings. Read the app config and the owner scoped lane together, inject the HTTP transport from the route instead of falling back to a global, skip a report identical to the last one written, and name the Contents permission that commit comparison needs.
* fix: Queue Lane Reports by the Visible Conversation and Read Checks for the Current Head
Order lane report reservations by the conversation the write lands on, so two subagent threads of one conversation share a chain, and write every report instead of skipping a repeat, since another recorder may have changed the lane in between. Read a pull request's detail before its check runs and use the head it reports, so line counts, mergeability and checks describe one commit. Treat an expired temporary chat as gone when reserving, writing and reading the lane, and make the shared cache capacity a setting.
* fix: Fence Lane Reports by Attachment Epoch and Place Recorders Before Reporting
Strip dotted descendants of lane fields from saves and imports, partition the pull request cache per credential, resolve the lane write target when the tool is created, and fence reports with a codeAttachmentEpoch that advances only on an owner move or detach.
* fix: Fence Subagent Lane Reports by the Root Epoch and Cover Forks and Moved Heads
Read the visible root's attachment epoch for a subagent report, gate lane recording on pullRequests.enabled, make the credential partition bound a config field, revalidate the detail head against the recorded commit, and find fork pull requests through the recorded commit.
* fix: Keep the Credential Cache Bound Deployment Wide and Budget Head Revalidation
Apply the largest configured credential bound to the shared cache, count cache hits as use, spend the comparison budget on a moved head, and fix the data-provider config default test.
* fix: Cool Down Headerless Secondary Rate Limits
A 403 whose message names a secondary rate limit now starts the credential cooldown for at least a minute instead of being cached as a ten second failure.
* 🔁 fix: Recover Concurrent First SAML, LDAP and Social Logins
SAML, LDAP and social logins looked the user up and then inserted it
with nothing in between, so two first logins for one new identity both
inserted and the unique index failed the second with E11000.
Every strategy now provisions first-login users in packages/api:
createUserOnce inserts through createUserIfAbsent and, on user_exists,
repeats the strategy's own lookup and resolves to the account that won,
once its creator finished provisioning it (its start balance exists when
one is configured), admitted exactly as a found account (a tenant
account resolves its tenant config and that config's email-domain policy
applies). provisionSamlUser, provisionLdapUser and provisionSocialUser
own the create / recover / refresh decision, so a recovered account gets
the same refresh as any account the login finds (claimSamlIdentity, the
LDAP directory overwrite, handleExistingUser), and the CJS strategies
only pass their models and services and map the result to passport.
The lookups take a plain FindUserByFields and the contracts carry
UserRecord and NewUserData. createOpenIDUser now goes through
createUserOnce.
Related to #16766
* ⚡ perf: Read a Recovered Account's Config and Balance Together
After losing the insert race, createUserOnce resolved the tenant config
and only then read the start balance, although the balance check now
depends only on the creation config. Both reads start together.
* 🚪 fix: Let Concurrent First OpenID Logins Continue as the New User
Two requests for the same not-yet-created OpenID identity both missed
findOpenIDUser and both called createUser; the unique email and OpenID
indexes rejected the second insert, and that login failed with E11000.
createUserIfAbsent (data-schemas) inserts a first-login user and reports
a lost race as { ok: false, error: { code: 'user_exists' } }. It
initializes the start balance under the new user's id before inserting
the user, so the account is never visible without it, and removes that
balance when the write fails or a unique index rejects the insert.
createUser shares the insert-only credit (creditStartBalance).
createOpenIDUser (packages/api) creates through it and, on user_exists,
repeats findOpenIDUser with its provider and issuer checks and continues
as the account that won, admitted and refreshed exactly as if the first
lookup had found it: the account's own config (tenant config for a
tenant account) and its email-domain policy apply, and applyOpenIDProfile
writes this callback's claims. It continues only once the winner
finished provisioning the account: when that config sets a start
balance, the balance must exist, which a previous-release creator
credits only after its insert. UserRecord and NewUserData are the plain,
storage-neutral contracts.
Related to #16766
* ↩️ fix: Hold a Recovered Login on the Creation Config's Start Balance
The provisioning barrier read the recovered account's tenant config.
With a tenant start balance the base config does not set, every
concurrent first login in that tenant failed again, because the winner
creates the user under the base config and login balance sync only
initializes the tenant balance afterwards.
The barrier guards against a previous-release creator's $inc landing on
a balance login balance sync already initialized, and that creator only
credits the base config's start balance. createOpenIDUser now holds the
recovered login only when the config new users are created under sets a
start balance; a tenant-only start balance is initialized insert-only by
login balance sync and cannot be added twice.
* fix: Keep Reasoning Out of Every Read Aloud Path
Read aloud spoke the Thoughts section along with the answer. The hover
button flattened think parts into the string it handed to TTS, browser
autoplay and the hooks parsed content without skipping reasoning, and
server streaming spoke the stored text field, which an aborted turn
persists with its reasoning included.
Add getSpeechText to data-provider as the single source for spoken text:
text parts only for structured content, and the legacy :::thinking block
stripped from plain text, treating a still-open block as reasoning so
streamed speech only ever grows. Route the hover button, browser
autoplay and server streaming through it, and skip reasoning in the TTS
hooks' own content parsing.
* fix: Speak String Message Content Without Its Reasoning
Imported or client-built messages can carry their answer as string
content rather than parts; read it like plain text instead of falling
back to an empty text field.
* fix: Keep Answers Between Repeated Legacy Thinking Blocks
Strip every closed :::thinking block before treating an unterminated one
as reasoning, so a second closed block no longer swallows the answer
that follows it.
* fix: Skip Read Aloud and Autoplay When Only Reasoning Remains
A turn stopped mid-reasoning has no answer to speak once reasoning is
filtered. Gate autoplay on the same speech text it will play, so the
external engine never opens a stream that can only time out, and hide
the Read aloud action when there is nothing to read. Every speech path
reads a finalized message, so speak an unmatched :::thinking marker as
the answer text the UI shows instead of dropping the rest.
* refactor: Move Speech Chunk Polling Into packages/api
The decision of what text to stream as speech lived in the legacy CJS
service. Move the chunk processor to packages/api as
createSpeechChunkProcessor, taking the message cache and lookup from the
caller, and leave streamAudio.js wiring them in. Its tests move with it
onto an in-memory cache instead of module mocks.
* fix: Speak Exactly the Answer the Message View Shows
Share the legacy :::thinking parser between the message view and speech,
so Read Aloud strips the same block the view collapses instead of a
separate pattern drifting from it. Trim structured speech text so a
whitespace-only answer is not speakable, and key autoplay's audio cache
by the spoken text, as manual playback already is, so audio cached with
reasoning before this change is never replayed.
* fix: Fall Back to Text When String Content Is Empty
* 📴 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
* 🧾 perf: Load Tool-Call Previews and Fetch Full Parts on Demand
Long agent conversations shipped every tool output, argument string and
subagent transcript on load, though the cards render collapsed: 12-18 MB
of message JSON per chat, enough to crash iPhone Safari tabs.
A client that adds ?toolPreviews=1 to the conversation load now receives
bounded previews of settled tool calls (start and end of long outputs,
JSON arguments and outputs kept valid with only their longest strings
shortened, exit-status trailers kept whole, subagent transcripts omitted)
with explicit markers and full lengths. Opening a card or a subagent
panel fetches the stored part from a new owner-scoped endpoint,
GET /api/messages/:conversationId/:messageId/parts/:partIndex, cached
under its own React Query key. Clients that do not ask, exports and share
links keep the full payload; bounds are configurable under
toolCallPreviews in librechat.yaml, and a client-authored message that
carries previews is refused rather than saved.
* 🧾 fix: Validate Part Reads in Parallel and Preview Fork Responses
The full-part read now starts beside conversation-access validation
instead of after it, and keeps the active-job fallback the conversation
read has, so a conversation still live before its first save can expand
its previews. Fork, duplicate and shared-link fork responses honor the
preview parameter, so they no longer seed the conversation cache with
the full history. Background-task results whose structure cannot fit a
valid JSON preview go whole, image cards keep their prompts, and the
subagent panel offers a retry when its stored part fails to load.
* 🧾 fix: Key Hydrated Parts by Preview Revision and Call Identity
A fetched part is now cached under the preview's revision and replaces
only the fields the server shortened, so a call whose stored output
changes later (a harvested background result) is fetched again rather
than rolled back. Part lookups carry the run-step and agent identity and
refuse an ambiguous fallback, since provider tool-call ids can repeat
within one response. A subagent that finished without final text has
its transcript omitted like any other settled call, and JSON nested past
a fixed depth falls back to a text preview; a call whose preview fails
is sent whole instead of failing the conversation load.
* 🧾 fix: Release Hydrated Parts With Their History and Bound JSON Work
Full tool-call parts fetched for a conversation are removed when its
message history is released or cleared, so they cannot outlive it under
their own key. The structure-preserving JSON preview now bails out before
cloning when the value has more nodes or strings than could ever fit,
keeps a __proto__ key as ordinary data, and the part endpoint accepts any
safe-integer index instead of an arbitrary ceiling.
* 🧾 fix: Count Property Names Before Cloning a JSON Preview
Property names are never shortened, so the pre-check now adds their
length to its budget and falls back to the text preview before any
cloning when they alone could not fit.
* 🧾 fix: Preview Artifact and Branch Responses and Rehydrate Subagent Prompts
Artifact edits and parallel-response branches merge the message the
server returns into the conversation cache, so both requests now ask
for previews and their routes honor it. The subagent panel reads the
prompt from the stored arguments once they load, and the part endpoint
no longer caps identifier length, so any previewed call can be fetched.
* 🧾 fix: Preview Only Tool Calls That Can Be Fetched Back by Identity
A call without an id has nothing but its position to name it, and the
position can shift on the client, so it is left whole instead of being
previewed. The part endpoint now requires a tool-call id, so an indexed
lookup always confirms the call it returns.
* 🧾 fix: Fetch Parts by Exact Identity and Preview Only Unique Ones
The part endpoint now finds a call by its exact identity (provider id,
run-step id, agent) instead of trusting the client's index, and the
preview pass only shortens calls whose identity is unique in their
message, so every preview names exactly one stored part. Legacy
web-search failures that carry their error phrase mid-output go whole,
since the collapsed card reads that phrase anywhere.
* 🧾 fix: Bound the JSON Fit Walk Before Queueing and Normalize Empty Identities
The structure check now counts an array's or object's children against
the node budget before queueing them, so a very wide value is refused
without building a work list its size. An empty run-step or agent id is
treated as absent by the part lookup, matching how the preview pass and
the client already treat it.
* 🧾 fix: Key Fetched Parts to the Stored Version and Hydrate Search Details
Each preview now carries `previewRevision`, when its message last
changed, and the client keys fetched parts to that plus a fingerprint of
the whole preview, so any change to the stored call is fetched again.
The web-search details card asks for the stored call when it opens, so
its query is never left shortened.
* 🧾 fix: Cache Fetched Parts by Identity and Hold Copy Until Hydrated
The part query key drops the client-side index, which only rides along in the request; the server locates the call by message and exact identity, so a shifted index serves the cached copy instead of downloading it again. Copy controls inside a previewed part are disabled until the stored content arrives, so a slow or failed fetch cannot export shortened text.
* 🧾 fix: Shape Shared Forks With the Recipient's Bounds and Keep JSON Numbers Exact
A shared-link fork resolves the share owner's config for its content checks, but the forked conversation belongs to the requester, so its preview bounds now come from the requester's tenant and role (prepareResultToolCallPreviews). A structure-preserving JSON preview now requires every number in the text to survive a parse and re-serialization as the same value; an integer past 2^53, an out-of-range exponent or an over-precise decimal falls back to the text preview (or the whole output for parsed-output tools) instead of showing a changed value.
* 🏝️ 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.
* 🧬 fix: Default Subagents to Their Parent's Code Machine and Workspace
A subagent resolved its code machine from its own saved fields only, so
when a chat routed the parent to an allowlisted machine the subagent fell
back to its own default and whatever workspace the conversation had
selected there, or failed the parent's whole turn when none existed.
Subagents now inherit the parent's resolved attached machine when it is
their own default or on their allowlist where per-chat choice applies,
the principal can use it, the sealed decision already selected it, and no
selection names the subagent as an explicit owner. Inheritance is derived
per request from the sealed decision and current agent configuration and
fed to every routing site; it is never persisted, so existing chats and
older clients get it without a decision change. The composer mirrors it.
A subagent whose machine has no usable workspace is advertised to the
parent as unavailable instead of failing the turn; a locked decision
stays fatal.
* fix: Inherit Across Every Spawning Path, Graph Members and Deferred Code Tools
A subagent now inherits only when every agent that can spawn it, at any
depth, runs on the same machine; spawn cycles keep their own routes.
Subagent graph members inherit like explicit subagents. The deferred
execute_code loader passes inheritance to its fallback resolver. Subagent
reads and VIEW checks move to a packages/api loader shared by inheritance,
lazy descriptors and graph members. The composer lets a draft's subagent
follow its parent's machine before a workspace is picked, and keeps an
inheriting subagent's former selection without asking for a move.
* fix: Prune Spawn Back-Edges, Gate the Composer on an Inheritance Capability
Spawning parents follow the run's path semantics, so a back-edge the
descriptor tree prunes no longer blocks inheritance, and agents that spawn
each other follow their single outside parent machine when it routes them
all there. Only admitted subagents count toward the walk's node limit.
Graph members re-read and re-check VIEW when they initialize. The composer
echoes an inheriting subagent's former selection without gating on that
machine, and mirrors inheritance only when the API advertises
codeWorkspaceInheritanceVersion; approval modes keep intersecting every
machine an agent could use.
* fix: Settle Each Mutually Spawning Group on Its Own
Independent spawn cycles no longer merge into one group, so a pair under
one parent follows that parent even when another pair follows a different
machine. Also types the data-provider spec for its ES5 target.
* fix: Bound the Inheritance Walk, Normalize Parallel Roots, Move Subagent Availability to TS
The walk reads in batches no larger than the remaining node budget, stops
once the limit is reached, and runs through the run's subagent load limiter.
Roots are keyed by saved agent ID, so a parallel root such as id____1 can
never receive an inheritance entry. Resolving a lazy subagent's code route,
reporting it unavailable, and guarding its descriptor now live in
packages/api (resolveSubagentCodeAvailability, guardUnavailableSubagent).
* fix: Keep Missing Subagent Loads Parallel Near the Node Limit
Batches never shrink below eight IDs, so missing or unviewable subagents
near the limit still load in parallel under the injected limiter, and at
most a handful of reads land past the limit.
* 🔗 feat(agents): use LibreChat prompt groups as agent instructions
Agents can link a prompt group revision or Production as their instructions. The link resolves at the start of each turn through a cached resolver. The cache clears on promote and delete. Editors without VIEW on the group see a restricted placeholder.
* fix: remove duplicate logger import from agent initialization tests
* fix: honor prompt management capabilities for linked agent instructions
* test: seed prompt manager capabilities in authorization fixtures
* fix: clear acknowledged linked prompt edits before version restore
* test: adapt merged chain coverage to prompt-aware payload helper
---------
Co-authored-by: Lia <lia@librechat.ai>