feat(example): add multi_agent_support — customer-support triage flagship example#1
Merged
Merged
Conversation
…ship example Adds a complete multi-agent application that exercises every contract in the agent-router spec. This is the new flagship multi-agent example; the existing `examples/multi_agent/` directory is kept as a seam-level minimal reference and now carries a pointer to this directory. ## What's added ### Example (`examples/multi_agent_support/`) - `agent_mock.json` — four-agent offline mock config (no API key needed) - `agent_real.json` — Anthropic-compatible real-LLM config - `app/deps.py` — `SupportDeps` with `CustomerStore`, `TicketStore`, trace log - `app/plugins.py` — `ToolPlugin` subclasses: lookup, router-bound, action tools - `app/protocol.py` — pydantic envelopes: `CustomerIntent`, `TicketDraft`, `DelegationTraceEntry` - `scenarios.py` — four scenario functions shared by demo and integration test - `run_demo_mock.py` — offline demo runnable with no credentials - `run_demo_real.py` — real-LLM demo (reads `.env`) - `.env.example` — template for LLM_API_KEY / LLM_API_BASE / LLM_MODEL ### Spec coverage exercised - `agent_router.delegate` with all three `session_isolation` modes (shared / isolated / forked) - `agent_router.transfer` handoff semantics + `HandoffSignal` capture - Nested delegation depth propagation via `RunRequest.metadata["delegation_depth"]` - Error paths: `DelegationDepthExceededError` and `AgentNotFoundError` - `default_child_budget` fallback when per-agent budget is absent ### Tests - `tests/unit/test_multi_agent_support_deps.py` — unit tests for deps layer - `tests/integration/test_multi_agent_support_example.py` — offline integration tests for all four scenarios; runs in CI with mock pattern (no API key) ### Docs - `docs/multi-agent-support-example.md` (ZH) — walkthrough of the four scenarios, each annotated with the agent-router spec requirement it exercises - `docs/multi-agent-support-example.en.md` (EN) — same walkthrough in English - `docs/examples.md` / `docs/examples.en.md` — register `multi_agent_support` as the third maintained example; update "How to choose" and navigation sequence - `examples/multi_agent/README.md` — prepend banner pointing readers to the flagship example; demote this directory to "seam-level minimal reference" ### OpenSpec artifacts - `openspec/specs/multi-agent-support-example/` — design + task specs - `openspec/changes/archive/2026-04-24-multi-agent-support-example/` — archived change Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/multi_agent_support/— a complete multi-agent customer-support triage application exercising every contract in theagent-routerspec:delegate/transfer, all threesession_isolationmodes (shared / isolated / forked),max_delegation_depthenforcement,AgentNotFoundError,default_child_budgetfallback, andmetadata["handoff_from"]propagationtests/integration/test_multi_agent_support_example.py) and unit tests for the deps layer (tests/unit/test_multi_agent_support_deps.py); runs in CI without any API keydocs/examples.md/docs/examples.en.mdto registermulti_agent_supportas the third maintained example and updates the navigation sequenceexamples/multi_agent/to seam-level minimal reference with a pointer banner to the new flagshipmulti-agent-support-exampleOpenSpec changeTest plan
uv run python examples/multi_agent_support/run_demo_mock.pyruns without errorsuv run pytest -q tests/unit/test_multi_agent_support_deps.pypassesuv run pytest -q tests/integration/test_multi_agent_support_example.pypasses (offline, mock pattern)uv run pytest -qfull suite still at ≥ 90% coverage🤖 Generated with Claude Code