feat(trace): finish run-aware demo verification

This commit is contained in:
zhuyongxin
2026-07-10 21:37:43 +08:00
parent 78c1477198
commit f9df94377b
28 changed files with 779 additions and 459 deletions
+25 -8
View File
@@ -67,10 +67,23 @@ Invoke-RestMethod `
-Body $body
```
如果要继续手动查询同一次诊断运行,先保留响应中的 run id:
```powershell
$chat = Invoke-RestMethod `
-Method Post `
-Uri "http://localhost:9900/api/chat" `
-ContentType "application/json" `
-Body $body
$runId = $chat.data.runId
```
期望结果:
- `data.success = true`
- `data.sessionId = mvp-demo-payment-timeout-001`
- `data.runId` 为本次诊断运行的唯一 ID
- `data.answer` 包含诊断答复
## 4. 查询 Trace
@@ -78,13 +91,15 @@ Invoke-RestMethod `
```powershell
Invoke-RestMethod `
-Method Get `
-Uri "http://localhost:9900/api/diagnosis/$sessionId/trace"
-Uri "http://localhost:9900/api/diagnosis/$sessionId/trace?runId=$runId"
```
期望结果:
- `code = 200`
- `data.runId` 等于 `$runId`
- `data.session.sessionId` 等于 Chat session id
- `data.run.runId` 等于 `$runId`
- `data.steps` 包含 planner / executor / verifier 等步骤
- `data.toolInvocations` 包含 `lookup_knowledge`、`query_logs`、`query_metrics` 等证据工具
- `data.session.selfEvaluation` 包含 verifier 或 rule evaluation
@@ -96,6 +111,7 @@ Invoke-RestMethod `
```powershell
$feedback = @{
sessionId = $sessionId
runId = $runId
feedback = "useful"
} | ConvertTo-Json
@@ -109,7 +125,8 @@ Invoke-RestMethod `
期望结果:
- `success = true`
- 后续 Trace 中 `data.session.feedback = useful`
- `runId = $runId`
- 后续精确 Trace 中 `data.session.feedback = useful`
- useful 反馈会尝试沉淀 `case_library`
## 6. AIOps 告警诊断 Demo
@@ -135,19 +152,19 @@ Invoke-WebRequest `
期望结果:
- SSE 首条包含 `session` 消息,sessionId 为 `mvp-demo-aiops-payment-cpu-001`
- SSE 首条是 `type=metadata` 的 `message` 事件,包含 sessionId `mvp-demo-aiops-payment-cpu-001` 和本次 AIOps `runId`
- 后续流式输出包含 AIOps 告警分析报告
- 报告聚焦输入的 `HighCPUUsage/payment-service`
- 同一 session 的 Trace 中 `data.session.agentFlow = AI_OPS`
- 精确 Trace 中 `data.session.agentFlow = AI_OPS`
- `data.session.answer` 包含最终告警报告
- `data.toolInvocations` 包含证据工具调用
查询 AIOps Trace:
查询 AIOps Trace 时优先使用 SSE metadata 中的 runId:
```powershell
Invoke-RestMethod `
-Method Get `
-Uri "http://localhost:9900/api/diagnosis/$aiopsSessionId/trace"
-Uri "http://localhost:9900/api/diagnosis/$aiopsSessionId/trace?runId=$aiopsRunId"
```
## 7. Demo 主线
@@ -155,7 +172,7 @@ Invoke-RestMethod `
Chat 主线:
```text
一个 session id
一个 session id + 一个 run id
-> 用户问题
-> 多 Agent 执行
-> 证据工具
@@ -168,7 +185,7 @@ Chat 主线:
AIOps 主线:
```text
一个 session id
一个 session id + 一个 run id
-> 告警 payload
-> AIOps Planner / Executor
-> 证据工具