Commit graph

1844 commits

Author SHA1 Message Date
Marco Beretta
225aa91d0a
🩹 fix: Stub the Attached Route in the Lane Recording Specs (#16840) 2026-10-06 20:03:40 +02:00
Marco Beretta
abed1a29e3
🔀 feat: Show the Conversation Pull Request in the Chat Header (#16794)
* 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.
2026-10-06 15:26:08 +02:00
Danny Avila
6b5cf0a231
🏝️ fix: Apply the No-Workspace Decision Wherever an Agent's Code Route Resolves (#16798)
* 🏝️ 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.
2026-10-06 07:40:42 -04:00
Marco Beretta
ae44437e16
🗂️ feat: Record Lane Git State and Serve Conversation Pull Requests (#16793)
* 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.
2026-10-06 09:56:22 +02:00
Marco Beretta
9068f0e922
🔇 fix: Keep Reasoning Out of Read Aloud (#16790)
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
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 Votes / vote (full suite) (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/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) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
* 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
2026-10-05 23:44:39 +02:00
Marco Beretta
cac13c42e7
🧷 fix: Finalize Stopped Compactions and Verify Their Anchor (#16551)
* 📴 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
2026-10-05 21:38:22 +02:00
Marco Beretta
edc96d549e
📴 fix: Persist Cancelled Compactions With Their Identity (#16436)
* 📴 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
2026-10-05 21:38:04 +02:00
Danny Avila
0fea0240d6
⏳ feat: Reset Balance Allowances Without Rollover (#16781)
* feat: add periodic balance reset without rollover

* fix: synchronize balance policy before periodic reset

* style: preserve context balance class order

* fix: Synchronize Reset Policy Before Granting Allowances

* fix: Apply Current Balance Policy During Admission
2026-10-05 11:44:00 -04:00
lia-by-librechat[bot]
114394c6a0
🦉 feat: Compare Review Commit Ancestry Without Git (#16734)
* 🦉 feat: Compare Review Commit Ancestry Without Git

* test: Cover Attached Reviewer Compare Registration

* 🦉 feat: Compare Review Commit Ancestry Without Git

* test: Cover Attached Reviewer Compare Registration

* 🦉 feat: Use SDK GitHub Comparison With Host Eligibility Gates

* test: Await the Comparison Timeout Assertion

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-05 08:20:51 -04:00
Danny Avila
3f442e4dbe
🪶 perf: Load Tool-Call Previews and Fetch Full Parts on Demand (#16753)
* 🧾 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.
2026-10-05 07:42:45 -04:00
Danny Avila
3a32d8b0d3
🏝️ fix: Let a No-Workspace Turn Carry a Remembered Approval Mode (#16763)
* 🏝️ 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.
2026-10-05 07:28:28 -04:00
Danny Avila
301f9ac634
🚕 feat: Add Per-Call Subagent Machine Selection (#16757)
* 🧭 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.
2026-10-05 06:21:15 -04:00
lia-by-librechat[bot]
1418d44ad9
🕊️ feat: Supply Authorized Scheduled MCP Resource Bearers (#16699)
* 🕊️ feat: Supply Authorized Scheduled MCP Resource Bearers

* 🥟 fix: Preserve Scheduled Bearer Denials and Request Headers

* 🪼 fix: Retain Bearer Denials Across Scheduled Recovery

* 🐡 fix: Retain Unsettled Scheduled Generation Evidence

* 🧭 fix: Recover Retained Scheduled Generation Obligations

* 🪢 fix: Drive Retained Recovery in Every Scheduler Mode

* 🦔 fix: Fence Complete Scheduled Denial Receipts

* 🪵 fix: Require Durable Scheduled Denial Acknowledgement

* 🕯️ fix: Preserve Fresh Terminal Writers During Cleanup

* 🪷 fix: Preserve Durable Scheduled Receipt Acknowledgements

* 🧿 fix: Acknowledge Scheduled Evidence Before Erasure

* 🧪 test: Verify Merged Scheduled Receipt Union in Redis

* 🪡 fix: Deduplicate Merged MCP Agent Context

* 🪷 fix: Reauthorize Scheduled MCP Transport Requests

* 🛟 fix: Preserve Scheduled Catalog Authority Denials

* 🛟 fix: Fence Scheduled Dispatch and Stale Owner Settlement

* 🛟 fix: Gate Scheduled Cleanup on Owner Evidence

* 🛟 fix: Preserve Scheduled Drain and Transport Rejection Evidence

* 🛟 fix: Quiesce Scheduled MCP Before Occurrence Settlement

* 🛟 fix: Fence Scheduled Owner Recovery and Back Off Receipt Admission

* 🛟 fix: Index Initially Retained Scheduled Generations

* 🛟 fix: Require Durable Admission for Scheduled Policy Denials

* 🛟 fix: Abort Occurrence Bearer Work Before Quiescence

* 🛟 fix: Cancel Connection Credential Waiters During Failed Initialization

* 🛟 fix: Fence Scheduled HTTP Dispatch at the Cancellation Cutoff

* 🛟 fix: Bind SDK Request Deadlines to Scheduled Denial Admission

* 🛟 fix: Recover Retained Creation and Isolate SDK Caller Cutoffs

* 🛟 fix: Fence Scheduled App Reads and Share Cold Connection Ownership

* 🛟 fix: Retain Observed Scheduled Denials Across Caller Cancellation

* 🛟 fix: Invalidate Retained Discovery on Each Re-Arm

* 🛂 fix: Classify Scheduled Resource 403 as Permission Denial

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-04 22:20:50 -04:00
Danny Avila
c23fbc8f77
🧬 fix: Default Subagents to Their Parent's Code Machine and Workspace (#16756)
* 🧬 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.
2026-10-04 22:19:00 -04:00
Atef Bellaaj
3c90cde7d8
🔗 feat: use LibreChat prompt groups as agent instructions (#16686)
* 🔗 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>
2026-10-04 21:27:26 -04:00
lia-by-librechat[bot]
af35fe5439
🪚 chore: Deprecate Agent Chain Authoring (#16745)
* feat: consolidate orchestration into a native tool

* test: complete persisted subagent graph fixture

* fix: keep orchestration pickers inside the modal focus scope

* chore: deprecate agent chain authoring

* fix: preserve runtime-equivalent legacy handoff classification

* test: stabilize orchestration dialog lifecycle coverage

* test: wait for stream completion before final title polling

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-04 17:36:13 -04:00
Marco Beretta
8ae65f28dd
⚡ perf: Async Local File Saves and Compile Hot-Path Regexes Once (#16712)
* perf: Async Local File Saves and Compile Hot-Path Regexes Once

* perf: Check Closing Code Fences Without a Per-Length Regex Cache

* test: Build the Delivery Route Config Before Routing Instead of Mutating It

mergeFileConfig now memoizes by config identity, so the CSV fallback tests
must set textFallbackWithoutTools when they build the request config rather
than mutate the object after the agent's routing already merged it.

* fix: Write Local Buffers Atomically So Concurrent Saves Cannot Interleave

Async writeFile calls to one deterministic path (OpenID and SAML avatars)
could truncate and interleave each other. Write through a temp file and a
rename instead, and add scenario specs for local saves and longer closing
fences.

* refactor: Move Local Save Logic Into packages/api

saveLocalBuffer, the temp-upload move and the atomic directory writes now live
in packages/api/src/storage/local.ts and receive their paths from the caller;
the Local strategy in /api keeps its logging and calls through. The traversal
check now runs before any directory is created.

* fix: Copy Moved Uploads Through a Temp File and Rename Into Place

Concurrent async copies to one destination could interleave just like direct
writes, so moveLocalFile now fills a sibling temp file and renames it.

* fix: Contain Every Local Write and Move Inside Its Target Directory

The traversal check that guarded saveLocalBuffer now runs in writeLocalFile
and moveLocalFile too, before any directory is created, and the buffer
save accepts only the images and uploads base paths.

* test: Define the Success Assertion Inside the Local File Saves Scenario

* fix: Give Atomic Write Temp Files a Fixed-Length Name So Long Targets Still Fit

* test: Send Image Dimensions and Read the Message Array in the Local Saves Scenarios
2026-10-04 15:52:55 -04:00
lia-by-librechat[bot]
0e3c9088f6
🫰 feat: Configure Tool Approval Modes Per Agent (#16707)
* 🫰 feat: Configure Tool Approval Modes Per Agent

* fix: Fence Remembered Tool Approval Authority

* fix: Unify Tool Approval Execution Invariants

* fix: Revalidate Learned Approval at MCP Invocation

* fix: Preserve One-Time MCP Review at Invocation

* fix: Execute Reviewed Calls on Templated MCP Connections

* fix: Scope Approval Witnesses to Executing Agents

* fix: Retain Approval Bindings for Hook-Rewritten Inputs

* fix: Pin Review Authority and Retire Settled Tool Calls

* fix: Fingerprint Effective MCP Request Headers

* fix: Preserve Routing Around Renewable MCP Token Fragments

* fix: Bind Tool Consent to OAuth Credential Generations

* test: Keep Mobile Approval Save Outside Drawer Escape Race

* fix: Fence OAuth Consent at MCP Transport Retries

* fix: Let Shared Agent Viewers Reset Personal Consent

* fix: Preserve Renewed Consent Across Reset Races

* fix: Resolve Verified Aliases for Personal Tool Reset

* fix: Fence Renewed OAuth Consent and Credential Review

* fix: Require Foreground Execution for Review-Only MCP Calls

* fix: Pin Invocation Ownership and Stable MCP Consent

* fix: Fence Superseded Tool Consent Completion Writes

* fix: Scope Consent Epochs to Effective MCP Authentication

* fix: Scope Approval Admission to Reachable Agent Tools

* fix: Preserve Approval Epochs for Runtime-Detected OAuth

* fix: Address Tool Approval Review Findings

* fix: Preserve Captured Consent When Tool Approval Is Inherited

* fix: Preserve Approval Admission Through Lazy Metadata

* fix: Fence Programmatic Reviews and Unresolved Lazy Approval Keys

* fix: Account for Normalized and Skill-Contributed Lazy Tools

* fix: Scope Lazy Approval to Selected Tool Spellings and Servers

* fix: Honor Disabled MCP Capability During Lazy Approval Admission

* test: Preserve Approval Merge Regressions After Rebase

* fix: Preserve One-Time Review During Non-OAuth Grant Outages

* fix: Retain One-Time Consent Across Resume Recovery

* fix: Preserve Reviewed Consent Through Transport Outages

* fix: Preserve Case-Variant Lazy Approval Hook Admission

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-04 13:14:48 -04:00
Danny Avila
b6b24741da
🗝️ fix: Strengthen Two-Factor Recovery Credentials (#16742)
* fix: Strengthen Two-Factor Recovery Credentials

* fix: Declare Recovery Helper Return Types

* fix: Consume Recovery Codes Atomically

* fix: Stage Recovery Code Rollout and Improve Input
2026-10-04 12:16:37 -04:00
Tómas Pálsson
5e4ecbc24c
🧹 fix: Let File Deletes Succeed When the Code API No Longer Serves the Ref's Profile (#16671)
deleteCodeEnvFile rethrew every error except 404. A deployment that only serves
the stateful profile answers a default-profile delete with 409
execution_profile_mismatch on every retry, so the file landed in failedFileIds,
its record and agent references stayed, and agents holding it aborted every code
turn with "Failed to provision N file(s) to the code environment". The mismatch
is now handled like an absent object: logged, and the delete proceeds. Other
409s, 5xx, auth and network errors still fail the delete.
2026-10-04 11:38:31 -04:00
Danny Avila
741978c954
🔭 feat: Recover Stale Chunks Without the Error Page and Ship Client Logs to RUM (#16701)
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
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 Votes / vote (full suite) (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/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) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
* 🔭 feat: Recover Stale Chunks Without the Error Page and Ship Client Logs to RUM

Stale chunks: a tab left open across a deploy that opens a code-split panel
requests a hashed chunk the new deploy removed. Vite's preload handler hands
the failure to the stale-asset recovery, which reloads, but the import then
resolves to `undefined` and `React.lazy` throws a TypeError into the route
error boundary, so the error page flashes before the reload. Lazy imports now
go through `lazyWithRecovery`/`importWithRecovery`, which turn that result into
a `ChunkLoadError`; the route boundary recognizes chunk failures (and any error
while a recovery reload is underway), asks the page recovery once, and renders
a localized "Updating to the latest version…" status. When the loop guard
declines, the normal error page with its reload action shows instead. The
page recovery is now idempotent within a page, so concurrent callers join the
in-flight reload rather than tripping the guard.

Client logs: with RUM in proxy mode, the client logger's warn/error calls,
error-boundary catches and stale-asset recovery events are exported as OTLP
log records through the authenticated `/api/rum/v1/logs` proxy. Records carry
allowlisted, scrubbed fields only, follow RUM session sampling, dedupe repeats
with a count, are budgeted per minute and per page, batch with backoff, flush
with keepalive on page hide, and stop after persistent failures. The proxy
now refuses non-OTLP content types and applies a per-user rate limit.
`RUM_CLIENT_LOGS=false` turns the export off.

* 🔒 fix: Keep Client Logs Opt-In and Drop Application Error Messages

- RUM_CLIENT_LOGS now defaults to off, like console capture, so enabling
  RUM proxy mode never starts a new log stream on its own.
- Error messages are exported only for engine, browser and library
  generated types (TypeError, SyntaxError, DOMException, AxiosError,
  chunk failures); application errors keep type, status and stack only,
  since their messages can echo prompt or response text. All quoted
  fragments are now redacted.
- Batches are measured in encoded UTF-8 bytes of the exact request body,
  and page hide drains every queued record that fits the keepalive quota.
- Queued stale-asset events are delivered as soon as the log exporter
  starts, independent of the RUM SDK loading, and marked so they are
  never logged twice.

* 🔒 fix: Export Only Known Generated Error Messages and Ack Queued Events

- Error messages are exported only when the whole text matches a known
  engine, browser or library message shape (property access on
  undefined, "x is not a function", fetch/abort/axios status, chunk and
  CSS preload failures). The error class alone no longer qualifies, since
  any code can throw a TypeError carrying arbitrary text.
- Queued stale-asset events are marked logged only after the collector
  accepts the record carrying them, so an undelivered event replays on the
  next page; in-flight events are skipped by the SDK path.
- A fractional RUM_PROXY_USER_MAX below one falls back to the default
  instead of flooring to a limit of zero.

* 🔒 fix: Hold Unacknowledged Asset Events, Re-send In-Flight Logs on Hide

- The RUM SDK flush no longer drops queued stale-asset events whose client
  log record is still unacknowledged: they stay queued and persisted,
  flagged so their SDK action is not repeated, and leave the queue once
  the collector accepts the record.
- Page hide re-sends the records of an unanswered regular request with
  keepalive; each record belongs to the latest request carrying it, so a
  late response to the original request neither marks nor requeues it.
- Client-log export stops when the authenticated layout unmounts.
- The proxy refuses /v1/logs while client logs, console capture and replay
  are all off, so turning RUM_CLIENT_LOGS off also stops tabs that still
  hold an older startup config.

* 🔒 fix: Export Only Complete Stack Frames, Never the Message Header

Stack reduction now strips the V8 `name: message` header (including every
line of a multi-line message) and keeps only lines with a complete V8,
Gecko or WebKit frame shape that ends in a URL or absolute path with a
line number. A message ending in a source-position-like suffix can no
longer pass as a frame.

* fix: centralize RUM delivery and asset recovery lifecycle

* fix: preserve RUM page lifetime and collector acknowledgements

* fix: retain page transport quotas and recover functional chunks

* fix: scope RUM client sessions to authenticated identity

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-03 23:17:56 -04:00
lia-by-librechat[bot]
19092e55bd
🖲️ fix: Enable Running Chat Menus and Preserve Renamed Titles (#16697)
Reconciles current dev while preserving manual title ownership, existing menus, and configuration regressions.

Co-authored-by: Lia <lia@librechat.ai>
2026-10-03 23:17:15 -04:00
lia-by-librechat[bot]
5674faaa01
🪀 fix: Separate Workspace Admission and Transport Budgets (#16728)
* fix: Separate workspace admission and transport budgets

* fix: Validate workspace run reserves and retry test types

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-03 21:22:30 -04:00
lia-by-librechat[bot]
38a9dab3f5
🦫 feat: Enforce Scheduled MCP Read-Only Authority (#16681)
* feat: enforce scheduled MCP read-only authority

* fix: preserve startup admission and enforce consent deadline

* fix: fail closed on malformed scheduled consent

* fix: preserve scheduled MCP authority failure receipts

* fix: preserve scheduled MCP handoffs and manual runs

* fix: persist mandatory scheduled tool policy denials

* fix: fence late scheduled consent and retain denial recovery

* fix: retain scheduled transport denials and prevent replay

* fix: merge retained scheduled denials during settlement

* fix: prevent enrolled schedule completion wakeup escapes

* fix: close scheduled consent admission and receipt races

* fix: retain scheduled completion authority across approval

* fix: retain safe scheduled authorization dependency denials

* fix: sanitize scheduled authorization preparation failures

* fix: bind schedule completion authority to task origin

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-03 20:39:43 -04:00
Lia
c41413ad21 fix: Keep Manual Unread Reminders in Date Groups 2026-10-03 17:56:52 -04:00
Marco Beretta
6f4e36665e
🗄️ perf: Cut Serial and Redundant Database Reads (#16711)
* perf: Cut Serial and Redundant Database Reads

* perf: Pick the Earliest Balance per User in MongoDB
2026-10-03 10:41:47 -04:00
Marco Beretta
7957d0b587
🧾 fix: Commit Resume Provenance With the Approval Claim (#16430)
* fix: persist approval provenance in the resume claim and publish the pre-claim paths from any unapplied abort

The claim CAS now records the provenance it replaces. An abort that lands
before the resumed provider crosses its start CAS publishes those paths, so
schedule deletion, account deletion and user stops no longer label
model-authored chunks as user-submitted.

* test: add approval provenance scenario on the shared approval e2e helpers

* test: seed an earlier started segment before the unapplied abort case

* fix: label abort provenance by the published content and persist the same selection

A path the approval claim added is user-authored only once its tool call
carries output in the abort content, so an abort between the provider
start CAS and the resumed tool keeps the pre-claim labels, and an ask
answer stamped by the abort route keeps its own. AbortResult.jobData
carries the selection so the persisted row matches the final event.

* fix: keep claimed non-tool provenance paths on an abort

Only tool-call paths wait for their resumed call to complete; a steer the
claim already found in the seed content needs no decision to apply.

* fix: count a completed tool call with an empty output as applied in abort provenance

* fix: check abort provenance on the unfiltered content and remap it onto the published parts

* test: type the abort provenance overrides with the job store field names

* test: assert the preserved paths when an unanswered ask aborts
2026-10-03 13:31:20 +02:00
Marco Beretta
fb1dd57a9b
🔓 feat: Remember Tool Approvals Per Conversation (#16557)
* feat: Remember Tool Approvals Per Conversation

Adds an opt-in "Always allow" choice to the tool approval card. When
endpoints.agents.toolApproval.allowAlways is true, the server marks eligible
paused calls with allow_always; approving with scope "session" stores that
exact tool name on the conversation, and later runs in the same conversation
fold the stored names into the policy as exact-name allow entries.

The server enforces every step: the resume route rejects a session scope the
pause did not offer, eligibility is rechecked against the live policy before
storing, the list is written only through an owner-scoped bounded method, and
generic saves and imports cannot set or clear it. Admin deny and ask rules and
programmatic hooks still win, stored names are ignored under dontAsk or when
the flag is off, and native code tools stay under the code approval picker.
The flag defaults to false, so existing deployments keep prompting.

* fix: Share the Effective Approval Policy and Persist Allows After Resume Fences

Offering, resume re-check, scheduled admission and createRun now read one
policy from buildEffectiveToolApprovalPolicy: endpoint rules healed against
MCP alias spellings, then the conversation's remembered tools. A call held by
a healed ask rule is no longer offered "Always allow", and a scheduled fire
whose known tools are all remembered is no longer rejected as pause capable.

The remembered-tools cap and name length cap move to
toolApproval.allowAlwaysMaxTools and allowAlwaysMaxToolNameLength (defaults
64 and 256). The card stops offering the choice for new tools once the cap is
reached instead of silently approving once.

The resume route stores remembered tools only after the schedule and project
context fences pass; a storage failure still approves the call once.

* fix: Offer Always Allow Only When It Will Hold

Offer allow_always only when storing the name would auto-approve the next
identical call on the run's own path: every MCP spelling of the tool passes
the healed static policy and no programmatic or plugin approval hook can
apply to it (the pause payload does not record which hook asked).

Remembered names now expand to every alias spelling of the same tool, and a
deny or ask on any spelling keeps the tool ineligible. A table-driven spec
walks the invariant through the real hook wiring.

* fix: Recheck Approval Hooks Before Remembering a Resumed Approval

The resume-time eligibility recheck now applies the same programmatic and
plugin PreToolUse hook check as marking, with a hook context built from the
resume request and the live plugin hook source. A hook registered after the
pause turns the choice into a one-time approval: nothing is stored and the
resume continues.

Document that toolApproval.allowAlways should be enabled only once every
replica supports it, since older replicas ignore the choice.

* fix: Judge Always Allow Offers Against the Run's Live Aliases and Active Cap

* fix: Charge Only New Tool Names Against the Remembered Approval Cap

* fix: Recheck Remembered Approvals Against the Paused Run's Aliases

* chore: Sort Imports in Agent Run After Rebase
2026-10-03 11:47:32 +02:00
Danny Avila
76fcf0a6eb
📝 docs: Describe Attached-Workspace Lanes, Sandbox Scratch, and Skill Files in Tool Descriptions (#16702)
* 📝 docs: Describe Attached-Workspace Lanes, Sandbox Scratch, and Skill Files in Tool Descriptions

- Lane-mode `cwd` now states that any call outside `.worktrees/<name>` (with or
  without cwd, and file tools on such paths) is checkout-wide: it waits for
  running worktree calls and blocks new ones until it finishes, so checkout-wide
  calls are reserved for creating, pruning or removing worktrees.
- `command`/`cwd` state that the command starts in cwd, so the model does not
  also cd into it; the lane-mode cd hint says the call ran checkout-wide.
- Workers advertising the native SRT sandbox profile (`anthropic-srt`,
  `anthropic-srt:<preset>`) get a bash bullet that / and /tmp are read-only and
  scratch files belong in $TMPDIR or the workspace. Carried as
  `codeWorkspace.nativeSandbox` into tool definitions and the bash tool.
- The attached skill-aware `read_file` description says skill files are not on
  the attached machine and must be written into the workspace to run there.
- Tightened the attached bash description so the native variant stays within
  the 1024-character tool description limit.

* 📝 fix: Keep the Skill-Copy Warning on the Command-Only Workspace's Skill read_file

A workspace that offers execute_command but not read_file falls back to the
skill-only read_file definition. It now carries the same sentence as the
attached skill-aware definition, so the model knows bash_tool cannot reach
skill files by path there.

* 📝 fix: Name bash_tool in the Skill-File Warning Only When It Is Registered

The skill-copy sentence on attached read_file definitions now depends on the
attached bash_tool being registered beside it (includeBash and an advertised
execute_command), for the attached skill-aware definition, its custom
line-limit variant, and the skill-only fallback. Workspaces without commands
keep the plain skill description.
2026-10-03 05:23:53 -04:00
lia-by-librechat[bot]
de7755b4ca
🕊️ fix: Keep Attachment History From Locking Conversations (#16690)
* 🕊️ fix: Keep Attachment History From Locking Conversations

* test: Correct Attachment Regression Fixtures

* fix: Preserve Current Attachment Admission During Steering

* fix: Release Historical Attachment Counts After Failed Steering

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-02 20:21:19 -04:00
Danny Avila
2529b22a66
🔕 fix: Log Lost Generation Predecessor Fences as Warnings (#16689)
A conditional generation create that loses its predecessor fence is an expected admission outcome: the store rejects before replacing anything, an automatic continuation defers without consuming an attempt, and a client restores its queued turn. Sibling background-tool wake-ups for one conversation race this fence by design, which logged every lost race as an initialization error with a stack.

Route the controller's initialization-failure log through a typed packages/api helper that logs a predecessor mismatch as a concise warning with the stream, conversation, continuation flag, and whether the current generation is active, and keeps every other failure at error level as redacted text.
2026-10-02 20:12:22 -04:00
Danny Avila
1a8d23e1ed
✅ feat: Default Machine Selection and Linked-Worktree Lanes On (#16678)
* ✅ feat: Default Machine Selection and Linked-Worktree Lanes On

Per-chat machine choice from an agent's saved allowlist and linked-worktree
lane routing were both opt-in, so neither worked until a deployment found and
set its flag. Both are now on unless set to false: machine choice still only
applies to agents with a saved allowlist, and lanes still require a worker
that advertises git_linked_worktree. One helper per flag in data-provider
decides the default for every server reader and the advertised client config.

* feat: Advertise the Code Environment Decision Protocol by Default

Per-chat machine choice needs the conversation decision protocol, which the
client requires before offering allowlisted machines, but the protocol was
only advertised when CODE_ENVIRONMENT_DECISION_VERSION=1. With selection on
by default, authors could save an allowlist the composer never offered.
An unset or blank value now advertises protocol v1; any other value, such as
0, keeps the legacy-safe path.

* fix: Turn Machine Choice Off With the Decision Protocol Opt-Out

CODE_ENVIRONMENT_DECISION_VERSION=0 stopped advertising the protocol but
routing still accepted a non-default machine, so a cached tab or a direct
client could persist a choice during a mixed-version rollout. Machine choice
is recorded through that protocol, so isCodeEnvironmentSelectionEnabled now
requires both, for routing and for the advertised endpoints config. The
protocol resolver moves to code/protocol.ts (re-exported from code/config)
so execution and endpoints can use it without an import cycle.

* style: Format checkout routing regression cases

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-02 20:08:35 -04:00
lia-by-librechat[bot]
f88f3fb2fe
🪇 perf: Coalesce Ready Background Completions (#16650)
* 🪇 perf: Coalesce Ready Background Completions

* fix: Recover Receipt Batches and Gate Rolling Deploys

* fix: Fence Background Batch Handoffs and Cleanup Epochs

* fix: Bind Resumed Cleanup to Its Observed Batch

* fix: Preserve Background Results Through Recovery Handoffs

* fix: Recover Unconfirmed Manual Background Claims

* fix: Fence Automatic Recovery of Manual Handoffs

* fix: Preserve Background Reconciliation and Recovery Retention

* fix: Preserve Replayed Claims and Finish Follower Proofs

* fix: Recover Stale Background Projection Epochs

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-02 15:03:22 -04:00
lia-by-librechat[bot]
bb0543fd15
📼 fix: Replay Running Subagent Activity (#16541)
* 📼 fix: Replay Running Subagent Activity

* 📼 fix: Preserve Activity Across Rollouts and Reconnects

* 📼 fix: Backfill Missing Foreground Activity

* 📼 fix: Fence Replay and Drain Admitted Activity

* 📼 fix: Close Subagent Replay Review Gaps

* 📼 fix: Resume Activity After Replay Recovery Expires

* 📼 fix: Use Singular Subagent Omission Copy

* 📼 fix: Preserve Public Replay and Displayed Activity

* 📼 fix: Write Expanded Live Activity Before Queuing

* 📼 fix: Track Disjoint Subagent Replay Coverage

* 📼 fix: Preserve Tool Details and Omission Totals

* 📼 fix: Recover Tool Timing During Replay Backfill

* 📼 fix: Reconcile Covered Replay Timing Metadata

* 📼 fix: Restore Message Phases During Replay Backfill

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-02 13:24:47 -04:00
lia-by-librechat[bot]
19a337da46
🛖 fix: Scope OAuth Binding Cookies to the Public API Path (#16649)
* 🛖 fix: Scope OAuth Binding Cookies to the Public API Path

* fix: Canonicalize OAuth Callback and Cookie Paths Together

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-02 13:21:49 -04:00
lia-by-librechat[bot]
73d704656e
📔 feat: Preserve Owner Text During PII Redaction (#16311)
* 📔 feat: Preserve Owner Text During PII Redaction

* 🧵 fix: Keep Ordinary Chat Views Outside Private Text Provider

* 🧷 fix: Preserve Owner Text Across Copy and Edit Paths

* 🔏 fix: Protect PII on Denial and Abort Paths

* fix: preserve protected text through denial, stop, and owner reload

* test: cover preliminary private metadata in disconnect fixture

* test: carry preliminary metadata in resume controller fixture

* test: preserve Stop prerequisite identity in tenant fixture

* fix: keep protected owner text out of search and exports

* fix: preserve trusted PII placeholders through provider inspection

* fix: coordinate protected turns across Stop and native sharing

* fix: Preserve Private Text Admission and Query Lifecycles

* fix: Track Private Query Effect Dependencies

* fix: Fence Protected Admission and Screenshot Targets

* fix: Share Protected Admission and Preserve Native Token Trust

* test: Wait for Private Message Concurrency Indexes

* fix: Preserve Protected Admission Across Recovery and Titles

* fix: Coordinate Protected Root Admission and Early Stop

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-02 11:43:10 -04:00
Atef Bellaaj
7c4cfa8684
♻️ refactor: Native Prompts Behind a Shared Service and Adapter (#16506)
* ♻️ refactor: Native prompts behind a shared service and adapter

* test: Bound Slow Mongo Fixture Startup and Guard Cleanup

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-02 08:40:39 -04:00
ethanlaj
90526cdc16
📧 fix: Pass requireTLS So EMAIL_ENCRYPTION=starttls Requires STARTTLS (#16656)
The SMTP transport options set `requireTls`, but nodemailer only reads
`requireTLS`, so the key was ignored. With EMAIL_ENCRYPTION=starttls,
a server that does not offer STARTTLS received the message over an
unencrypted connection instead of the send being refused.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 08:39:04 -04:00
Danny Avila
2eee568542
🧳 feat: Choose Agent-Allowed Machines For New Chats (#16651)
* feat: Let New Chats Choose Agent-Allowed Machines

* test: Keep Machine Choice Contracts And Native Selectors In Sync

* fix: Preserve Graph Machine Choices And Reference Lifecycles

* fix: Explain Graph Workspace Requirements And Validate Machine Choices

* test: Cover Default And Non-Default Graph Machine Choices

* test: Keep Unauthorized Machine Duplication Mocks Isolated

* fix: Preserve Graph Agent Machine Ownership And Explain Requirements

* fix: Preserve Stable Workspace Ownership Across Runtime And Config Changes

* test: Wait For Verified Generation Readiness In Native Canaries
2026-10-02 08:38:14 -04:00
lia-by-librechat[bot]
3f3de65612
🪔 feat: Add Bound Scheduled MCP Consent (#16652)
* test: reuse reviewed scheduled MCP authorization fixtures

* feat: add bound scheduled MCP consent lifecycle

* fix: preserve scheduled root agent capability access

* refactor: share scheduled MCP requirement resolution

* fix: bind scheduled MCP consent to connection routing

* test: type scheduled MCP connection identity fixtures

* fix: reject unbound scheduled MCP routing templates

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-02 08:38:02 -04:00
Danny Avila
aab44c5e35
🧾 feat: Serve Built-In Endpoint Model Lists From Config So Overrides Can Narrow Them (#16639)
* feat: Serve Built-In Endpoint Model Lists From Config So Principal Overrides Can Narrow Them

OpenAI, Google and Anthropic model lists came only from *_MODELS env vars,
which are global, so a role or group override could not narrow them. A
configured endpoints.<name>.models list now replaces the env list and is read
from the per-request config, matching Bedrock.

* fix: Skip OpenAI and Anthropic Model Discovery When a List Is Configured
2026-10-01 19:58:20 -04:00
lia-by-librechat[bot]
59b772f132
🥽 feat: Configure Attached Defaults and Honor Skill Read Ranges (#16540)
* feat: configure attached command and read defaults

* fix: separate programmatic timeout defaults from ceilings

* fix: retain attached programmatic schema instructions

* fix: honor explicit skill and sandbox read ranges

* fix: remove duplicate command imports after rebase

* fix: retrieve complete sandbox text before paging

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-01 19:57:08 -04:00
Marco Beretta
92432e95d5
🔐 feat: Enforce Required Two-Factor Authentication (#14731)
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
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 Votes / vote (full suite) (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/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) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
* feat: enforce required two-factor authentication

Require local and LDAP accounts to enroll in TOTP before they can use the
app when ENFORCE_TWO_FACTOR_AUTHENTICATION is set. Sign-in, refresh, bearer
verification, optional share auth and image authorization all route an
unenrolled account into a staged setup flow, and every bearer credential
minted before enrollment or a password reset is retired.

Password reset retirement uses the existing credentialsChangedAt stamp, and
commitPasswordReset clears any staged enrollment in the same write. Passkey
sign-in follows the same enrollment gate as password sign-in.

* test: cover passkey sign-in handing off to required enrollment

* refactor: keep Mongoose user types out of two-factor auth contracts

* fix: withdraw a minted session when its retirement recheck fails

* fix: hold Agent API keys and the reset CLI to the required two-factor policy

* fix: adopt a setup token handed off after the setup screen mounted

* fix: move every tab that receives an enrollment hand-off into setup

* fix: read the enrollment gate's retirement cutoff in system scope

* fix: clear minted session cookies before the fallible session deletion

* fix: adopt a setup token persisted before the setup screen subscribed
2026-10-01 23:39:51 +02:00
lia-by-librechat[bot]
3b4e7b1e5e
🚷 fix: Stop Reporting Rejected MCP Credentials as Authorized (#16571)
* fix: Keep rejected MCP credentials out of durable authorization

* fix: Preserve MCP rejection evidence across recovery and rollback

* fix: Coalesce MCP rejection persistence with silent refresh

* fix: Record MCP rejections inside the common storage refresh flight

* fix: Complete MCP token method test fixtures

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-01 15:41:55 -04:00
Danny Avila
d349120ec3
🪢 fix: Restore MCP OAuth Browser Binding (#16634)
* fix: Require Browser Binding for MCP OAuth Callbacks

* fix: Refresh OAuth Browser Binding After Account Switch

* fix: Reject Malformed OAuth Binding Cookies Safely
2026-10-01 15:25:46 -04:00
Lia
bbb58a867e ⛴️ fix: Preserve Canary Sync Resolutions (#16457)
Retain the tracked-file integration outcomes recorded by original canary sync PR #16457.

No new implementation is introduced. Shared and ambiguous corrections are carried by the final sync-resolution commit so the resulting tracked tree equals frozen canary f66ad88e1c.

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16457
Resolution-Sources: ffa54e0259, 7fe6eab03e, 8f64336ee4, 207ee8b0df, 7f3f82f284, e9e5b36bd2, ff3f0f8bef, 6bd657753a, 84a53a4464, f66ad88e1c
2026-10-01 03:46:19 +00:00
Lia
9dc8db0ea8 🛶 fix: Preserve Canary Sync Resolutions (#16361)
Retain the tracked-file integration outcomes recorded by original canary sync PR #16361.

No new implementation is introduced. Shared and ambiguous corrections are carried by the final sync-resolution commit so the resulting tracked tree equals frozen canary f66ad88e1c.

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16361
Resolution-Sources: 6d7ba72b89, 241c692b63, 6113242b7b, 3c8a5703e7, a45be88578, 3789cbf590, 81e038972f, c505db2256, 420760d8b2
2026-10-01 03:46:19 +00:00
Marco Beretta
5b84c4b57f ⏳ feat: Add Ephemeral Retention Mode for Forced Temporary Chats (#13811)
* feat: add ephemeral retention mode for forced temporary chats

Adds RetentionMode.EPHEMERAL, which forces every newly saved chat
temporary: hidden from history and search, given the temporary-chat
expiration, and with the toggle locked on.

Forces isTemporary and applies the temporary expiration in the normal
conversation and message save methods, routes Assistants/Threads
messages through the normal message save, applies the all-data
retention policy to file uploads and shared links, and stamps imports,
forks, and duplicates. Locks the frontend toggle and keyboard shortcut
behind an administrator-enforced badge.

The default temporary mode and the existing all mode are unchanged.

* fix: enforce ephemeral retention when resuming paused chats

* fix: preserve forced retention across pauses and assistant turns

* test: Use Real Module IDs for Installed Package Mocks

* test: Wait for Resumed Retention Persistence

* test: Control Mongo Index Setup in OpenID Fixture

* test: Close Mobile Drawer Before Retention Resume Scenario

* fix: Store Responses API Messages Under the Retention Write Context

Input and output messages were saved with the raw request, so under
ephemeral retention they missed the forced-temporary classification the
conversation received. Route both through getConversationWriteContext
and announce the stored reply as saved.

* fix: Align Resumed Responses With the Parent Retention Deadline

A resumed response was saved with a fresh forced-temporary window while
the re-stamp kept the conversation's earlier deadline, so a chat that
paused again could leave its response stored after the conversation
expired. Stamp the saved response with the parent's deadline.

* fix: Clear Released Bookmark Tags When Forcing a Chat Temporary

stampForcedRetention released a converted chat's bookmark counts but
kept its tags, so deleting that chat before TTL removal decremented the
same tags again and reduced counts owned by other visible chats. Clear
the tags in the conditional conversion update that releases them.

* fix: Store No Bookmark Tags on Forced-Temporary Imports

An ephemeral import, fork or duplicate skipped its tag count increment
but kept the source tags, so deleting the copy before TTL removal
decremented counts owned by other visible chats. Store the same tags the
import counts, which is none for a forced-temporary copy.

* test: Provide the Forced-Temporary Retention Helper to the Header Stacking Mock

* test: Reuse One Admin Login per Worker in Ephemeral Retention Scenarios

* fix: Keep Legacy Temporary Chats Temporary When Forking Under All-Data Retention

* fix: Convert a Resumed Chat Under Ephemeral Retention Before It Can Re-Pause Empty

* fix: Treat a Reloaded Pre-Policy Run as Temporary Once Retention Is Forced

* fix: Stamp Messages with the Deadline a Concurrent Retention Stamp Stored

* fix: Wait for the Startup Config Before Rebuilding a Resumed Submission

* test: Wait for the Resumed Response Row in the Ephemeral Resume Scenario

* test: Provide the Real Command Executor Stamp to the Callbacks Mock

(cherry picked from commit 02a70e9c58)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/13811
2026-10-01 03:46:19 +00:00
Lia
2e0690616f ⛴️ test: Keep Executor and Timing Callback Adapters Aligned
(cherry picked from commit fd510aa950)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16457
2026-10-01 03:46:19 +00:00
Marco Beretta
ea938f6054 🚦 feat: Show Exit Status and Stderr for Attached Workspace Commands (#16556)
* feat: Show Exit Status for Attached Workspace Commands

Parse the exit trailer the attached-workspace bash_tool writes so the card
fails a non-zero exit, a signal or a timeout, names the reason beside the
failure suffix, and renders stderr distinctly. The group outcome reads the
same parser so its failed count matches the card. Sandbox output without the
trailer keeps the existing heuristics.

* fix: Parse Exit Status Only for Attached Workspace Calls

The sandbox and attached-workspace tools are both named bash_tool, and the
sandbox output is trimmed, so a sandbox command that printed
"[exit code: 1]" last was read as a failed attached-workspace run by the
card and the group outcome.

The execute handler now records a run step when the resolved tool instance
is the one createAttachedWorkspaceBashTool built (tracked by object
identity), and the step-completed handler stamps executor:
'attached_workspace' on the streamed tool call and the aggregated part.
Redis replay and the client SSE merge carry the field through. BashCall
and outcome.ts parse the trailer only when the marker is set.

* fix: Count Styled Terminal Lines Like Plain Ones When Output Ends in a Newline

(cherry picked from commit abc9285523)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16556
2026-10-01 03:46:19 +00:00