Skip to content

feat(example): add multi_agent_support — customer-support triage flagship example#1

Merged
MaxQian888 merged 2 commits into
mainfrom
feat/multi-agent-support-example
Apr 24, 2026
Merged

feat(example): add multi_agent_support — customer-support triage flagship example#1
MaxQian888 merged 2 commits into
mainfrom
feat/multi-agent-support-example

Conversation

@MaxQian888
Copy link
Copy Markdown
Owner

Summary

  • Adds examples/multi_agent_support/ — a complete multi-agent customer-support triage application exercising every contract in the agent-router spec: delegate / transfer, all three session_isolation modes (shared / isolated / forked), max_delegation_depth enforcement, AgentNotFoundError, default_child_budget fallback, and metadata["handoff_from"] propagation
  • Adds offline integration tests (tests/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 key
  • Adds Chinese + English scenario walkthrough docs; updates docs/examples.md / docs/examples.en.md to register multi_agent_support as the third maintained example and updates the navigation sequence
  • Demotes examples/multi_agent/ to seam-level minimal reference with a pointer banner to the new flagship
  • Archives the multi-agent-support-example OpenSpec change

Test plan

  • uv run python examples/multi_agent_support/run_demo_mock.py runs without errors
  • uv run pytest -q tests/unit/test_multi_agent_support_deps.py passes
  • uv run pytest -q tests/integration/test_multi_agent_support_example.py passes (offline, mock pattern)
  • uv run pytest -q full suite still at ≥ 90% coverage
  • Pre-commit hooks pass (ruff check + format, end-of-file-fixer)

🤖 Generated with Claude Code

Max Qian and others added 2 commits April 24, 2026 18:36
…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>
@MaxQian888 MaxQian888 merged commit 39bc923 into main Apr 24, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant