Skip to main content
Glama

AI 编码编排器(aico V2)

一个生产级本地 CLI 应用,旨在编排专门的编码代理:

  • Codex CLI → 首席软件架构师、核心开发者和复杂问题解决者。

  • Antigravity / AGY CLI → 质量保证、审查者、回归测试者和小型修复代理。

  • 扩展代理 → Claude、Gemini 和 本地 LLM(通过 Ollama / OpenAI 兼容端点)。

aico 管理状态机、工作流转换、Git worktree 隔离、提示模板、并行测试执行、AST 安全扫描、人在回路审批、MCP 服务器集成和全面报告。


🏗️ 架构

                    ┌────────────────────────┐
                    │      USER / CLI        │
                    │         (aico)         │
                    └───────────┬────────────┘
                                │
                        TASK RECEIVED
                                │
                    ┌───────────▼────────────┐
                    │  GIT & WORKTREE CHECK  │
                    │ Zero-Impact Isolation  │
                    └───────────┬────────────┘
                                │
                    ┌───────────▼────────────┐
                    │       CODEX CLI        │
                    │  • Architecture Design │
                    │  • Core Implementation │
                    │  • Complex Fixes       │
                    └───────────┬────────────┘
                                │
                    ┌───────────▼────────────┐
                    │        AGY CLI         │
                    │  • Review & Test Plan  │
                    │  • Parallel Validation │
                    │  • AST Security Audit  │
                    │  • Issue Classification│
                    └───────────┬────────────┘
                                │
                 ┌──────────────┴──────────────┐
                 │ Issue Classification Branch │
                 └──────────────┬──────────────┘
                                │
       ┌────────────────────────┼────────────────────────┐
       │                        │                        │
     PASS                   SMALL_FIX           COMPLEX / ARCH / BUG / SEC
       │                        │                        │
       ▼                        ▼                        ▼
PARALLEL VALIDATION          AGY FIX                 CODEX FIX
(Test, Lint, Type,           (Local)                 (Deep Fix)
 Build, Security)               │                        │
       │                        ▼                        ▼
       ▼                    AGY RETEST               AGY RETEST
     DONE                       │                        │
                                └─────────►◄─────────────┘

Related MCP server: worker-bridge

🚀 V2 功能与增强

  1. 🌿 零影响 Git Worktree 隔离(--worktree / -w):

    • 在隔离的 Git worktree 中执行所有代理操作,不触碰你活跃的编辑器文件或未暂存的更改。

    • 任务成功完成后自动同步并合并。

  2. ⚡ 并行质量与测试引擎(aico test):

    • 在工作线程池中并发执行单元测试、Linter(ruff/eslint)、类型检查器(mypy/tsc)、构建和安全审计。

  3. 🛡️ 内置 AST 与静态安全扫描器(aico scan):

    • 实时检测 SQL 注入风险、命令注入(shell=True)、硬编码 JWT 密钥、弱加密(MD5/SHA1)以及不安全的动态执行(eval/exec)。

  4. 🔶 人在回路(HITL)模式(--interactive / -i):

    • 在架构更改或安全修复之前进行交互式检查点审批,并直接注入提示指导([A]pprove、[E]dit guidance、[R]eject、[Q]uit)。

  5. 🎯 细粒度多层级模型路由:

    • 为每个阶段配置不同的模型(例如,架构使用 o3-mini / claude-3-7-sonnet,测试审查使用 gemini-2.0-flash,小型修复使用 gpt-4o-mini)。

  6. 🔌 模型上下文协议(MCP)服务器(aico mcp):

    • 将 aico 作为标准 MCP 服务器运行,以便与 Cursor、Antigravity IDE、Claude Desktop 和其他 MCP 客户端无缝集成。

  7. 🤖 扩展代理支持:

    • 内置适配器,支持 Claude CLI、Gemini CLI 和 本地 LLM(Ollama / OpenAI 兼容)。


📦 安装与设置

cd /var/www/html/ai-coding-orchestrator
pip install -e .

验证安装:

aico doctor

💻 CLI 命令参考

命令

描述

aico

启动交互式提示会话

aico "task"

在当前工作目录中运行直接任务

aico run "task"

显式任务运行

aico run -w "task"

在隔离的 Git worktree 中运行(零影响)

aico run -i "task"

使用 交互式人在回路 检查点运行

aico test

运行并行测试、lint、类型检查、构建和安全检查

aico scan

运行静态 AST 与正则表达式安全漏洞扫描

aico mcp

启动模型上下文协议(MCP)JSON-RPC stdio 服务器

aico resume

从保存的 .ai-orchestrator/state.json 恢复中断的任务

aico status

检查当前任务状态、迭代次数和指标

aico logs

查看统一日志(--agent codex、--agent agy)

aico stop

中止并取消活动任务

aico config show

查看当前配置

aico config set <key> <val>

更新配置键

aico doctor

对 Codex、AGY 和 Git 运行健康检查


⚙️ 配置(~/.aico/config.yaml)

codex:
  command: "codex"
  timeout: 3600
  flags: ["exec", "--dangerously-bypass-approvals-and-sandbox"]
  model: null
  architecture_model: null
  implementation_model: null
  fix_model: null

agy:
  command: "agy"
  timeout: 1800
  flags: ["--print", "--dangerously-skip-permissions"]
  model: null
  review_model: null
  testing_model: null
  fix_model: null

workflow:
  max_iterations: 5
  max_codex_attempts: 5
  max_agy_attempts: 5
  auto_resume: false
  stop_on_environment_issue: true
  interactive: false
  require_approval_on_architecture: false
  require_approval_on_security: false

git:
  enabled: true
  create_branch: true
  branch_prefix: "ai-orchestrator"
  auto_stash_uncommitted: false
  use_worktree: false

testing:
  run_tests: true
  run_lint: true
  run_typecheck: true
  run_build: true
  run_security_scan: true
  parallel: true
  max_workers: 4

safety:
  protect_uncommitted_changes: true
  allow_destructive_git: false

📂 工作区布局

.ai-orchestrator/
├── state.json           # Machine-readable task state and transition history
├── task.md              # Original user task
├── architecture.md      # Architecture design from Codex
├── final-report.md      # Comprehensive post-task markdown report
│
├── codex/
│   ├── prompt.md        # Prompt sent to Codex
│   ├── result.md        # Codex execution summary
│   └── issues.md        # Issues addressed
│
├── agy/
│   ├── prompt.md        # Prompt sent to AGY
│   ├── test-plan.md     # Test plan created by AGY
│   ├── result.md        # AGY validation results
│   ├── issues.md        # Issues detected
│   └── fixes.md         # Small fixes applied
│
├── logs/
│   ├── orchestrator.log # Workflow state transitions
│   ├── codex.log        # Raw stdout/stderr of Codex
│   └── agy.log          # Raw stdout/stderr of AGY
│
├── worktrees/           # Isolated git worktrees (when enabled)
└── checkpoints/         # Git snapshots before major stages

🧪 测试套件

运行覆盖所有 V1 和 V2 功能的完整测试套件:

pytest -v

65 个单元测试和集成测试全部通过,成功率为 100%。

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Delegate coding tasks to external AI coding agents in isolated git worktrees with independent verification, enabling any MCP client to orchestrate multi-agent workflows.
    5
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    Provides a Model Context Protocol interface for secure, multi-agent collaboration on Git repositories, offering isolated workspaces, change requests, reviews, and approval workflows with Git as the source of truth.
    32
    MIT