Merge pull request #1389 from CREDO23/feature/multi-agent

[Feature] Fix multi-agent delegation: orchestrator-only main agent with knowledge_base specialist
This commit is contained in:
Rohan Verma 2026-05-15 04:54:17 -07:00 committed by GitHub
commit 9475036b8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
260 changed files with 6286 additions and 2376 deletions

View file

@ -1,4 +1,4 @@
"""Subagent resilience contract: ``extra_middleware`` reaches the agent chain."""
"""Subagent resilience contract: ``middleware_stack`` reaches the agent chain."""
from __future__ import annotations
@ -67,7 +67,7 @@ class _AlwaysFailingChatModel(BaseChatModel):
@pytest.mark.asyncio
async def test_subagent_recovers_when_primary_llm_fails():
"""Fallback in ``extra_middleware`` must finish the turn when primary raises."""
"""Fallback in ``middleware_stack`` must finish the turn when primary raises."""
primary = _AlwaysFailingChatModel()
fallback = FakeMessagesListChatModel(
responses=[AIMessage(content="recovered via fallback")]
@ -79,7 +79,7 @@ async def test_subagent_recovers_when_primary_llm_fails():
system_prompt="be helpful",
tools=[],
model=primary,
extra_middleware=[ModelFallbackMiddleware(fallback)],
middleware_stack={"fallback": ModelFallbackMiddleware(fallback)},
)
agent = create_agent(