Guanghu Domestic Migration a27e87cb99 chore: import sanitized domestic snapshot for REPO-007
Source snapshot: 97d7f0fae96dc04b7ddad56fc1db6a108ed662cc

[SEC-CLEAN] · pre-push-clean v1.0 · 109处敏感信息已自动转乱码
2026-07-17 15:59:55 +08:00

4.0 KiB

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

■ 代码验证

■ 需求对照

  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

【交付物】

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