# 1001-test-agent **Repository Path**: runmonk/1001-test-agent ## Basic Information - **Project Name**: 1001-test-agent - **Description**: 测试agent开发 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-11-13 - **Last Updated**: 2026-11-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # mini-agent 从零手搓的 coding agent:`模型 + 工具 + 循环`。没有 LangChain,没有 Cursor SDK,HTTP 用标准库。 Agent 的全部逻辑在 `src/mini_agent/loop.py` 的 `run_agent()`:问模型 → 有 tool call 就执行 → 把结果塞回 messages → 直到模型直接说话或撞上步数上限。 ## 跑起来 ```bash cp .env.example .env # 填 LLM_API_KEY / LLM_BASE_URL / LLM_MODEL PYTHONPATH=src python3 -m mini_agent "用 bash 列出当前目录,再用中文说明这是什么项目" ``` 换国内兼容接口时只改 `.env`,例如 DeepSeek: ``` LLM_BASE_URL=https://api.deepseek.com LLM_MODEL=deepseek-chat ``` 需要改文件时,先把工作区指到空目录,避免 agent 改到自己的源码: ```bash mkdir -p playground PYTHONPATH=src python3 -m mini_agent -w playground "写一个 hello.py,打印 hello" ``` ## 测试(不需要 API key) ```bash PYTHONPATH=src python3 -m unittest discover -s tests -v ``` 测的是两件必须成立的事:路径不能逃出 workspace;循环必须真的调用工具并在模型给出最终回答时停下。 ## 禅道 Bug 分析模式(MVP) 设置 `AGENT_MODE=zentao` 后,对话页变为禅道 Bug 分析 Agent:拉 Bug → 委派 Cursor 子 agent 查代码 → 输出分析报告。 **配置、流程、实现进度、你需要提供的内容** 见 [docs/zentao-agent.md](docs/zentao-agent.md)(随功能更新,改代码时请同步维护该文档)。