vault backup: 2026-04-06 16:23:54

This commit is contained in:
Yaojia Wang
2026-04-06 16:23:54 +02:00
parent e4cee2f21d
commit 7ab3575374
10 changed files with 507 additions and 635 deletions

View File

@@ -0,0 +1,43 @@
---
created: 2026-04-06
type: log
project: "[[Smart Support]]"
source: docs/phases/phase-2-dev-log.md
tags:
- dev-log
- phase-2
- intent-classification
- discount-agent
- interrupt-ttl
- webhook-escalation
- templates
---
# Phase 2: Multi-Agent Routing + Safety -- Development Log
> Status: COMPLETED
> Phase branch: `phase-2/multi-agent-safety`
> Date started: 2026-03-30
> Date completed: 2026-03-30
## What Was Built
- **Intent Classification** (`app/intent.py`): LLM 结构化输出意图分类器Pydantic 模型IntentTarget, ClassificationResult。支持单意图、多意图、模糊检测可配置置信度阈值。
- **Discount Agent** (`app/agents/discount.py`): Mock Agentapply_discountwrite + interrupt和 generate_couponread。验证折扣范围 1-100%。
- **Interrupt Manager** (`app/interrupt_manager.py`): TTL 中断追踪30 分钟自动过期。提供 register, check_status, resolve, cleanup_expired, generate_retry_prompt。
- **Webhook Escalation** (`app/escalation.py`): HTTP POST 升级,指数退避重试(最多 3 次。WebhookEscalator + NoOpEscalatorEscalationService Protocol。
- **Enhanced Supervisor** (`app/graph.py`): 动态 Agent 描述 Supervisor 提示。意图分类器附加到 graph。多意图提示注入。
- **Vertical Templates**: 三个行业 YAML 模板电商、SaaS、金融科技
- **Template Loading** (`app/registry.py`): load_template() 和 list_templates()。
- **WebSocket Integration**: 模糊意图发送澄清消息。中断 TTL 检查 -- 过期中断返回重试提示。
## Test Coverage
- Total: 153 tests (Phase 1: 87 + Phase 2: 66)
- Coverage: 90.18%
- intent.py: 100% | discount.py: 96% | interrupt_manager.py: 100% | escalation.py: 100%
## Related
- [[Smart Support]]
- [[Smart Support/Phase 2 - 多 Agent + 安全]]