LibreChat/api/server/controllers/agents
Danny Avila 7132fdcf32 🐛 fix: Hydrate deferred attachments for later tool calls
An attachment accepted on one turn whose tool never ran carried neither an
embedding nor a code reference, and every hydration query matches only files
that already have one: getToolFilesByIds requires embedded, getUserCodeFiles
requires a codeEnvRef. The file was therefore absent from later turns entirely,
so asking to search or run code against it found nothing.

Hydrating it back into attachments would have re-delivered earlier uploads to
the model on every turn, so provisioning and delivery are now separate inputs:
deferred records are fetched by their own query and reach the provisioning
computation alone, never the returned attachments.

Also provisions for the host create_file tool, whose name is distinct from
write_file, and falls back to the primary context when a tool batch omits its
agent id, matching what the tool loaders already do.
2026-08-31 14:22:50 -04:00
..
__tests__ 🎻 refactor: Orchestrate Agent Runs Through a Request-Free Host (#15366) 2026-08-30 15:38:57 -04:00
callbacks.background.spec.js 🛂 feat: Filter Model-Bound Content by Source (#14425) 2026-08-21 22:43:32 -04:00
callbacks.js 🗿 feat: Add Attached Stateful Code Environments (#15352) 2026-08-30 15:38:45 -04:00
client.js 🧬 perf: Evolve Compaction Guidance on Warm Turns (#15371) 2026-08-30 17:11:20 -04:00
client.test.js 🧬 perf: Evolve Compaction Guidance on Warm Turns (#15371) 2026-08-30 17:11:20 -04:00
errors.js 🧾 fix: Honor Disabled Transactions on the Assistants Usage Path (#15100) 2026-08-25 08:30:12 -04:00
filterAuthorizedTools.spec.js 🔗 fix: Resolve MCP Tool-Key Boundary Against Configured Server Names (#14448) 2026-07-27 14:45:38 -04:00
openai.js 🐛 fix: Hydrate deferred attachments for later tool calls 2026-08-31 14:22:50 -04:00
protocol.js 🛫 refactor: Promote Generation Protocol V2 Automatically (#15324) 2026-08-28 17:17:09 -04:00
recordCollectedUsage.spec.js
request.js 🎠 refactor: Route Every Event Actor Turn Through One Lifecycle (#15325) 2026-08-28 17:30:23 -04:00
responses.js 🐛 fix: Hydrate deferred attachments for later tool calls 2026-08-31 14:22:50 -04:00
resume.js 🛄 feat: Restore Compaction Guidance Across Continuations (#15356) 2026-08-30 08:13:24 -04:00
steer.js 🛫 refactor: Promote Generation Protocol V2 Automatically (#15324) 2026-08-28 17:17:09 -04:00
v1.js 🗿 feat: Add Attached Stateful Code Environments (#15352) 2026-08-30 15:38:45 -04:00
v1.spec.js 🗿 feat: Add Attached Stateful Code Environments (#15352) 2026-08-30 15:38:45 -04:00