troubleshoot
Skill này làm gì
Skill hướng dẫn chẩn đoán từng bước các lỗi trong mã Atomic Agents, khớp thông báo lỗi phổ biến với nguyên nhân và cách sửa đã biết. Dành cho lập trình viên có agent bị crash hoặc trả về kết quả sai.
Khi nào nên dùng
- ✓Khi lập trình viên gặp lỗi kiểm tra từ schema đầu ra của agent.
- ✓Khi agent của lập trình viên trả về đầu ra trống hoặc sai định dạng.
- ✓Khi lập trình viên gặp lỗi import sau khi nâng cấp framework.
Liên kết skill
https://github.com/Eigenwise/atomic-agents/blob/main/claude-plugin/atomic-agents/skills/troubleshoot/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Ứng dụng Atomic Agents của tôi báo ValidationError ở đầu ra. Đây là traceback. Điều gì sai?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill yêu cầu toàn bộ thông báo lỗi và đoạn mã tạo ra nó, khớp thông báo với nguyên nhân đã biết, áp dụng cách sửa, rồi chạy lại ví dụ lỗi để xác nhận.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 |
Câu hỏi thường gặp
Có cần toàn bộ thông báo lỗi không?
Có. Skill yêu cầu toàn bộ traceback trước khi đoán nguyên nhân.
Nó có xác nhận cách sửa đã hoạt động không?
Có. Skill yêu cầu chạy lại đoạn mã lỗi trước khi coi vấn đề là đã giải quyết.
Nếu lỗi không có trong danh sách thì sao?
Skill nói nên xem tài liệu tham khảo của khu vực đang lỗi và suy luận từ đó.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 6.3k
- Vị trí xếp hạng
- #14243
- Giấy phép
- MIT
- Cập nhật
- 29/10/2026
Bình luận
- …
Thêm skill từ kho mã này
create-atomic-agent
6.3kGiúp agent của bạn xây dựng một Atomic Agents agent mới với đầu vào và đầu ra có kiểu, system prompt và nhà cung cấp AI đã chọn.
create-atomic-context-provider
6.3kGiúp agent của bạn thêm một context provider vào Atomic Agents agent, để các thông tin mới như thời gian hoặc tài liệu truy xuất xuất hiện trong prompt.
create-atomic-schema
6.3kGiúp agent của bạn thiết kế schema đầu vào và đầu ra có kiểu cho Atomic Agents agent và công cụ, với mô tả trường rõ ràng.
create-atomic-tool
6.3kGiúp agent của bạn xây dựng một công cụ có kiểu cho ứng dụng Atomic Agents, chẳng hạn một lớp bọc API hoặc máy tính mà agent có thể gọi.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.