Skip to content

Repository files navigation

Agent CI

仓库:https://github.com/tdlxgpp/agent-ci

AI Agent 时代的 CI + QA 工作台:开源、本地优先、中英文友好。 当前状态:MVP 开发中(从 MCP Postman 迁移/扩展而来)。

定位

Agent CI 把 AI Agent 开发纳入软件工程流程:

  • 连接并测试任意 MCP Server(stdio / Streamable HTTP / SSE)
  • 录制 Agent / 工具轨迹,回放、diff、定位首个行为变化
  • 用 YAML / TOML 定义测试套件与回归门禁
  • 安全扫描、动态探测、成本/时延预算
  • 输出 JUnit / Markdown / JSON 报告,接入 GitHub Actions / GitLab CI
  • 本地 Web UI

目标不是“又一个 eval 库”,而是 Agent 的 Jenkins + Postman + Playwright

快速开始

pip install -e ".[web]"

agent-ci init            # 生成 .agent-ci/ 配置
agent-ci ci baseline.json current.json   # 一站式回归门禁+报告
agent-ci mcp-new demo-server --tools echo,health
agent-ci list --config demo-server/server.yaml
agent-ci test demo-server/tests/smoke.yaml --config demo-server/server.yaml
agent-ci test examples/demo-suite.yaml --config examples/server.yaml
agent-ci hook --output .agent-ci/traces/hooks.jsonl   # 从 stdin 接收 Claude/Codex/Gemini hook
agent-ci import ~/.dsh/sessions/**/session.jsonl.zstd --output dsh-trace.json
agent-ci trace-ingest events.jsonl --output trace.json
agent-ci trace-run examples/agent-trace.yaml --config examples/server.yaml --profile demo --output current.json
agent-ci scenario examples/scenario.yaml --config examples/server.yaml --output .agent-ci/traces/scenario.json
agent-ci simulate-user "客服退款流程" --turns 3 --output .agent-ci/scenarios/refund.yaml --endpoint http://127.0.0.1:11434/v1 --model judge
agent-ci diff baseline.json current.json
agent-ci replay-server baseline.json .tmp/replay-server
agent-ci trace-fork baseline.json branch.json --tool add --output-value '{"structuredContent":{"result":99},"isError":false}'
agent-ci gate baseline.json current.json --fail-on any
agent-ci check baseline.json current.json --max-cost 0.1 --max-steps 10
agent-ci budget current.json --max-cost 0.1 --max-steps 10
agent-ci github-comment --repo owner/repo --pr 1 --body "Agent CI: passed"
agent-ci github-report --repo owner/repo --pr 1 --report check.json
agent-ci github-status --repo owner/repo --sha HEAD --state success --context agent-ci
agent-ci github-branch-protection --repo owner/repo --branch main --contexts agent-ci
agent-ci judge --text "hello" --criteria "is polite" --model local-judge
agent-ci otel-serve --port 4318 --storage .agent-ci/traces
agent-ci web --port 8765

当前能力

  • MCP Builder:生成 Python MCP Server 项目(mcp-new / Web UI MCP Builder
  • MCP 客户端:stdio / Streamable HTTP / SSE
  • 工具列表、调用、YAML/TOML 断言、JUnit/Markdown 报告
  • 录制 / 回放、Agent 轨迹录制/回放、多 profile 兼容矩阵
  • 安全扫描、动态探测
  • 统一导入:DSH(.zstd)、ZCode log/rollout、OpenCode/通用 JSONL(import
  • Hook 采集:Claude Code / Codex / Gemini CLI 风格 hook JSON(hook
  • 通用 Trace Schema + JSON/JSONL、trace-run / diff / gate / budget / check
  • 非确定字段处理:diff / gate / check 支持 --ignore-fields / --mask-fields
  • OTel GenAI 轨迹采集(otel-serve / otel-parse
  • 配置格式:YAML / JSON / TOML(双格式支持)
  • 本地 Web UI(FastAPI):工具浏览 + 轨迹 diff/gate/budget + MCP Builder

文档

路线

  1. MCP 工具层质量闭环(由 MCP Postman 继承)
  2. Agent 行为回归:OTel / hook 采集 + 回放 + diff + GitHub Action
  3. 安全/成本/权限门禁 + 场景模拟 + 团队协作
  4. 长期:Agent Runtime Control Plane / 审计

相关

反馈 / 社区

欢迎任何真实使用反馈:哪一步最痛、哪些字段导致误报、希望接入哪个 Agent 框架,都可以直接提 Issue。

开发

pip install -e ".[dev]"
pytest -q

MIT License.

About

Agent CI: CI + QA workbench for AI agents (MCP testing, trace replay/diff/gate, OTel, budgets, local web UI)

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages