@botpress/adk 1.18.3 → 1.19.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-init/agent-project-generator.d.ts +10 -7
- package/dist/agent-init/agent-project-generator.d.ts.map +1 -1
- package/dist/agent-project/agent-project.d.ts +1 -1
- package/dist/agent-project/agent-project.d.ts.map +1 -1
- package/dist/agent-project/component-files.d.ts +10 -0
- package/dist/agent-project/component-files.d.ts.map +1 -0
- package/dist/agent-project/component-index-writer.d.ts +22 -0
- package/dist/agent-project/component-index-writer.d.ts.map +1 -0
- package/dist/agent-project/config-writer.d.ts +5 -0
- package/dist/agent-project/config-writer.d.ts.map +1 -1
- package/dist/agent-project/dependencies-parser.d.ts.map +1 -1
- package/dist/agent-project/file-watcher.d.ts.map +1 -1
- package/dist/agent-project/index.d.ts +3 -0
- package/dist/agent-project/index.d.ts.map +1 -1
- package/dist/agent-project/lock-to-dependencies.d.ts +11 -0
- package/dist/agent-project/lock-to-dependencies.d.ts.map +1 -0
- package/dist/agent-project/types.d.ts +1 -0
- package/dist/agent-project/types.d.ts.map +1 -1
- package/dist/agent-project/validation-errors.d.ts +1 -0
- package/dist/agent-project/validation-errors.d.ts.map +1 -1
- package/dist/agent0/capabilities/commands/adk-build.md +39 -0
- package/dist/agent0/capabilities/commands/adk-debug.md +23 -0
- package/dist/agent0/capabilities/commands/adk-dev-console.md +17 -0
- package/dist/agent0/capabilities/commands/adk-document.md +68 -0
- package/dist/agent0/capabilities/commands/adk-eval.md +17 -0
- package/dist/agent0/capabilities/commands/adk-explain.md +22 -0
- package/dist/agent0/capabilities/commands/adk-init.md +30 -0
- package/dist/agent0/capabilities/commands/adk-ship.md +29 -0
- package/dist/agent0/capabilities/commands/adk-test.md +27 -0
- package/dist/agent0/capabilities/commands/adk-validate.md +31 -0
- package/dist/agent0/capabilities/skills/adk/SKILL.md +548 -0
- package/dist/agent0/capabilities/skills/adk/references/actions.md +823 -0
- package/dist/agent0/capabilities/skills/adk/references/advanced-patterns.md +669 -0
- package/dist/agent0/capabilities/skills/adk/references/agent-config.md +450 -0
- package/dist/agent0/capabilities/skills/adk/references/assets.md +237 -0
- package/dist/agent0/capabilities/skills/adk/references/autonomous-execution.md +747 -0
- package/dist/agent0/capabilities/skills/adk/references/cli.md +1334 -0
- package/dist/agent0/capabilities/skills/adk/references/context-api.md +461 -0
- package/dist/agent0/capabilities/skills/adk/references/conversation-lifecycle.md +311 -0
- package/dist/agent0/capabilities/skills/adk/references/conversations.md +1111 -0
- package/dist/agent0/capabilities/skills/adk/references/custom-components.md +167 -0
- package/dist/agent0/capabilities/skills/adk/references/desk.md +852 -0
- package/dist/agent0/capabilities/skills/adk/references/evals.md +11 -0
- package/dist/agent0/capabilities/skills/adk/references/explain-config.md +424 -0
- package/dist/agent0/capabilities/skills/adk/references/files.md +918 -0
- package/dist/agent0/capabilities/skills/adk/references/integration-actions.md +659 -0
- package/dist/agent0/capabilities/skills/adk/references/integrations.md +266 -0
- package/dist/agent0/capabilities/skills/adk/references/interfaces.md +97 -0
- package/dist/agent0/capabilities/skills/adk/references/knowledge-bases.md +456 -0
- package/dist/agent0/capabilities/skills/adk/references/mcp-server.md +112 -0
- package/dist/agent0/capabilities/skills/adk/references/messages.md +769 -0
- package/dist/agent0/capabilities/skills/adk/references/model-configuration.md +201 -0
- package/dist/agent0/capabilities/skills/adk/references/patterns-mistakes.md +469 -0
- package/dist/agent0/capabilities/skills/adk/references/plugins.md +280 -0
- package/dist/agent0/capabilities/skills/adk/references/tables.md +1136 -0
- package/dist/agent0/capabilities/skills/adk/references/tags.md +516 -0
- package/dist/agent0/capabilities/skills/adk/references/tools.md +581 -0
- package/dist/agent0/capabilities/skills/adk/references/triggers.md +719 -0
- package/dist/agent0/capabilities/skills/adk/references/workflow-steps.md +851 -0
- package/dist/agent0/capabilities/skills/adk/references/workflows.md +1408 -0
- package/dist/agent0/capabilities/skills/adk/references/zai-agent-reference.md +454 -0
- package/dist/agent0/capabilities/skills/adk/references/zai-complete-guide.md +1408 -0
- package/dist/agent0/capabilities/skills/adk-debugger/SKILL.md +257 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/common-failures.md +231 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/conversation-analysis.md +420 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/debug-workflow.md +239 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/llm-debugging.md +209 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/trace-summarization.md +313 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/traces-and-logs.md +203 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/SKILL.md +111 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/agent-steps.md +115 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/component-registry.md +43 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/multi-agent-dashboard.md +70 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/pages.md +273 -0
- package/dist/agent0/capabilities/skills/adk-docs/SKILL.md +114 -0
- package/dist/agent0/capabilities/skills/adk-docs/references/doc-standards.md +124 -0
- package/dist/agent0/capabilities/skills/adk-evals/SKILL.md +244 -0
- package/dist/agent0/capabilities/skills/adk-evals/references/eval-format.md +354 -0
- package/dist/agent0/capabilities/skills/adk-evals/references/test-patterns.md +355 -0
- package/dist/agent0/capabilities/skills/adk-evals/references/testing-workflow.md +225 -0
- package/dist/agent0/config/index.d.ts +5 -0
- package/dist/agent0/config/index.d.ts.map +1 -0
- package/dist/agent0/config/paths.d.ts +12 -0
- package/dist/agent0/config/paths.d.ts.map +1 -0
- package/dist/agent0/config/schema.d.ts +171 -0
- package/dist/agent0/config/schema.d.ts.map +1 -0
- package/dist/agent0/config/secrets.d.ts +4 -0
- package/dist/agent0/config/secrets.d.ts.map +1 -0
- package/dist/agent0/config/store.d.ts +26 -0
- package/dist/agent0/config/store.d.ts.map +1 -0
- package/dist/agent0/index.d.ts +6 -0
- package/dist/agent0/index.d.ts.map +1 -0
- package/dist/agent0/index.js +3381 -0
- package/dist/agent0/index.js.map +29 -0
- package/dist/agent0/providers/catalog.d.ts +189 -0
- package/dist/agent0/providers/catalog.d.ts.map +1 -0
- package/dist/agent0/providers/index.d.ts +4 -0
- package/dist/agent0/providers/index.d.ts.map +1 -0
- package/dist/agent0/providers/registry.d.ts +32 -0
- package/dist/agent0/providers/registry.d.ts.map +1 -0
- package/dist/agent0/providers/source.d.ts +105 -0
- package/dist/agent0/providers/source.d.ts.map +1 -0
- package/dist/agent0/runtime/client.d.ts +49 -0
- package/dist/agent0/runtime/client.d.ts.map +1 -0
- package/dist/agent0/runtime/engine.d.ts +79 -0
- package/dist/agent0/runtime/engine.d.ts.map +1 -0
- package/dist/agent0/runtime/index.d.ts +7 -0
- package/dist/agent0/runtime/index.d.ts.map +1 -0
- package/dist/agent0/runtime/manager.d.ts +81 -0
- package/dist/agent0/runtime/manager.d.ts.map +1 -0
- package/dist/agent0/runtime/permissions.d.ts +6 -0
- package/dist/agent0/runtime/permissions.d.ts.map +1 -0
- package/dist/agent0/runtime/process.d.ts +52 -0
- package/dist/agent0/runtime/process.d.ts.map +1 -0
- package/dist/agent0/runtime/project-discovery.d.ts +5 -0
- package/dist/agent0/runtime/project-discovery.d.ts.map +1 -0
- package/dist/agent0/types.d.ts +447 -0
- package/dist/agent0/types.d.ts.map +1 -0
- package/dist/assets/manager.d.ts +0 -2
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/types.d.ts +3 -1
- package/dist/assets/types.d.ts.map +1 -1
- package/dist/auth/credentials.d.ts.map +1 -1
- package/dist/auth/index.d.ts +30 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/service.d.ts.map +1 -1
- package/dist/bot-generator/dev-id-manager.d.ts.map +1 -1
- package/dist/bot-generator/generator.d.ts +5 -1
- package/dist/bot-generator/generator.d.ts.map +1 -1
- package/dist/bot-generator/integration-sync.d.ts +2 -0
- package/dist/bot-generator/integration-sync.d.ts.map +1 -1
- package/dist/bot-generator/interface-sync.d.ts +2 -0
- package/dist/bot-generator/interface-sync.d.ts.map +1 -1
- package/dist/bot-generator/plugin-sync.d.ts +2 -0
- package/dist/bot-generator/plugin-sync.d.ts.map +1 -1
- package/dist/bot-generator/table-validation.d.ts +17 -0
- package/dist/bot-generator/table-validation.d.ts.map +1 -0
- package/dist/chat-bundle.cjs +31 -0
- package/dist/cognitive/models.d.ts +32 -0
- package/dist/cognitive/models.d.ts.map +1 -0
- package/dist/commands/base-command.d.ts +1 -0
- package/dist/commands/base-command.d.ts.map +1 -1
- package/dist/commands/bp-add-command.d.ts.map +1 -1
- package/dist/commands/bp-build-command.d.ts.map +1 -1
- package/dist/commands/bp-chat-command.d.ts.map +1 -1
- package/dist/commands/bp-cli.d.ts +1 -0
- package/dist/commands/bp-cli.d.ts.map +1 -1
- package/dist/commands/bp-cli.js +147 -0
- package/dist/commands/bp-cli.js.map +12 -0
- package/dist/commands/bp-deploy-command.d.ts.map +1 -1
- package/dist/commands/bp-dev-command.d.ts +7 -0
- package/dist/commands/bp-dev-command.d.ts.map +1 -1
- package/dist/commands/bp-dev-stderr.d.ts +21 -0
- package/dist/commands/bp-dev-stderr.d.ts.map +1 -0
- package/dist/commands/bp-dev-worker-env.d.ts +7 -0
- package/dist/commands/bp-dev-worker-env.d.ts.map +1 -0
- package/dist/commands/index.d.ts +0 -5
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/config/manager.d.ts +9 -1
- package/dist/config/manager.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/dependencies/alias-utils.d.ts +13 -0
- package/dist/dependencies/alias-utils.d.ts.map +1 -0
- package/dist/dependencies/dependency-manager.d.ts +89 -0
- package/dist/dependencies/dependency-manager.d.ts.map +1 -0
- package/dist/dependencies/errors.d.ts +19 -0
- package/dist/dependencies/errors.d.ts.map +1 -0
- package/dist/dependencies/index.d.ts +17 -0
- package/dist/dependencies/index.d.ts.map +1 -0
- package/dist/dependencies/index.js +6233 -0
- package/dist/dependencies/index.js.map +61 -0
- package/dist/dependencies/json-utils.d.ts +3 -0
- package/dist/dependencies/json-utils.d.ts.map +1 -0
- package/dist/dependencies/lock-file.d.ts +15 -0
- package/dist/dependencies/lock-file.d.ts.map +1 -0
- package/dist/dependencies/migration.d.ts +8 -0
- package/dist/dependencies/migration.d.ts.map +1 -0
- package/dist/dependencies/registry/integration-registry.d.ts +17 -0
- package/dist/dependencies/registry/integration-registry.d.ts.map +1 -0
- package/dist/dependencies/registry/interface-registry.d.ts +11 -0
- package/dist/dependencies/registry/interface-registry.d.ts.map +1 -0
- package/dist/dependencies/registry/plugin-registry.d.ts +16 -0
- package/dist/dependencies/registry/plugin-registry.d.ts.map +1 -0
- package/dist/dependencies/resolvers/integration-resolver.d.ts +30 -0
- package/dist/dependencies/resolvers/integration-resolver.d.ts.map +1 -0
- package/dist/dependencies/resolvers/plugin-resolver.d.ts +38 -0
- package/dist/dependencies/resolvers/plugin-resolver.d.ts.map +1 -0
- package/dist/dependencies/types.d.ts +254 -0
- package/dist/dependencies/types.d.ts.map +1 -0
- package/dist/deploy-manifest/index.d.ts +608 -0
- package/dist/deploy-manifest/index.d.ts.map +1 -0
- package/dist/file-watcher/watcher.d.ts +21 -5
- package/dist/file-watcher/watcher.d.ts.map +1 -1
- package/dist/generators/action-types.d.ts.map +1 -1
- package/dist/generators/assets.d.ts +2 -2
- package/dist/generators/assets.d.ts.map +1 -1
- package/dist/generators/client-wrapper.d.ts.map +1 -1
- package/dist/generators/tests.d.ts +6 -6
- package/dist/generators/tests.d.ts.map +1 -1
- package/dist/generators/utils.d.ts.map +1 -1
- package/dist/index.d.ts +15 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17614 -5514
- package/dist/index.js.map +83 -66
- package/dist/integrations/config-utils.d.ts.map +1 -1
- package/dist/integrations/hub-cache.d.ts.map +1 -1
- package/dist/integrations/index.d.ts +0 -6
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/manager.d.ts +17 -1
- package/dist/integrations/manager.d.ts.map +1 -1
- package/dist/interfaces/index.d.ts +0 -2
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/manager.d.ts +3 -1
- package/dist/interfaces/manager.d.ts.map +1 -1
- package/dist/interfaces/parser.d.ts.map +1 -1
- package/dist/knowledge/manager.d.ts +3 -1
- package/dist/knowledge/manager.d.ts.map +1 -1
- package/dist/knowledge/types.d.ts +2 -2
- package/dist/knowledge/types.d.ts.map +1 -1
- package/dist/plugins/manager.d.ts +34 -1
- package/dist/plugins/manager.d.ts.map +1 -1
- package/dist/preflight/checker.d.ts +5 -6
- package/dist/preflight/checker.d.ts.map +1 -1
- package/dist/preflight/index.d.ts +2 -2
- package/dist/preflight/index.d.ts.map +1 -1
- package/dist/preflight/types.d.ts +30 -32
- package/dist/preflight/types.d.ts.map +1 -1
- package/dist/runner/script-runner.d.ts +2 -0
- package/dist/runner/script-runner.d.ts.map +1 -1
- package/dist/runner/supervise-child.d.ts +24 -0
- package/dist/runner/supervise-child.d.ts.map +1 -0
- package/dist/secrets/manager.d.ts.map +1 -1
- package/dist/tables/table-manager.d.ts.map +1 -1
- package/dist/tables/types.d.ts +3 -2
- package/dist/tables/types.d.ts.map +1 -1
- package/dist/templates/README.md +14 -13
- package/dist/templates/blank/agent.config.ts +0 -3
- package/dist/templates/blank/evals/index.eval.ts +30 -0
- package/dist/templates/blank/src/conversations/index.ts +16 -16
- package/dist/templates/blank/tsconfig.json +1 -1
- package/dist/templates/botpress-desk/README.md +87 -0
- package/dist/templates/botpress-desk/agent.config.ts +19 -0
- package/dist/templates/botpress-desk/evals/index.eval.ts +30 -0
- package/dist/templates/botpress-desk/package.json +17 -0
- package/dist/templates/botpress-desk/src/actions/index.ts +19 -0
- package/dist/templates/botpress-desk/src/conversations/index.ts +16 -0
- package/dist/templates/botpress-desk/src/knowledge/index.ts +20 -0
- package/dist/templates/botpress-desk/src/tables/index.ts +16 -0
- package/dist/templates/botpress-desk/src/tools/handToSupport.ts +23 -0
- package/dist/templates/botpress-desk/src/triggers/index.ts +17 -0
- package/dist/templates/botpress-desk/src/workflows/index.ts +21 -0
- package/dist/templates/crm-enrichment/agent.config.ts +0 -3
- package/dist/templates/crm-enrichment/evals/example.eval.ts +29 -0
- package/dist/templates/crm-enrichment/package.json +1 -0
- package/dist/templates/crm-enrichment/tsconfig.json +1 -1
- package/dist/templates/hello-world/agent.config.ts +0 -3
- package/dist/templates/hello-world/evals/context-retention.eval.ts +37 -0
- package/dist/templates/hello-world/evals/greeting.eval.ts +43 -0
- package/dist/templates/hello-world/package.json +1 -0
- package/dist/templates/hello-world/tsconfig.json +1 -1
- package/dist/templates/knowledge-assistant/agent.config.ts +0 -3
- package/dist/templates/knowledge-assistant/evals/engineering-practices.eval.ts +45 -0
- package/dist/templates/knowledge-assistant/evals/out-of-scope.eval.ts +33 -0
- package/dist/templates/knowledge-assistant/evals/pto-policy.eval.ts +44 -0
- package/dist/templates/knowledge-assistant/package.json +1 -0
- package/dist/templates/knowledge-assistant/tsconfig.json +1 -1
- package/dist/templates/slack-triage/agent.config.ts +0 -8
- package/dist/templates/slack-triage/evals/triage-basic.eval.ts +9 -39
- package/dist/templates/slack-triage/package.json +1 -0
- package/dist/templates/slack-triage/src/conversations/slack-dm.ts +4 -1
- package/dist/templates/slack-triage/tsconfig.json +1 -1
- package/dist/templates/template.config.json +16 -16
- package/dist/test-utils/mock-module.d.ts +29 -0
- package/dist/test-utils/mock-module.d.ts.map +1 -0
- package/dist/utils/require-chat.d.ts +3 -24
- package/dist/utils/require-chat.d.ts.map +1 -1
- package/dist/utils/search-ranking.d.ts +15 -0
- package/dist/utils/search-ranking.d.ts.map +1 -0
- package/dist/utils/source-map-optimizer.d.ts +10 -11
- package/dist/utils/source-map-optimizer.d.ts.map +1 -1
- package/dist/workspace/workspace-cache.d.ts.map +1 -1
- package/package.json +23 -11
- package/dist/commands/copilot-config-reader.d.ts +0 -12
- package/dist/commands/copilot-config-reader.d.ts.map +0 -1
- package/dist/commands/copilot-server.d.ts +0 -26
- package/dist/commands/copilot-server.d.ts.map +0 -1
- package/dist/commands/opencode-config.d.ts +0 -29
- package/dist/commands/opencode-config.d.ts.map +0 -1
- package/dist/integrations/checker.d.ts +0 -41
- package/dist/integrations/checker.d.ts.map +0 -1
- package/dist/integrations/operations.d.ts +0 -140
- package/dist/integrations/operations.d.ts.map +0 -1
- package/dist/integrations/sync-manager.d.ts +0 -19
- package/dist/integrations/sync-manager.d.ts.map +0 -1
- package/dist/interfaces/operations.d.ts +0 -48
- package/dist/interfaces/operations.d.ts.map +0 -1
- package/dist/preflight/formatter.d.ts +0 -12
- package/dist/preflight/formatter.d.ts.map +0 -1
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# LLM Behavior Debugging
|
|
2
|
+
|
|
3
|
+
When the bot's code runs fine but the LLM makes bad decisions — wrong tools, fabricated data, refusals, or loops. These issues live in the model's reasoning, not in your runtime code.
|
|
4
|
+
|
|
5
|
+
Always use `adk traces --format json` to inspect `think` and `tool_call` spans.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Wrong Tool Selected
|
|
10
|
+
|
|
11
|
+
**Symptom:** The model picks a different tool than expected for the user's request.
|
|
12
|
+
|
|
13
|
+
**How to diagnose:**
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
adk traces --format json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
1. Find the `think` span before the `tool_call` — this shows the model's reasoning
|
|
20
|
+
2. Compare the tool it chose vs the tool you expected
|
|
21
|
+
3. Read both tools' `description` fields — is the wrong tool's description a better match for the input?
|
|
22
|
+
|
|
23
|
+
**Common causes:**
|
|
24
|
+
|
|
25
|
+
- Tool descriptions are too similar or ambiguous
|
|
26
|
+
- The correct tool's description doesn't clearly cover the use case
|
|
27
|
+
- Too many tools available — the model gets confused with a large tool set
|
|
28
|
+
|
|
29
|
+
**Fixes:**
|
|
30
|
+
|
|
31
|
+
- **Sharpen descriptions:** Make each tool's purpose unambiguous. Include what the tool does NOT do.
|
|
32
|
+
- **Add negative examples:** "Do NOT use this tool for X — use Y instead."
|
|
33
|
+
- **Reduce tool count:** If tools are rarely used, consider consolidating or removing them
|
|
34
|
+
- **Last resort, use `confirm: true`:** Require user confirmation before executing, giving the user a chance to correct
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 2. Hallucinated Parameters
|
|
39
|
+
|
|
40
|
+
**Symptom:** The model invokes the right tool but fills in parameter values that the user never provided.
|
|
41
|
+
|
|
42
|
+
**How to diagnose:**
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
adk traces --format json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Check the `tool_call` span's `input` field against what the user actually said.
|
|
49
|
+
|
|
50
|
+
**Common causes:**
|
|
51
|
+
|
|
52
|
+
- Input schema is too loose (e.g., free-form `z.string()` where `z.enum()` would be better)
|
|
53
|
+
- No validation in the handler — the hallucinated value passes through
|
|
54
|
+
- The model infers values from context that don't exist
|
|
55
|
+
|
|
56
|
+
**Fixes:**
|
|
57
|
+
|
|
58
|
+
- **Tighten input schemas:** Use `z.enum()` for known values, add `.describe()` to clarify what each field expects
|
|
59
|
+
- **Add handler validation:** Check that input values make sense before using them
|
|
60
|
+
- **Last resort, require confirmation:** Set `confirm: true` on the tool so the user sees parameters before execution
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 3. Refusal
|
|
65
|
+
|
|
66
|
+
**Symptom:** The model refuses to perform an action, saying it can't or shouldn't do something.
|
|
67
|
+
|
|
68
|
+
**How to diagnose:**
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
adk traces --format json
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Check `think` spans for safety-related reasoning. The model may cite content policy, uncertainty, or ethical concerns.
|
|
75
|
+
|
|
76
|
+
**Common causes:**
|
|
77
|
+
|
|
78
|
+
- The system prompt or instructions don't explicitly authorize the action
|
|
79
|
+
- The tool description sounds potentially harmful or sensitive
|
|
80
|
+
- The user's request is ambiguous and the model errs on the side of caution
|
|
81
|
+
|
|
82
|
+
**Fixes:**
|
|
83
|
+
|
|
84
|
+
- **Update instructions:** Explicitly authorize the actions in your conversation's `instructions` field
|
|
85
|
+
- **Soften tool descriptions:** Remove language that sounds risky (e.g., "delete all" → "remove selected")
|
|
86
|
+
- **Check `confirm` settings:** If `confirm: true` is set, the model knows the user will approve — make sure instructions reflect this
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 4. Token Limit Issues
|
|
91
|
+
|
|
92
|
+
**Symptom:** The model's responses are truncated, it loses context from earlier in the conversation, or it starts repeating itself.
|
|
93
|
+
|
|
94
|
+
**How to diagnose:**
|
|
95
|
+
|
|
96
|
+
- Long conversations with many turns
|
|
97
|
+
- Large tool outputs filling the context window
|
|
98
|
+
- `adk traces --format json` may show degraded reasoning in later `think` spans
|
|
99
|
+
|
|
100
|
+
**Common causes:**
|
|
101
|
+
|
|
102
|
+
- Conversation history is too long — no pruning or summarization
|
|
103
|
+
- Tool outputs are large (e.g., full database dumps, long API responses)
|
|
104
|
+
- Model configuration doesn't match the conversation's needs
|
|
105
|
+
|
|
106
|
+
**Fixes:**
|
|
107
|
+
|
|
108
|
+
- **Check model configuration:** Verify model settings in `agent.config.ts` — consider using a model with a larger context window
|
|
109
|
+
- **Trim tool outputs:** Return only what the model needs, not everything
|
|
110
|
+
- **Summarize long conversations:** Use Zai to summarize earlier turns before they fill the window
|
|
111
|
+
- **Use `maxIterations`:** Set a reasonable limit on agent iterations to prevent runaway conversations
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 5. Poor Extraction Quality
|
|
116
|
+
|
|
117
|
+
**Symptom:** Using `adk.zai.extract()` or similar `zai` operations returns incorrect or incomplete structured data.
|
|
118
|
+
|
|
119
|
+
**Common causes:**
|
|
120
|
+
|
|
121
|
+
- Schema descriptions are vague — the model doesn't know what each field means
|
|
122
|
+
- Input text is ambiguous or poorly formatted
|
|
123
|
+
- Wrong model for the task — some models extract better than others
|
|
124
|
+
|
|
125
|
+
**Fixes:**
|
|
126
|
+
|
|
127
|
+
- **Improve schema descriptions:** Add `.describe()` to every field with clear, specific descriptions
|
|
128
|
+
- **Provide examples:** Show the model what good output looks like
|
|
129
|
+
- **Try a different model:** Some models handle extraction better; check model configuration
|
|
130
|
+
- **Pre-process input:** Clean up or normalize the text before extraction
|
|
131
|
+
- See the **Edge Cases & Gotchas** section in [zai-agent-reference.md](../../adk/references/zai-agent-reference.md) for common pitfalls like hallucinated fields and chunk-window issues
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 6. Looping
|
|
136
|
+
|
|
137
|
+
**Symptom:** The model calls the same tool repeatedly, or cycles between tools without making progress.
|
|
138
|
+
|
|
139
|
+
**How to diagnose:**
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
adk traces --format json
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Look for repeated `tool_call` spans with the same `tool_name` in sequence.
|
|
146
|
+
|
|
147
|
+
**Common causes:**
|
|
148
|
+
|
|
149
|
+
- Tool output doesn't clearly indicate success or completion — the model retries
|
|
150
|
+
- Instructions are ambiguous about when to stop
|
|
151
|
+
- The tool fails silently (returns empty/null) and the model keeps trying
|
|
152
|
+
- No iteration limit set
|
|
153
|
+
|
|
154
|
+
**Fixes:**
|
|
155
|
+
|
|
156
|
+
- **Improve tool output clarity:** Return clear success/failure messages that tell the model it's done
|
|
157
|
+
- **Add `onBeforeTool` guardrail:** Detect repeated calls and abort
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
// Create per-conversation to avoid leaking state across turns
|
|
161
|
+
const makeLoopGuard = () => {
|
|
162
|
+
const seen = new Set<string>();
|
|
163
|
+
const onBeforeTool: Autonomous.Hooks["onBeforeTool"] = async ({ tool, input, controller }) => {
|
|
164
|
+
const key = `${tool.name}:${JSON.stringify(input)}`;
|
|
165
|
+
if (seen.has(key)) {
|
|
166
|
+
controller.abort("Already called this tool with these parameters");
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
seen.add(key);
|
|
170
|
+
};
|
|
171
|
+
return { onBeforeTool };
|
|
172
|
+
};
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
- **Set `maxIterations`:** Limit how many tool calls the agent can make per turn
|
|
176
|
+
- **Check instructions:** Add explicit stopping criteria ("after completing X, respond to the user")
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 7. Reading Model Reasoning
|
|
181
|
+
|
|
182
|
+
The `think` span type captures the model's internal reasoning before it acts. This is the most valuable debugging tool for LLM behavior issues.
|
|
183
|
+
|
|
184
|
+
**How to access:**
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Via CLI
|
|
188
|
+
adk traces --format json
|
|
189
|
+
# Look for spans with type "think" — the "content" field has the reasoning
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Via `onTrace` hook in code:**
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
const onTrace: Autonomous.Hooks["onTrace"] = ({ trace }) => {
|
|
196
|
+
if (trace.type === "think") {
|
|
197
|
+
console.debug(`[MODEL REASONING] ${trace.content}`);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**What to look for:**
|
|
203
|
+
|
|
204
|
+
- Does the model correctly understand the user's intent?
|
|
205
|
+
- Does it consider the right tools?
|
|
206
|
+
- Does it have accurate context about the conversation state?
|
|
207
|
+
- Is it making assumptions that aren't supported by the input?
|
|
208
|
+
|
|
209
|
+
If the reasoning is wrong, the fix is usually in the instructions, tool descriptions, or the information available to the model — not in the code.
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# Trace Summarization
|
|
2
|
+
|
|
3
|
+
How to fetch a trace, walk its span tree, and produce a free-form natural-language summary of what happened. The goal is a synthesized narrative, not a raw dump of span data.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Fetching Trace Data
|
|
8
|
+
|
|
9
|
+
Use the `adk traces` CLI with filters to get the raw data.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Full trace with LLM reasoning included
|
|
13
|
+
adk traces trace=<trace-id> --include-llm --format json
|
|
14
|
+
|
|
15
|
+
# All traces for a conversation
|
|
16
|
+
adk traces conversation=<id> --include-llm --format json
|
|
17
|
+
|
|
18
|
+
# Recent traces (start here if you don't have an ID)
|
|
19
|
+
adk traces --include-llm --format json
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Always pass `--include-llm`** when summarizing. Without it, `think` spans are omitted and you lose the model's reasoning, which is essential for explaining *why* the agent did what it did.
|
|
23
|
+
|
|
24
|
+
**Always pass `--format json`** for structured, parseable output.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Reading the Span Tree
|
|
29
|
+
|
|
30
|
+
Traces contain a flat list of spans, but spans form a parent-child hierarchy via `parentSpanId`. To summarize effectively, reconstruct the tree.
|
|
31
|
+
|
|
32
|
+
### Span hierarchy (typical)
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
handler.conversation (or handler.workflow, handler.action)
|
|
36
|
+
└─ autonomous.execution
|
|
37
|
+
└─ autonomous.iteration (one per LLM turn)
|
|
38
|
+
├─ cognitive.request (the LLM call)
|
|
39
|
+
├─ think (model reasoning)
|
|
40
|
+
├─ tool_call (tool invocation)
|
|
41
|
+
│ └─ autonomous.tool (tool execution detail)
|
|
42
|
+
├─ tool_call (another tool)
|
|
43
|
+
├─ code_execution_exception (if something broke)
|
|
44
|
+
└─ end (turn complete)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### How to walk it
|
|
48
|
+
|
|
49
|
+
1. **Find the root span** -- the span with no `parentSpanId`, or the handler span (`handler.conversation`, `handler.workflow`, `handler.action`). This tells you what triggered the trace.
|
|
50
|
+
2. **Walk children in chronological order** by `startTime`. Each child span is a step in the agent's behavior.
|
|
51
|
+
3. **Group by iteration** -- `autonomous.iteration` spans each represent one LLM turn. Within each iteration, look for the `think` -> `tool_call` -> `end` sequence.
|
|
52
|
+
4. **Follow errors upward** -- if a `code_execution_exception` or failed `tool_call` appears, check its parent iteration and the subsequent iteration to see how the agent recovered (or didn't).
|
|
53
|
+
|
|
54
|
+
### Key fields per span type
|
|
55
|
+
|
|
56
|
+
| Span Type | Fields to Read | What They Tell You |
|
|
57
|
+
|-----------|---------------|-------------------|
|
|
58
|
+
| `handler.conversation` | `context.conversationId`, `context.userId` | What triggered the trace (incoming message) |
|
|
59
|
+
| `handler.workflow` | `name`, `context` | Which workflow was invoked |
|
|
60
|
+
| `handler.action` | `name`, `context` | Which action was called |
|
|
61
|
+
| `autonomous.iteration` | `data.iterationIndex` | Which LLM turn this is (0-indexed) |
|
|
62
|
+
| `cognitive.request` | `data.model`, `data.tokens` | Which model was used, token counts |
|
|
63
|
+
| `think` | `data.content` | The LLM's reasoning -- why it chose an action |
|
|
64
|
+
| `tool_call` | `data.tool_name`, `data.input`, `data.output`, `status`, `data.error` | What tool was called, with what, and what happened |
|
|
65
|
+
| `code_execution_exception` | `data.message`, `data.stackTrace` | Runtime error in the LLMz sandbox |
|
|
66
|
+
| `end` | `data.response` | What the agent said back to the user |
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Producing a Summary
|
|
71
|
+
|
|
72
|
+
Do **not** use a fixed template. Write a natural-language narrative that reads like a concise incident report or activity log. Cover these aspects in whatever order makes the most sense for the specific trace:
|
|
73
|
+
|
|
74
|
+
### What to cover
|
|
75
|
+
|
|
76
|
+
1. **The trigger** -- What started this trace? An incoming user message? A workflow invocation? A scheduled trigger? Extract this from the root span type and context.
|
|
77
|
+
|
|
78
|
+
2. **The LLM's plan** -- What did the model decide to do and why? Synthesize from `think` spans. Don't quote them verbatim unless a specific phrase is important -- paraphrase the reasoning.
|
|
79
|
+
|
|
80
|
+
3. **Tool calls and their outcomes** -- Which tools were called, with what key inputs, and what happened? For successful calls, note what was returned if relevant. For failures, state the error clearly.
|
|
81
|
+
|
|
82
|
+
4. **Errors and recovery** -- Were there exceptions? Did the agent retry or give up? What was the error message? If the agent recovered, explain how.
|
|
83
|
+
|
|
84
|
+
5. **The outcome** -- What was the final result? What did the agent respond with? Did the conversation turn succeed or fail?
|
|
85
|
+
|
|
86
|
+
6. **Performance** -- Only mention if relevant (e.g., unusually slow, many iterations, high token usage). Don't include timing details for normal traces.
|
|
87
|
+
|
|
88
|
+
### Adapting depth to context
|
|
89
|
+
|
|
90
|
+
The summary depth should match what the developer is asking:
|
|
91
|
+
|
|
92
|
+
| Developer Question | Summary Depth |
|
|
93
|
+
|-------------------|---------------|
|
|
94
|
+
| "What happened?" / "Summarize this trace" | **Brief** -- 3-5 sentences covering trigger, actions taken, outcome |
|
|
95
|
+
| "Why did it do X?" / "Why did the bot call tool Y?" | **Focused** -- Zoom into the relevant `think` span and the tool call, explain the reasoning chain |
|
|
96
|
+
| "What went wrong?" / "Why did this fail?" | **Diagnostic** -- Focus on the error path: what led to the failure, what the error was, whether recovery was attempted |
|
|
97
|
+
| "Walk me through the whole trace" | **Detailed** -- Full chronological narrative covering every iteration and tool call |
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Examples
|
|
102
|
+
|
|
103
|
+
### Sample trace data (abbreviated)
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"traceId": "tr_01J5EXAMPLE",
|
|
108
|
+
"spans": [
|
|
109
|
+
{
|
|
110
|
+
"spanId": "sp_001",
|
|
111
|
+
"name": "handler.conversation",
|
|
112
|
+
"startTime": "2026-04-21T14:00:00.000Z",
|
|
113
|
+
"endTime": "2026-04-21T14:00:03.200Z",
|
|
114
|
+
"status": "ok",
|
|
115
|
+
"context": {
|
|
116
|
+
"conversationId": "conv_abc123",
|
|
117
|
+
"userId": "user_xyz"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"spanId": "sp_002",
|
|
122
|
+
"parentSpanId": "sp_001",
|
|
123
|
+
"name": "autonomous.execution",
|
|
124
|
+
"startTime": "2026-04-21T14:00:00.050Z",
|
|
125
|
+
"endTime": "2026-04-21T14:00:03.100Z",
|
|
126
|
+
"status": "ok"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"spanId": "sp_003",
|
|
130
|
+
"parentSpanId": "sp_002",
|
|
131
|
+
"name": "autonomous.iteration",
|
|
132
|
+
"startTime": "2026-04-21T14:00:00.100Z",
|
|
133
|
+
"endTime": "2026-04-21T14:00:02.800Z",
|
|
134
|
+
"status": "ok",
|
|
135
|
+
"data": { "iterationIndex": 0 }
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"spanId": "sp_004",
|
|
139
|
+
"parentSpanId": "sp_003",
|
|
140
|
+
"name": "think",
|
|
141
|
+
"startTime": "2026-04-21T14:00:00.200Z",
|
|
142
|
+
"data": {
|
|
143
|
+
"content": "The user is asking for the status of order #4521. I should look this up using the lookupOrder tool with the order ID."
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"spanId": "sp_005",
|
|
148
|
+
"parentSpanId": "sp_003",
|
|
149
|
+
"name": "tool_call",
|
|
150
|
+
"startTime": "2026-04-21T14:00:00.500Z",
|
|
151
|
+
"endTime": "2026-04-21T14:00:01.200Z",
|
|
152
|
+
"status": "ok",
|
|
153
|
+
"data": {
|
|
154
|
+
"tool_name": "lookupOrder",
|
|
155
|
+
"input": { "orderId": "4521" },
|
|
156
|
+
"output": { "status": "shipped", "trackingNumber": "1Z999AA10123456784", "estimatedDelivery": "2026-04-23" }
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"spanId": "sp_006",
|
|
161
|
+
"parentSpanId": "sp_003",
|
|
162
|
+
"name": "end",
|
|
163
|
+
"startTime": "2026-04-21T14:00:02.800Z",
|
|
164
|
+
"data": {
|
|
165
|
+
"response": "Your order #4521 has been shipped! Tracking number: 1Z999AA10123456784. Estimated delivery: April 23rd."
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Brief summary ("What happened?")
|
|
173
|
+
|
|
174
|
+
> The user asked about order #4521. The agent looked it up with `lookupOrder`, found it was shipped with tracking number 1Z999AA10123456784 and an estimated delivery of April 23rd, and relayed that information to the user. Completed in one iteration, ~3 seconds.
|
|
175
|
+
|
|
176
|
+
### Sample trace with an error (abbreviated)
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"traceId": "tr_01J5FAILURE",
|
|
181
|
+
"spans": [
|
|
182
|
+
{
|
|
183
|
+
"spanId": "sp_010",
|
|
184
|
+
"name": "handler.conversation",
|
|
185
|
+
"startTime": "2026-04-21T15:00:00.000Z",
|
|
186
|
+
"endTime": "2026-04-21T15:00:08.500Z",
|
|
187
|
+
"status": "error",
|
|
188
|
+
"context": {
|
|
189
|
+
"conversationId": "conv_def456",
|
|
190
|
+
"userId": "user_xyz"
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"spanId": "sp_011",
|
|
195
|
+
"parentSpanId": "sp_010",
|
|
196
|
+
"name": "autonomous.execution",
|
|
197
|
+
"startTime": "2026-04-21T15:00:00.050Z",
|
|
198
|
+
"endTime": "2026-04-21T15:00:08.400Z",
|
|
199
|
+
"status": "error"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"spanId": "sp_012",
|
|
203
|
+
"parentSpanId": "sp_011",
|
|
204
|
+
"name": "autonomous.iteration",
|
|
205
|
+
"startTime": "2026-04-21T15:00:00.100Z",
|
|
206
|
+
"endTime": "2026-04-21T15:00:04.000Z",
|
|
207
|
+
"status": "error",
|
|
208
|
+
"data": { "iterationIndex": 0 }
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"spanId": "sp_013",
|
|
212
|
+
"parentSpanId": "sp_012",
|
|
213
|
+
"name": "think",
|
|
214
|
+
"startTime": "2026-04-21T15:00:00.200Z",
|
|
215
|
+
"data": {
|
|
216
|
+
"content": "The user wants to cancel order #7890. I'll use the cancelOrder tool."
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"spanId": "sp_014",
|
|
221
|
+
"parentSpanId": "sp_012",
|
|
222
|
+
"name": "tool_call",
|
|
223
|
+
"startTime": "2026-04-21T15:00:00.500Z",
|
|
224
|
+
"endTime": "2026-04-21T15:00:02.000Z",
|
|
225
|
+
"status": "error",
|
|
226
|
+
"data": {
|
|
227
|
+
"tool_name": "cancelOrder",
|
|
228
|
+
"input": { "orderId": "7890" },
|
|
229
|
+
"error": "OrderService: Cannot cancel order in 'shipped' status"
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"spanId": "sp_015",
|
|
234
|
+
"parentSpanId": "sp_011",
|
|
235
|
+
"name": "autonomous.iteration",
|
|
236
|
+
"startTime": "2026-04-21T15:00:04.100Z",
|
|
237
|
+
"endTime": "2026-04-21T15:00:08.000Z",
|
|
238
|
+
"status": "ok",
|
|
239
|
+
"data": { "iterationIndex": 1 }
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"spanId": "sp_016",
|
|
243
|
+
"parentSpanId": "sp_015",
|
|
244
|
+
"name": "think",
|
|
245
|
+
"startTime": "2026-04-21T15:00:04.200Z",
|
|
246
|
+
"data": {
|
|
247
|
+
"content": "The cancelOrder tool failed because the order is already shipped. I should inform the user that shipped orders cannot be cancelled and suggest they initiate a return instead."
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"spanId": "sp_017",
|
|
252
|
+
"parentSpanId": "sp_015",
|
|
253
|
+
"name": "end",
|
|
254
|
+
"startTime": "2026-04-21T15:00:07.900Z",
|
|
255
|
+
"data": {
|
|
256
|
+
"response": "I wasn't able to cancel order #7890 because it has already shipped. You can initiate a return once it arrives — would you like me to help with that?"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Diagnostic summary ("What went wrong?")
|
|
264
|
+
|
|
265
|
+
> The user asked to cancel order #7890. The agent called `cancelOrder` but it failed with "Cannot cancel order in 'shipped' status" -- the order was already shipped. In the second iteration, the agent recognized the failure, informed the user that shipped orders can't be cancelled, and suggested initiating a return instead. The agent handled the error gracefully; this is expected behavior for an already-shipped order, not a bug.
|
|
266
|
+
|
|
267
|
+
### Focused summary ("Why did it suggest a return?")
|
|
268
|
+
|
|
269
|
+
> After `cancelOrder` failed with a "shipped" status error, the agent's reasoning (iteration 1 `think` span) explicitly noted that shipped orders can't be cancelled and decided to suggest a return as an alternative. This came from the model's own reasoning, not from the tool output or instructions -- it inferred the next-best action based on the error context.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Patterns
|
|
274
|
+
|
|
275
|
+
✅ **Synthesize, don't transcribe**
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
Good: "The agent looked up the order, found it was shipped, and told the user."
|
|
279
|
+
Bad: "Span sp_004 is a think span with content 'The user is asking...' then span sp_005 is a tool_call to lookupOrder with input orderId=4521..."
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
✅ **Name tools and key values**
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
Good: "Called `lookupOrder` with orderId '4521', got status 'shipped'."
|
|
286
|
+
Bad: "A tool was called and it returned some data."
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
✅ **Explain causation, not just sequence**
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
Good: "The cancelOrder call failed because the order was already shipped, so the agent suggested a return instead."
|
|
293
|
+
Bad: "cancelOrder failed. Then the agent said to try a return."
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
✅ **Flag what matters for the developer's question**
|
|
297
|
+
|
|
298
|
+
```
|
|
299
|
+
Good (for "why did it fail?"): "The root cause is that cancelOrder doesn't handle shipped orders -- it throws instead of returning an error object."
|
|
300
|
+
Bad: Giving a full trace walkthrough when the developer only asked about the failure.
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
❌ **Don't dump raw JSON or span IDs in the summary**
|
|
304
|
+
|
|
305
|
+
Span IDs and raw field values are debugging artifacts. The summary is for understanding, not for grep. Reference tool names, error messages, and key data values instead.
|
|
306
|
+
|
|
307
|
+
❌ **Don't speculate beyond the trace data**
|
|
308
|
+
|
|
309
|
+
If the trace doesn't show why something happened, say so. Don't invent explanations.
|
|
310
|
+
|
|
311
|
+
❌ **Don't include timing unless it's notable**
|
|
312
|
+
|
|
313
|
+
A 3-second conversation turn is normal. A 45-second turn with 12 iterations is worth calling out.
|