troubleshoot
它能做什么
它引导对 Atomic Agents 代码中的错误进行分步诊断,将常见错误信息与已知的修复方法对应起来。适用于智能体崩溃或返回错误结果的开发者。
适用场景
- ✓当开发者在智能体的输出结构定义上遇到验证错误时。
- ✓当开发者的智能体返回空白或格式错误的输出时。
- ✓当开发者升级框架后出现导入错误时。
技能链接
https://github.com/Eigenwise/atomic-agents/blob/main/claude-plugin/atomic-agents/skills/troubleshoot/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的 Atomic Agents 应用在输出上抛出了 ValidationError。这是完整的错误堆栈。问题出在哪里?”
每周 5 个新技能,1 分钟读完。
工作原理
该技能要求提供完整的错误信息和产生该错误的代码,将错误信息与已知原因进行匹配,应用修复,然后重新运行出错的示例以确认问题已解决。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Troubleshoot an Atomic Agents App
Diagnostic workflow for the "it's broken" moment. Most atomic-agents failures are one of a dozen known causes with mechanical fixes. Match the symptom, apply the fix, verify by re-running.
Workflow
- Capture the failure. Get the exact traceback or wrong-output sample plus the code that produces it (agent construction, schemas, client wiring). If the user pasted only a fragment of the error, ask for the full traceback before guessing.
- Match against the symptom table below. The quoted strings are the framework's real messages — match on them.
- Apply the fix and re-run the failing snippet. Do not declare the problem solved without a passing re-run.
- No match? Load the reference for the failing area (table at the bottom) and reason from there. For a whole-codebase audit rather than one failure, delegate to the
atomic-reviewersubagent instead.
Symptom table
Import and definition errors
| Symptom | Cause | Fix |
|---|---|---|
ImportError/ModuleNotFoundError on atomic_agents.lib.*, atomic_agents.agents.base_agent, or BaseAgent |
v1 import paths, removed in v2 | Import from the top level: from atomic_agents import AtomicAgent, AgentConfig, BaseIOSchema, BaseTool; context pieces from atomic_agents.context |
ValueError: <Name> must have a non-empty docstring to serve as its description at import time |
BaseIOSchema subclass without a docstring |
Add a docstring describing the schema — it flows into the LLM prompt, so write it for the model |
ValidationError when constructing AgentConfig, complaining about client |
Raw provider SDK client passed; AgentConfig.client requires an Instructor-wrapped client |
Wrap it: instructor.from_openai(...), instructor.from_anthropic(...), instructor.from_genai(...) |
TypeError about missing type parameters, or output typed as BasicChatOutputSchema when a custom schema was expected |
AtomicAgent instantiated without generics |
Write AtomicAgent[InputSchema, OutputSchema](config=...) — the type parameters carry runtime information (they drive Instructor's response_model) |
Provider errors at run time
| Symptom | Cause | Fix |
|---|---|---|
Anthropic error mentioning max_tokens is required |
Anthropic requires it per request | model_api_parameters={"max_tokens": 4096} on AgentConfig |
| Gemini error about invalid role / role ordering | Gemini names the assistant role model |
assistant_role="model" on AgentConfig; use instructor.from_genai(...) with mode=Mode.GENAI_TOOLS and match AgentConfig.mode |
Empty output, None fields, or JSON-parse noise on Groq / Ollama / MiniMax |
Provider needs JSON mode; factory and config modes disagree | Create the client with Mode.JSON and set mode=Mode.JSON on AgentConfig — the two must always match |
| Works on OpenAI, breaks on another provider with no code change | Provider quirks live in AgentConfig, not the agent |
Check the per-provider matrix in framework/references/providers.md |
Wrong or degraded behavior (no exception)
| Symptom | Cause | Fix |
|---|---|---|
Pydantic ValidationError from inside run() after retries |
Model can't satisfy the output schema | Improve field description=s and the schema docstring first; loosen over-tight constraints; only then consider a stronger model. Inspect attempts via the parse:error hook |
| Agent "forgets" earlier turns | Fresh ChatHistory created per call, or none passed |
Create one ChatHistory and reuse it across run() calls |
| Context/cost grows without bound in long sessions | Unbounded history | Set max_context_tokens on AgentConfig — oldest turns are trimmed automatically |
Every run() is slow before the LLM call even starts |
Blocking I/O in a context provider's get_info() |
get_info() runs on every run(); move fetching out, cache, or make the provider hold precomputed state |
history.load(...) "doesn't work" |
Called as a classmethod | load is an instance method that mutates in place: history = ChatHistory(); history.load(saved). dump() returns a JSON string |
MCP interop
| Symptom | Cause | Fix |
|---|---|---|
AttributeError: STREAMABLE_HTTP |
No such member | MCPTransportType.HTTP_STREAM (others: SSE, STDIO) |
| MCP tools fetch but calls fail | Transport/endpoint mismatch | See MCP section of [framework/references/tools.md](../framework/referen |
常见问题
它需要完整的错误信息吗?
需要。该技能要求先提供完整的错误堆栈,再去猜测原因。
它会确认修复有效吗?
会。该技能要求在认定问题已解决之前,重新运行出错的代码片段。
如果错误不在它的列表中怎么办?
该技能说明应查阅出错领域的参考资料,并从那里推理。
详情
作者的原始描述
Diagnose and fix a failing or misbehaving Atomic Agents app — import errors, schema validation failures, empty or malformed LLM output, provider role/mode errors, history and context problems, MCP transport errors. Use when the user reports an error, traceback, or wrong behavior in atomic-agents code, asks "why is my agent not working / crashing / returning garbage", or pastes a `ValidationError`, `ImportError`, or provider API error from an atomic-agents project.
repo: Eigenwise/atomic-agents
热度
- GitHub 星标
- 6.3k
- 排名
- #14243
- 许可证
- MIT
- 更新时间
- 2026/10/29
评论
- …
同一仓库的更多技能
create-atomic-agent
6.3k帮你的智能体构建一个新的 Atomic Agents 智能体,包括带类型的输入和输出、系统提示词,以及所选的 AI 服务商。
create-atomic-context-provider
6.3k帮你的智能体为 Atomic Agents 智能体添加上下文提供者,使当前时间或检索到的文档等最新细节出现在其提示词中。
create-atomic-schema
6.3k帮你的智能体为 Atomic Agents 智能体和工具设计带类型的输入与输出结构定义,并附上清晰的字段说明。
create-atomic-tool
6.3k帮你的智能体为 Atomic Agents 应用构建一个带类型的工具,例如智能体可以调用的 API 封装或计算器。