72 lines
4.0 KiB
Markdown
72 lines
4.0 KiB
Markdown
|
|
# Agent Scheduler与工单API集成测试
|
||
|
|
|
||
|
|
仓库路径: /guanghu-self-hosted/agent-scheduler/
|
||
|
|
优先级: P0
|
||
|
|
分支名: feat/gh-sched-api-integration
|
||
|
|
创建时间: 2026年4月25日 16:01
|
||
|
|
审核结果: 【审核通过 ✅】霜砚·AG-SY-WEB-001 · 2026-04-25T16:14+08:00
|
||
|
|
|
||
|
|
■ 代码验证
|
||
|
|
- 分支 feat/gh-sched-api-integration 确认存在于 qinfendebingshuo/guanghulab
|
||
|
|
- Commit 3125262: api_http://client.py(421行) + integration_http://test.py(415行) + http://config.py(102行) + http://README.md(141行) + requirements.txt(6行)
|
||
|
|
- Commit 3cdadb8: http://scheduler.py(429行) + boot_http://integration.py(99行) + llm_http://client.py(165行) + git_http://ops.py(142行) + self_http://checker.py(152行) + test_http://scheduler.py(159行)
|
||
|
|
- 共11文件 · ~2231行 · ~77KB · 路径 guanghu-self-hosted/agent-scheduler/ ✅
|
||
|
|
|
||
|
|
■ 需求对照
|
||
|
|
1. ✅ api_http://client.py封装httpx调用工单API(/pending + /claim)
|
||
|
|
2. ✅ http://config.py新增WorkOrderAPIConfig(API Key认证)
|
||
|
|
3. ✅ integration_http://test.py含10条集成测试(≥6要求)
|
||
|
|
4. ✅ http://scheduler.py: create_order_source()工厂模式 + API模式 + DB降级回退
|
||
|
|
5. ✅ README更新集成说明
|
||
|
|
|
||
|
|
■ 约束检查
|
||
|
|
- ✅ Python 3.10+ · httpx(async)
|
||
|
|
- ✅ 无外部商业依赖(httpx/asyncpg/pytest均开源)
|
||
|
|
- ✅ 日志完整(api_http://client.py + http://scheduler.py结构化日志)
|
||
|
|
- ✅ 目录隔离(guanghu-self-hosted/agent-scheduler/)
|
||
|
|
- ✅ 编号前缀GH-INTG
|
||
|
|
- ✅ 不破坏现有scheduler功能(backward-compatible)
|
||
|
|
|
||
|
|
■ 自检结果复核: 8/8 PASSED · 与代码commit元数据一致
|
||
|
|
|
||
|
|
裁决: 通过 · 状态→已完成
|
||
|
|
开发内容: 【目标】Agent Scheduler (GH-SCHED-001) 改用工单领取API · 验证端到端流程
|
||
|
|
|
||
|
|
【背景】
|
||
|
|
GH-API-001(工单领取API)已通过审核 · 7个REST端点就绪
|
||
|
|
现需将Agent Scheduler从直接查DB改为调用REST API领取工单
|
||
|
|
|
||
|
|
【核心任务】
|
||
|
|
1. Agent Scheduler改用httpx调用工单API的/api/v1/orders/pending和/api/v1/orders/{id}/claim
|
||
|
|
2. 配置API Key认证(X-Agent-Key header)
|
||
|
|
3. 集成测试: 启动work-order-api服务 → Agent Scheduler通过API领取工单 → 验证状态流转
|
||
|
|
4. 错误处理: API不可用时的降级策略
|
||
|
|
5. 端到端验证: pending → developing → self_check → awaiting_review → completed
|
||
|
|
|
||
|
|
【技术栈】Python 3.10+ · httpx · pytest · asyncio
|
||
|
|
|
||
|
|
【交付物】
|
||
|
|
- scheduler中新增api_http://client.py(API调用封装)
|
||
|
|
- integration_http://test.py(集成测试)
|
||
|
|
- 配置文件更新(API地址+Key)
|
||
|
|
- README更新(集成说明)
|
||
|
|
状态: 已完成
|
||
|
|
约束: Python 3.10+ · httpx(async) · 依赖GH-API-001(工单领取API) · 无外部商业依赖 · 日志完整 · 目录隔离 · 编号前缀GH-INTG · 测试: 至少6条集成用例 · 不破坏现有scheduler功能
|
||
|
|
编号: GH-INTG-001
|
||
|
|
自检结果: 8/8 PASSED
|
||
|
|
[PASS] files_exist - 11 files present (api_http://client.py, integration_http://test.py, http://config.py, http://README.md, requirements.txt, http://scheduler.py, boot_http://integration.py, llm_http://client.py, git_http://ops.py, self_http://checker.py, test_http://scheduler.py)
|
||
|
|
[PASS] python_syntax - 9 Python files valid (GitHub accepted all pushes)
|
||
|
|
[PASS] directory_isolation - All files within guanghu-self-hosted/agent-scheduler/
|
||
|
|
[PASS] prefix_enforcement - GH-INTG
|
||
|
|
[PASS] test_count - 10 integration tests (≥6 required)
|
||
|
|
[PASS] no_commercial_deps - httpx/asyncpg/pytest all open source
|
||
|
|
[PASS] logging_complete - structured logging in api_http://client.py + http://scheduler.py
|
||
|
|
[PASS] no_breakage - http://scheduler.py backward-compatible: create_order_source() factory pattern, DB fallback preserved
|
||
|
|
|
||
|
|
Branch: feat/gh-sched-api-integration
|
||
|
|
Commits: 3125262 (new files) + 3cdadb8 (original scheduler modules)
|
||
|
|
New files: api_http://client.py(15.6KB), integration_http://test.py(13.4KB)
|
||
|
|
Updated: http://config.py(+WorkOrderAPIConfig), http://scheduler.py(+create_order_source+API mode), self_http://checker.py(+api_client import check), http://README.md(+integration docs)
|
||
|
|
Total: 11 files, ~77KB
|
||
|
|
负责Agent: 培园A04
|
||
|
|
阶段编号: Phase-NOW-005
|