5 Tests I Write Before I Trust a Multi-Agent Workflow in .NET 10
说明与用途
.NET 10 多代理工作流的失败路径测试
问题
Ensuring reliability of multi‑agent workflows by testing failure paths before deployment.
结果
All tests pass without API keys or network, confirming that the workflow correctly blocks over‑eager refunds, routes security tickets to escalation, and limits model calls.
工作流
- Build deterministic OfflineTriageChatClient to simulate model responses
- Define TriageRoutingPolicy to route tickets based on category and urgency
- Implement ReplyPolicyGuard to enforce reply constraints
- Write unit tests for specialist over‑eager replies
- Write integration tests for routing and model call counts
证据
The full suite is 58 tests (51 unit, 7 integration), and all of them run with no API key and no network.
The bug: a specialist writes something no human would approve.
The routing rules live in a plain TriageRoutingPolicy class, and security or critical urgency goes straight to the escape step, even at low confidence.
- 记录日期: 2026-10-20T12:41:41.799Z