场景失败根因诊断
diagnose
用于系统诊断场景失败的原因——通过分析智能体执行轨迹、代码库和行为模式来识别根本原因。
- License 许可
- MIT
- 最近更新
- 2026-11-04
- Stars
- ★ 251
- Forks
- 21
01 前言 Front Matter
- name
- diagnose
- description
- Use to systematically diagnose why scenarios fail — identifies root causes by analyzing agent traces, codebase, and behavioral patterns
02 资源文件 6
- 参考文档agents/openai.yaml485 B
- 资产文件assets/icon.svg394 B
- 参考文档references/auth0.md7.4 KB
- 参考文档references/clerk.md6.2 KB
- 参考文档references/convex-auth.md8.2 KB
- 参考文档references/workos-authkit.md6.2 KB
03 SKILL.md 正文
Diagnosis Methodology
Overview
Diagnosis identifies the root cause of scenario failures by tracing the agent's execution step-by-step and reading the agent codebase to understand why the code produces the observed behavior. A correct diagnosis is the foundation for an effective patch — without understanding WHY the agent fails, patches are shots in the dark.
When to Use
Before applying any patch. Every patch should be preceded by diagnosis of at least the target failing scenarios.
Diagnosis Workflow
1. Read Evaluation Output
Start with the evaluation output for the scenario to get the score and rationale. The rationale provides a high-level summary of why the scenario failed. Refer to the session prompt or CLAUDE.md for the exact file paths.
2. Read Agent Execution Trace
Read the full agent trace file for the scenario to see:
- Every tool call the agent made
- Every tool response
- The agent's reasoning at each step
- Where the agent deviated from expected behavior
3. Read the Agent Codebase
Read the relevant source files to understand why the code caused the observed behavior:
- System prompt: What instructions did the agent receive?
- Tool docstrings: What did the agent see about the tool's API?
- Tool implementation: What does the tool actually do? Is there a mismatch between the docstring and the implementation?
- Hook configurations: Are there PreToolUse hooks that should have guided the agent but didn't?
- Agent loop logic: Are there infrastructure constraints (budget, timeouts) that prevented completion?
Trace the code path: what the agent saw (docstring/prompt) → what it decided (trace reasoning) → what happened (tool implementation).
4. Identify the Failure Point
Pinpoint the exact step where the agent's behavior diverged from what was needed. Compare what the agent did (from the trace) against what it should have done (from the evaluation rationale and oracle expectations).
Key questions:
- At which step did the agent first make a wrong decision?
- What information was available to the agent at that point?
- What did the agent see (prompt, docstring, tool response) that led to the wrong decision?
- Was the root cause in the code (what the tool does), in the text (what the agent reads about the tool), or in the agent's reasoning?
5. Build a Comprehensive Root Cause Analysis
Go beyond surface-level symptoms. The same failure can often be addressed through multiple approaches — a missing action might be fixable by adding a new tool, by improving an existing tool's output, by adding a prompt rule, or by inserting a hook reminder. Your job is to understand the full causal chain deeply enough that the patch strategy can be chosen based on which approach is most robust and generalizable.
For each failing scenario, document:
- What happened: The exact sequence of agent actions that led to failure
- Why it happened: The code path — what the agent saw (docstring/prompt), what it decided (trace reasoning), what actually happened (implementation)
- What should have happened: The expected behavior based on the oracle
- Where the gap is: The precise mismatch between the agent's world model and reality — is it in the tool's behavior, the agent's understanding of the tool, the agent's planning, or the environment's constraints?
6. Cross-Reference with History
- Check
evo-dag show historyfor the full patch history — look for similar failure patterns that were diagnosed before, what fix was applied, and whether it worked. Use this to avoid known pitfalls and build on proven strategies. - Check
evo-dag show scenario <id>for prior attempts on this specific scenario — known root causes and previously attempted fixes. Avoid repeating approaches that already failed.
Diagnosis Quality Checklist
- Specific: Points to the exact line/step where the agent fails
- Causal: Explains WHY the agent makes that mistake (not just what it does wrong)
- Actionable: Clearly implies what kind of patch would fix it
- Unique: Distinguished from prior failed attempts on the same scenario
04 同仓库更多 Skills
候选变更验证
verification-baseline
在应用候选变更之后使用,在返回该变更之前,验证其差异(diff)、作用范围、语法、集成行为及一致性。
演进历史分析
history-analysis
用于系统分析完整的演进历史(不受输出截断影响),并生成一份聚焦的摘要,供选择、诊断或反思使用。
失败根因诊断
causal-diagnosis
在提出变更(mutation)之前使用,依据评估器结果、追踪记录、历史以及用于控制的候选面(candidate surfaces)对已测得的失败进行诊断。
智能体行为引导补丁
steering-patch
在引导(steering)阶段选用,通过提示词、工具描述或钩子提醒来优化智能体行为,而无需修改可执行代码。
Meta-ARE 补丁验证
patch-verification
在应用 Meta-ARE 补丁后使用,检查语法、导入、集成行为、钩子、变更范围以及结果一致性。
智能体能力补丁
capability-patch
在能力(capability)阶段选用,用于添加工具、开放参数、修复实现,或移除限制智能体的基础设施约束。