LibreChat/packages/api/src/agents
Danny Avila cfd5c793a9
🧑‍🏫 fix: Multi-Agent Instructions Handling (#11484)
* 🧑‍🏫 fix: Multi-Agent Instructions Handling

* Refactored AgentClient to streamline the process of building messages by applying shared run context and agent-specific instructions.
* Introduced new utility functions in context.ts for extracting MCP server names, fetching MCP instructions, and building combined agent instructions.
* Updated the Agent type to make instructions optional, allowing for more flexible agent configurations.
* Improved the handling of context application to agents, ensuring that all relevant information is correctly integrated before execution.

* chore: Update EphemeralAgent Type in Context

* Enhanced the context.ts file by importing the TEphemeralAgent type from librechat-data-provider.
* Updated the applyContextToAgent function to use TEphemeralAgent for the ephemeralAgent parameter, improving type safety and clarity in agent context handling.

* ci: Update Agent Instructions in Tests for Clarity

* Revised test assertions in AgentClient to clarify the source of agent instructions, ensuring they are explicitly referenced as coming from agent configuration rather than build options.
* Updated comments in tests to enhance understanding of the expected behavior regarding base agent instructions and their handling in various scenarios.

* ci: Unit Tests for Agent Context Utilities

* Introduced comprehensive unit tests for agent context utilities, including functions for extracting MCP servers, fetching MCP instructions, and building agent instructions.
* Enhanced test coverage to ensure correct behavior across various scenarios, including handling of empty tools, mixed tool types, and error cases.
* Improved type definitions for AgentWithTools to clarify the structure and requirements for agent context operations.
2026-01-22 19:36:06 -05:00
..
__tests__ 🪙 fix: Max Output Tokens Refactor for Responses API (#8972) 2025-08-10 14:08:35 -04:00
auth.ts 🧵 refactor: Migrate Endpoint Initialization to TypeScript (#10794) 2025-12-11 16:37:16 -05:00
avatars.spec.ts 🌅 fix: Agent Avatar S3 URL Refresh Pagination and Persistence (#11323) 2026-01-13 13:01:11 -05:00
avatars.ts 🌅 fix: Agent Avatar S3 URL Refresh Pagination and Persistence (#11323) 2026-01-13 13:01:11 -05:00
chain.ts 🤖 feat: Agent Handoffs (Routing) (#10176) 2025-11-05 17:15:17 -05:00
context.spec.ts 🧑‍🏫 fix: Multi-Agent Instructions Handling (#11484) 2026-01-22 19:36:06 -05:00
context.ts 🧑‍🏫 fix: Multi-Agent Instructions Handling (#11484) 2026-01-22 19:36:06 -05:00
edges.spec.ts 🫱🏼🫲🏽 refactor: Improve Agent Handoffs (#11172) 2026-01-01 16:02:51 -05:00
edges.ts 🫱🏼🫲🏽 refactor: Improve Agent Handoffs (#11172) 2026-01-01 16:02:51 -05:00
index.ts 🧑‍🏫 fix: Multi-Agent Instructions Handling (#11484) 2026-01-22 19:36:06 -05:00
initialize.ts 🫱🏼🫲🏽 refactor: Improve Agent Handoffs (#11172) 2026-01-01 16:02:51 -05:00
legacy.test.ts 🔄 refactor: Convert OCR Tool Resource to Context (#9699) 2025-09-18 20:06:59 -04:00
legacy.ts 🔄 refactor: Convert OCR Tool Resource to Context (#9699) 2025-09-18 20:06:59 -04:00
memory.spec.ts 🪨 fix: Bedrock Provider Support for Memory Agent (#11353) 2026-01-14 22:02:57 -05:00
memory.ts 🪨 fix: Bedrock Provider Support for Memory Agent (#11353) 2026-01-14 22:02:57 -05:00
migration.ts 🔧 refactor: Centralize Collection Checks for Permissions Migration (#9565) 2025-09-10 20:40:58 -04:00
resources.test.ts 🔃 refactor: Decouple Effects from AppService, move to data-schemas (#9974) 2025-10-05 06:37:57 -04:00
resources.ts 🧵 refactor: Migrate Endpoint Initialization to TypeScript (#10794) 2025-12-11 16:37:16 -05:00
run.ts 🫱🏼🫲🏽 refactor: Improve Agent Handoffs (#11172) 2026-01-01 16:02:51 -05:00
validation.ts 👤 feat: Agent Avatar Removal and Decouple upload/reset from Agent Updates (#10527) 2025-11-17 17:04:01 -05:00