@botpress/adk 1.19.0-beta.2 → 1.19.0-beta.3
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 +1 -1
- package/dist/agent-init/agent-project-generator.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 +1093 -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 +195 -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 +21 -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 +3215 -0
- package/dist/agent0/index.js.map +27 -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 +100 -0
- package/dist/agent0/providers/source.d.ts.map +1 -0
- package/dist/agent0/runtime/client.d.ts +50 -0
- package/dist/agent0/runtime/client.d.ts.map +1 -0
- package/dist/agent0/runtime/engine.d.ts +74 -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 +82 -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 +43 -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/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/cognitive/models.d.ts +32 -0
- package/dist/cognitive/models.d.ts.map +1 -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/index.d.ts +0 -5
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/dependencies/dependency-manager.d.ts +0 -1
- package/dist/dependencies/dependency-manager.d.ts.map +1 -1
- package/dist/dependencies/errors.d.ts +1 -1
- package/dist/dependencies/errors.d.ts.map +1 -1
- package/dist/dependencies/index.d.ts +0 -2
- package/dist/dependencies/index.d.ts.map +1 -1
- package/dist/dependencies/index.js +125 -149
- package/dist/dependencies/index.js.map +11 -13
- package/dist/dependencies/migration.d.ts +0 -2
- package/dist/dependencies/migration.d.ts.map +1 -1
- package/dist/dependencies/resolvers/integration-resolver.d.ts +0 -1
- package/dist/dependencies/resolvers/integration-resolver.d.ts.map +1 -1
- package/dist/dependencies/resolvers/plugin-resolver.d.ts +0 -1
- package/dist/dependencies/resolvers/plugin-resolver.d.ts.map +1 -1
- package/dist/dependencies/types.d.ts +1 -2
- package/dist/dependencies/types.d.ts.map +1 -1
- package/dist/generators/tests.d.ts.map +1 -1
- package/dist/index.js +501 -998
- package/dist/index.js.map +16 -20
- 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/templates/blank/package.json +0 -1
- package/dist/templates/template.config.json +10 -9
- package/package.json +12 -8
- package/dist/commands/copilot-config-reader.d.ts +0 -3
- package/dist/commands/copilot-config-reader.d.ts.map +0 -1
- package/dist/commands/copilot-config.d.ts +0 -42
- package/dist/commands/copilot-config.d.ts.map +0 -1
- package/dist/commands/copilot-server.d.ts +0 -29
- package/dist/commands/copilot-server.d.ts.map +0 -1
- package/dist/commands/opencode-config.d.ts +0 -30
- package/dist/commands/opencode-config.d.ts.map +0 -1
- package/dist/dependencies/env-substitution.d.ts +0 -3
- package/dist/dependencies/env-substitution.d.ts.map +0 -1
- package/dist/dependencies/secrets-rewriter.d.ts +0 -25
- package/dist/dependencies/secrets-rewriter.d.ts.map +0 -1
- package/dist/templates/blank/dependencies.dev.lock.json +0 -6
- package/dist/templates/botpress-desk/dependencies.dev.lock.json +0 -6
- package/dist/templates/crm-enrichment/dependencies.dev.lock.json +0 -6
- package/dist/templates/hello-world/dependencies.dev.lock.json +0 -6
- package/dist/templates/knowledge-assistant/dependencies.dev.lock.json +0 -6
- package/dist/templates/slack-triage/dependencies.dev.lock.json +0 -6
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: adk-debugger
|
|
3
|
+
description: Systematic debugging for ADK agents — trace reading, log analysis, common failure diagnosis, and the debug loop.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# ADK Debugger Skill
|
|
8
|
+
|
|
9
|
+
## What is ADK Debugging?
|
|
10
|
+
|
|
11
|
+
Every ADK agent records its behavior as traces and logs — every conversation turn, tool call, LLM reasoning step, and error. These are the source of truth for understanding what your agent did and why.
|
|
12
|
+
|
|
13
|
+
The ADK CLI provides all the tools you need to debug. All commands support `--format json` for structured output, which you should always use when consuming output programmatically.
|
|
14
|
+
|
|
15
|
+
## When to Use This Skill
|
|
16
|
+
|
|
17
|
+
Use this skill when the developer asks about:
|
|
18
|
+
|
|
19
|
+
- **Bot not working** — not responding, wrong responses, unexpected behavior
|
|
20
|
+
- **Tool issues** — wrong tool called, tool errors, hallucinated parameters
|
|
21
|
+
- **Workflow problems** — stuck workflows, steps not executing, state issues
|
|
22
|
+
- **Reading traces/logs** — how to query, filter, and interpret debug output
|
|
23
|
+
- **LLM misbehavior** — hallucinations, refusals, looping, poor extraction
|
|
24
|
+
- **Build/deploy failures** — validation errors, schema mismatches
|
|
25
|
+
- **Config issues** — agent.json vs agent.local.json, integration setup
|
|
26
|
+
- **Post-fix verification** — confirming a fix worked, writing regression evals
|
|
27
|
+
|
|
28
|
+
**Trigger questions:**
|
|
29
|
+
- "My bot isn't responding"
|
|
30
|
+
- "The wrong tool was called"
|
|
31
|
+
- "My workflow is stuck"
|
|
32
|
+
- "How do I read traces?"
|
|
33
|
+
- "How do I check logs?"
|
|
34
|
+
- "The LLM is hallucinating"
|
|
35
|
+
- "Something broke after my last change"
|
|
36
|
+
- "My deploy failed"
|
|
37
|
+
- "`adk check` found errors"
|
|
38
|
+
- "Summarize this trace"
|
|
39
|
+
- "What happened in trace X?"
|
|
40
|
+
- "Give me an overview of this conversation turn"
|
|
41
|
+
- "Why did the bot do X in this trace?"
|
|
42
|
+
- "Walk me through what happened"
|
|
43
|
+
- "How do I debug this?"
|
|
44
|
+
- "Summarize this conversation"
|
|
45
|
+
- "Explain what happened in conversation X"
|
|
46
|
+
- "Why did the bot respond that way?"
|
|
47
|
+
- "Walk me through this conversation"
|
|
48
|
+
- "What went wrong in this conversation?"
|
|
49
|
+
|
|
50
|
+
## Available Documentation
|
|
51
|
+
|
|
52
|
+
| File | Contents |
|
|
53
|
+
|------|----------|
|
|
54
|
+
| `references/traces-and-logs.md` | CLI debugging tools, log querying, trace structure, span types, `onTrace` hooks, reproduction with `adk chat` |
|
|
55
|
+
| `references/common-failures.md` | Runtime failure patterns — validation, bot not responding, tool errors, workflow stuck, integration failures, build errors, config confusion |
|
|
56
|
+
| `references/llm-debugging.md` | LLM behavior issues — wrong tool, hallucinated params, refusals, token limits, looping, reading model reasoning |
|
|
57
|
+
| `references/debug-workflow.md` | The systematic 8-step debug loop: validate → reproduce → logs → traces → classify → fix → verify → prevent |
|
|
58
|
+
| `references/trace-summarization.md` | How to fetch, walk, and summarize traces as free-form natural-language narratives — adapting depth to context |
|
|
59
|
+
| `references/conversation-analysis.md` | How to summarize and explain full conversations — listing conversations, timeline analysis, correlating with traces, common patterns |
|
|
60
|
+
|
|
61
|
+
## How to Answer
|
|
62
|
+
|
|
63
|
+
1. **"How do I read traces/logs?"** → Read `traces-and-logs.md` for CLI commands and trace structure
|
|
64
|
+
2. **Something is broken, known pattern** → Read `common-failures.md` for the matching failure pattern
|
|
65
|
+
3. **LLM is misbehaving** → Read `llm-debugging.md` for the matching behavior issue
|
|
66
|
+
4. **Systematic investigation needed** → Read `debug-workflow.md` and follow the 8-step loop
|
|
67
|
+
5. **"Summarize this trace" / "What happened?"** → Read `trace-summarization.md` for how to fetch, walk, and narrate traces
|
|
68
|
+
6. **"Summarize this conversation" / "Explain what happened"** → Read `conversation-analysis.md` for multi-turn conversation summaries and explanations
|
|
69
|
+
7. **After fixing, need to prevent regression** → Point to the `adk-evals` skill for writing evals
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Quick Reference
|
|
74
|
+
|
|
75
|
+
### The Debug Loop
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
symptom → validate (adk check) → reproduce (adk chat) → logs (adk logs) → traces (adk traces) → root cause → fix → verify
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### CLI Commands (always use `--format json`)
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
adk check --format json # offline validation
|
|
85
|
+
adk logs error --format json # recent errors
|
|
86
|
+
adk logs --follow --format json # stream live
|
|
87
|
+
adk traces --format json # recent traces
|
|
88
|
+
adk traces --conversation-id <id> --format json # specific conversation
|
|
89
|
+
adk chat --single "msg" --format json # test message
|
|
90
|
+
adk dev --non-interactive --format json # structured dev output
|
|
91
|
+
adk conversations --format json # list recent conversations
|
|
92
|
+
adk conversations show <id> --format json # conversation timeline
|
|
93
|
+
adk conversations show <id> --include-llm --format json # timeline with LLM reasoning
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Span Types
|
|
97
|
+
|
|
98
|
+
| Type | What It Shows |
|
|
99
|
+
|------|--------------|
|
|
100
|
+
| `think` | LLM reasoning — why it chose an action |
|
|
101
|
+
| `tool_call` | Tool invocation — name, input, output, success/error |
|
|
102
|
+
| `code_execution_exception` | Runtime error — message and stack trace |
|
|
103
|
+
| `end` | Conversation turn completed |
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Prerequisites Check
|
|
108
|
+
|
|
109
|
+
Before debugging, verify:
|
|
110
|
+
|
|
111
|
+
- [ ] **Project valid?** Run `adk check --format json` — fix any reported issues first
|
|
112
|
+
- [ ] **Dev server running?** `adk dev` (or `adk dev --non-interactive --format json` for structured output)
|
|
113
|
+
- [ ] **Bot linked?** `agent.json` exists with `botId` and `workspaceId` (created by `adk link`)
|
|
114
|
+
- [ ] **Dev bot created?** `agent.local.json` has `devId` (set automatically by the first `adk dev` run)
|
|
115
|
+
- [ ] **Integration configured?** Check Dev Console at localhost:3001 for unconfigured integrations
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Critical Patterns
|
|
120
|
+
|
|
121
|
+
✅ **Run `adk check` before debugging runtime issues**
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# CORRECT — catch config/schema problems offline first
|
|
125
|
+
adk check --format json
|
|
126
|
+
# Then debug runtime issues
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
❌ **Skipping offline validation**
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# WRONG — jumping straight to runtime debugging wastes time on config issues
|
|
133
|
+
adk traces --format json # might be chasing a config problem
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
✅ **Use `--format json` on all CLI commands**
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# CORRECT — structured output for reliable parsing
|
|
142
|
+
adk logs error --format json
|
|
143
|
+
adk traces --format json
|
|
144
|
+
adk chat --single "test" --format json
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
❌ **Parsing human-readable output**
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# WRONG — human-readable format is for display, not parsing
|
|
151
|
+
adk logs error
|
|
152
|
+
adk traces
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
✅ **Use `adk logs error` to filter errors**
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# CORRECT — focused error scan
|
|
161
|
+
adk logs error --format json
|
|
162
|
+
adk logs warning since=1h --format json
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
❌ **Scrolling through all output**
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# WRONG — too much noise, easy to miss the actual error
|
|
169
|
+
adk logs --format json # 50 entries of everything
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
✅ **Use `onTrace` hooks for programmatic monitoring**
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
// CORRECT — structured, automated trace analysis
|
|
178
|
+
hooks: {
|
|
179
|
+
onTrace: ({ trace }) => {
|
|
180
|
+
if (trace.type === "tool_call" && !trace.success) {
|
|
181
|
+
console.error(`[TOOL ERROR] ${trace.tool_name}`, trace.error);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
❌ **Only checking console output**
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
// WRONG — console.log in handlers misses the structured trace data
|
|
191
|
+
handler: async (input) => {
|
|
192
|
+
console.log("tool called"); // not useful for debugging
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
✅ **Write a regression eval after fixing**
|
|
199
|
+
|
|
200
|
+
```typescript
|
|
201
|
+
// CORRECT — prevents the bug from coming back
|
|
202
|
+
export default new Eval({
|
|
203
|
+
name: 'fix-order-lookup',
|
|
204
|
+
type: 'regression',
|
|
205
|
+
conversation: [{ user: 'Look up order 123', assert: { tools: [{ called: 'lookupOrder' }] } }],
|
|
206
|
+
})
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
❌ **Fixing and moving on**
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
// WRONG — the same bug will return and you'll debug it again
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Example Questions
|
|
218
|
+
|
|
219
|
+
**Basic:**
|
|
220
|
+
- "My bot isn't responding — how do I figure out why?"
|
|
221
|
+
- "How do I check for errors in my ADK project?"
|
|
222
|
+
- "What's the difference between agent.json and agent.local.json?"
|
|
223
|
+
|
|
224
|
+
**Intermediate:**
|
|
225
|
+
- "The bot called createTicket instead of lookupTicket — how do I fix this?"
|
|
226
|
+
- "My workflow starts but the second step never runs"
|
|
227
|
+
- "How do I see what the LLM was thinking when it made a decision?"
|
|
228
|
+
- "Integration actions are failing with auth errors"
|
|
229
|
+
|
|
230
|
+
**Advanced:**
|
|
231
|
+
- "How do I set up onTrace hooks for automated error detection?"
|
|
232
|
+
- "The model loops on the same tool call — how do I add a guardrail?"
|
|
233
|
+
- "How do I monitor tool call performance with timing metrics?"
|
|
234
|
+
- "How do I systematically debug a multi-step workflow failure?"
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Response Format
|
|
239
|
+
|
|
240
|
+
**Match depth to the question.**
|
|
241
|
+
|
|
242
|
+
### Simple questions ("how do I check logs?", "what are trace spans?")
|
|
243
|
+
|
|
244
|
+
Answer directly — one sentence + the CLI command or concept. Don't run the full debug loop for informational questions.
|
|
245
|
+
|
|
246
|
+
### Active debugging ("my bot is broken", "X isn't working")
|
|
247
|
+
|
|
248
|
+
Follow the full loop:
|
|
249
|
+
|
|
250
|
+
1. **Check prerequisites** — verify dev server, config files, project validation
|
|
251
|
+
2. **Start with `adk check --format json`** — rule out offline issues
|
|
252
|
+
3. **Reproduce** — use `adk chat --single "msg" --format json` to create a clean reproduction
|
|
253
|
+
4. **Read the evidence** — `adk logs error --format json` for quick scan, `adk traces --format json` for details
|
|
254
|
+
5. **Identify the root cause** — point to the specific span, log entry, or config issue
|
|
255
|
+
6. **Suggest a targeted fix** — reference the appropriate failure pattern doc
|
|
256
|
+
7. **Verify** — re-run the reproduction, confirm clean output
|
|
257
|
+
8. **Write a regression eval** — load the `adk-evals` skill and generate the eval file automatically
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# Common Failure Patterns
|
|
2
|
+
|
|
3
|
+
Each pattern follows: **Symptom → How to Check → Root Cause → Fix**.
|
|
4
|
+
|
|
5
|
+
Always use `--format json` on CLI commands for structured, parseable output.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Project Won't Validate
|
|
10
|
+
|
|
11
|
+
**Symptom:** `adk check --format json` reports errors before you even run the bot.
|
|
12
|
+
|
|
13
|
+
**How to check:**
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
adk check --format json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Common causes:**
|
|
20
|
+
|
|
21
|
+
- Missing or invalid `agent.config.ts` fields
|
|
22
|
+
- Schema mismatch between action/tool input and output definitions
|
|
23
|
+
- Invalid entity names (too long or contains invalid characters)
|
|
24
|
+
- Missing dependency (integration not added with `adk add`)
|
|
25
|
+
- Import from wrong source (e.g., importing from `@botpress/sdk` instead of `@botpress/runtime`)
|
|
26
|
+
- Invalid table schema definitions
|
|
27
|
+
|
|
28
|
+
**Fix:** Read the `adk check` output — it reports the exact file, field, and error. Fix each reported issue and re-run.
|
|
29
|
+
|
|
30
|
+
**Note:** It does not run full TypeScript type-checking, formatting or linting; that is project specific.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. Bot Not Responding
|
|
35
|
+
|
|
36
|
+
**Symptom:** You send a message but get no reply.
|
|
37
|
+
|
|
38
|
+
**How to check:**
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Is the dev server running?
|
|
42
|
+
adk logs --format json
|
|
43
|
+
|
|
44
|
+
# Any startup errors?
|
|
45
|
+
adk logs error --format json
|
|
46
|
+
|
|
47
|
+
# Try sending a test message
|
|
48
|
+
adk chat --single "Hello" --format json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Common causes:**
|
|
52
|
+
|
|
53
|
+
| Cause | How to Verify |
|
|
54
|
+
|-------|--------------|
|
|
55
|
+
| No dev bot created | Check that `agent.local.json` has `devId` (set automatically on the first `adk dev` run, or manually via `adk link --local`). If missing, run `adk dev` at least once to create the dev bot. |
|
|
56
|
+
| Integration not configured | Check Dev Console at localhost:3001 — look for unconfigured integrations |
|
|
57
|
+
|
|
58
|
+
**Fix:** Work through the checklist top to bottom. Most "bot not responding" issues are missing config or a stopped dev server.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 3. Tool Call Errors
|
|
63
|
+
|
|
64
|
+
**Symptom:** The bot tries to use a tool but it fails, or returns unexpected results.
|
|
65
|
+
|
|
66
|
+
**How to check:**
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
adk traces --format json
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Look for `tool_call` spans with `success: false`. Some tools could be workflows or actions wrapped as tools: follow the money and find the real source.
|
|
73
|
+
|
|
74
|
+
**Common causes:**
|
|
75
|
+
|
|
76
|
+
| Cause | Trace Evidence |
|
|
77
|
+
|-------|---------------|
|
|
78
|
+
| Handler throws an error | `error` field has the exception message |
|
|
79
|
+
| Input schema mismatch | `error` mentions validation or type error |
|
|
80
|
+
| Integration auth expired | `error` mentions 401, unauthorized, or token expired |
|
|
81
|
+
| Missing integration config | `error` mentions missing configuration or credentials |
|
|
82
|
+
|
|
83
|
+
**Fix:**
|
|
84
|
+
|
|
85
|
+
- **Handler error:** Read the error message, fix the handler code
|
|
86
|
+
- **Schema mismatch:** Compare `input` in the trace against the tool's input schema definition
|
|
87
|
+
- **Auth expired:** Reconfigure the integration in the Dev Console (localhost:3001) which must be done interactively
|
|
88
|
+
- **Missing config:** Run `adk info <integration> --format json` to see required config, then configure in Dev Console which must also be done interactively
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 4. Workflow Stuck
|
|
93
|
+
|
|
94
|
+
**Symptom:** A workflow starts but never completes, or a step doesn't execute.
|
|
95
|
+
|
|
96
|
+
**How to check:**
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
adk traces --format json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Look for workflow-related traces that start but have no completion.
|
|
103
|
+
|
|
104
|
+
**Common causes:**
|
|
105
|
+
|
|
106
|
+
- **Step not resuming:** The workflow is waiting for a step that depends on an external event or trigger that hasn't fired
|
|
107
|
+
- **`step.sleep()` still waiting:** A sleep step hasn't expired yet — check the duration
|
|
108
|
+
- **Missing trigger to continue:** A multi-step workflow needs a trigger (e.g., user message, webhook) to resume after a pause
|
|
109
|
+
- **Error in step handler:** A step threw an error silently — check for `code_execution_exception` spans
|
|
110
|
+
- **State lost:** Workflow state wasn't persisted correctly between steps
|
|
111
|
+
|
|
112
|
+
**Fix:** Identify which step the workflow is stuck on, then check that step's handler, triggers, and dependencies.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 5. Integration Failures
|
|
117
|
+
|
|
118
|
+
**Symptom:** Integration actions fail, events don't fire, or channels don't work.
|
|
119
|
+
|
|
120
|
+
**How to check:**
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Check logs for integration errors
|
|
124
|
+
adk logs error --format json
|
|
125
|
+
|
|
126
|
+
# Check traces for failed integration calls
|
|
127
|
+
adk traces --format json
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Also check the Dev Console at localhost:3001 for integration status.
|
|
131
|
+
|
|
132
|
+
**Common causes:**
|
|
133
|
+
|
|
134
|
+
| Cause | How to Identify |
|
|
135
|
+
|-------|----------------|
|
|
136
|
+
| Auth expired or missing | Error mentions 401, unauthorized, or token |
|
|
137
|
+
| Rate limited | Error mentions 429 or rate limit |
|
|
138
|
+
| Wrong config values | Integration actions fail with config-related errors |
|
|
139
|
+
| Events not registered in dev mode | Events work in production but not locally — re-run `adk dev` |
|
|
140
|
+
| Channel routing misconfigured | Messages arrive but aren't routed to the right conversation handler |
|
|
141
|
+
|
|
142
|
+
**Fix:**
|
|
143
|
+
|
|
144
|
+
- **Auth:** Reconfigure the integration in Dev Console
|
|
145
|
+
- **Rate limits:** Add retry logic or reduce request frequency
|
|
146
|
+
- **Config:** Run `adk info <integration> --format json` to verify required fields, update in Dev Console
|
|
147
|
+
- **Events in dev:** Restart `adk dev` — event registration sometimes needs a fresh start
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 6. Build and Deploy Errors
|
|
152
|
+
|
|
153
|
+
**Symptom:** `adk deploy` or `adk build` fails.
|
|
154
|
+
|
|
155
|
+
**How to check:**
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Always validate offline first
|
|
159
|
+
adk check --format json
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Common causes:**
|
|
163
|
+
|
|
164
|
+
- **Import from wrong source:** Using `@botpress/sdk` where `@botpress/runtime` is needed (or vice versa)
|
|
165
|
+
- **Schema mismatch:** Action/tool input or output schema doesn't match the handler's actual types
|
|
166
|
+
- **Missing dependency:** Integration referenced in code but not added with `adk add`
|
|
167
|
+
- **Type errors in generated code:** Usually caused by stale generated types — run `adk build` or re-run `adk dev` to regenerate
|
|
168
|
+
|
|
169
|
+
**Fix:** Start with `adk check --format json` — it catches most issues offline. For type errors, try deleting `.adk/` and running `adk build` or re-running `adk dev` to regenerate.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 7. Code Execution Exceptions
|
|
174
|
+
|
|
175
|
+
**Symptom:** The LLMz sandbox throws an error during code execution.
|
|
176
|
+
|
|
177
|
+
**How to check:**
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
adk traces --format json
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Look for spans with type `code_execution_exception`.
|
|
184
|
+
|
|
185
|
+
**Key fields:**
|
|
186
|
+
|
|
187
|
+
- `message` — the error message
|
|
188
|
+
- `stackTrace` — full stack trace pointing to the failing line
|
|
189
|
+
|
|
190
|
+
**Common causes:**
|
|
191
|
+
|
|
192
|
+
- Undefined variable or function in the generated code
|
|
193
|
+
- Async operation that wasn't awaited
|
|
194
|
+
- Tool output shape doesn't match what the LLM expected
|
|
195
|
+
- Runtime exception in user-defined code called from the sandbox
|
|
196
|
+
|
|
197
|
+
**Fix:** Read the stack trace. Correlate the line numbers with the generated code or your source. Fix the underlying issue — often a tool's output schema or a missing null check.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## 8. Config Confusion: agent.json vs agent.local.json
|
|
202
|
+
|
|
203
|
+
**Symptom:** Bot connects to the wrong workspace, wrong bot ID, or `adk dev`/`adk chat`/`adk deploy` commands fail unexpectedly.
|
|
204
|
+
|
|
205
|
+
### How the files work
|
|
206
|
+
|
|
207
|
+
| File | Purpose | Git Status | Created By |
|
|
208
|
+
|------|---------|-----------|-----------|
|
|
209
|
+
| `agent.json` | Primary config: `botId`, `workspaceId`, `apiUrl` | Committed | `adk link` |
|
|
210
|
+
| `agent.local.json` | Local overrides: `botId`, `workspaceId`, `apiUrl`, `devId` | Gitignored | `adk dev` or `adk link --local` (sets `devId`), manual edits |
|
|
211
|
+
|
|
212
|
+
**`agent.local.json` fields take precedence over `agent.json` fields.** If both files define `botId`, the local one wins.
|
|
213
|
+
|
|
214
|
+
### Common issues
|
|
215
|
+
|
|
216
|
+
| Issue | Cause | Fix |
|
|
217
|
+
|-------|-------|-----|
|
|
218
|
+
| Wrong bot ID used | `agent.local.json` overrides `agent.json` botId | Check both files, remove or update the local override |
|
|
219
|
+
| `adk chat` fails with "no devId" | `adk dev` hasn't been run yet (devId not set) | Run `adk dev` at least once to create the dev bot |
|
|
220
|
+
| Different behavior on teammate's machine | They have different `agent.local.json` | Expected — local overrides are per-developer |
|
|
221
|
+
| Deploy targets wrong bot | `agent.json` has wrong botId | Update `agent.json` via `adk link` or `adk config:set` |
|
|
222
|
+
|
|
223
|
+
### Checking your config
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
# See what's in agent.json
|
|
227
|
+
cat agent.json
|
|
228
|
+
|
|
229
|
+
# See local overrides (if any)
|
|
230
|
+
cat agent.local.json
|
|
231
|
+
```
|