LibreChat/api/server/routes
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
..
__test-utils__ 🖲️ fix: Enable Running Chat Menus and Preserve Renamed Titles (#16697) 2026-10-03 23:17:15 -04:00
__tests__ 🔭 feat: Recover Stale Chunks Without the Error Page and Ship Client Logs to RUM (#16701) 2026-10-03 23:17:56 -04:00
admin 🔐 feat: Enforce Required Two-Factor Authentication (#14731) 2026-10-01 23:39:51 +02:00
agents 🔗 feat: use LibreChat prompt groups as agent instructions (#16686) 2026-10-04 21:27:26 -04:00
assistants 📿 fix: Inspect Stored File Locators Per Message (#15841) 2026-09-11 16:47:48 -04:00
files ♻️ refactor: Native Prompts Behind a Shared Service and Adapter (#16506) 2026-10-02 08:40:39 -04:00
types
accessPermissions.js 🩻 feat(insights): Scope Insights to Authorized Agents (#15549) 2026-09-04 20:16:58 -04:00
accessPermissions.sharePolicy.test.js
accessPermissions.test.js
actions.js
apiKeys.js
auth.2fa-ratelimit.test.js 🔐 feat: Enforce Required Two-Factor Authentication (#14731) 2026-10-01 23:39:51 +02:00
auth.cloudfront.test.js 🔐 feat: Enforce Required Two-Factor Authentication (#14731) 2026-10-01 23:39:51 +02:00
auth.cross-site.test.js 🔐 feat: Enforce Required Two-Factor Authentication (#14731) 2026-10-01 23:39:51 +02:00
auth.js 🔐 feat: Enforce Required Two-Factor Authentication (#14731) 2026-10-01 23:39:51 +02:00
auth.reset-password-ratelimit.test.js 🔐 feat: Enforce Required Two-Factor Authentication (#14731) 2026-10-01 23:39:51 +02:00
balance.js
banner.js
categories.js
code-environments.js 🧲 feat: Attach or Leave a Workspace on a Saved Chat (#16124) 2026-09-25 10:08:28 -04:00
code-environments.test.js 🧲 feat: Attach or Leave a Workspace on a Saved Chat (#16124) 2026-09-25 10:08:28 -04:00
config.js 🧬 fix: Default Subagents to Their Parent's Code Machine and Workspace (#16756) 2026-10-04 22:19:00 -04:00
convos.js 🖲️ fix: Enable Running Chat Menus and Preserve Renamed Titles (#16697) 2026-10-03 23:17:15 -04:00
endpoints.js
index.js 🔌 feat: OpenAPI spec and docs for the public Agents API (#15928) 2026-09-16 13:50:05 -04:00
insights.js 🩻 feat(insights): Scope Insights to Authorized Agents (#15549) 2026-09-04 20:16:58 -04:00
keys.js
mcp.js 🪢 fix: Restore MCP OAuth Browser Binding (#16634) 2026-10-01 15:25:46 -04:00
memories.js 🧠 fix: Return 400 for Invalid Memory Keys (#14618) 2026-09-06 04:34:06 +02:00
memories.test.js 🧠 fix: Return 400 for Invalid Memory Keys (#14618) 2026-09-06 04:34:06 +02:00
messages.js 📔 feat: Preserve Owner Text During PII Redaction (#16311) 2026-10-02 11:43:10 -04:00
models.js
oauth.js 🧿 fix: Bind Login Flows to the Browser That Started Them (#15880) 2026-09-13 11:47:29 -04:00
oauth.state.test.js 🧿 fix: Bind Login Flows to the Browser That Started Them (#15880) 2026-09-13 11:47:29 -04:00
oauth.test.js 🔐 fix: Redirect OAuth Browser Navigations Instead of Rendering JSON (#15440) 2026-08-31 21:13:47 -04:00
openapi.js 🔌 feat: OpenAPI spec and docs for the public Agents API (#15928) 2026-09-16 13:50:05 -04:00
presets.js 📿 fix: Inspect Stored File Locators Per Message (#15841) 2026-09-11 16:47:48 -04:00
presets.test.js
projects.js 🎒 feat: Carry Project Context Across Conversations (#15684) 2026-10-01 03:46:19 +00:00
prompts.js 🔗 feat: use LibreChat prompt groups as agent instructions (#16686) 2026-10-04 21:27:26 -04:00
prompts.test.js 🔗 feat: use LibreChat prompt groups as agent instructions (#16686) 2026-10-04 21:27:26 -04:00
roles.js
rum.js 🔭 feat: Recover Stale Chunks Without the Error Page and Ship Client Logs to RUM (#16701) 2026-10-03 23:17:56 -04:00
schedules.js 🦫 feat: Enforce Scheduled MCP Read-Only Authority (#16681) 2026-10-03 20:39:43 -04:00
search.js
settings.js 📌 feat: Unified Pinned Section With Sidebar Drag Interactions (#15057) 2026-09-11 10:41:05 -04:00
share.js 🖼️ fix: Paint the Shared Link Tenant's Deployment Theme (#16333) 2026-10-01 03:46:17 +00:00
skills.js 🖊️ fix: Persist Skill Subfile Edits (#16362) 2026-09-26 22:02:10 -04:00
skills.tenant.test.js
skills.test.js 🖊️ fix: Persist Skill Subfile Edits (#16362) 2026-09-26 22:02:10 -04:00
static.js
tags.js
traces.js 🔭 feat: Conversation Trace Viewer (#15869) 2026-09-13 00:56:52 -04:00
user.js 📧 feat: add email address change (#14597) 2026-10-01 03:46:16 +00:00
user.verify-ratelimit.test.js 📧 feat: add email address change (#14597) 2026-10-01 03:46:16 +00:00