agent-fleet/openspec/changes/adapter-cross-machine-revision/specs/agent-registry/spec.md
Zer4tul e39a16498c feat: dual execution model (SSH CLI + HTTP pull)
- ExecutionMode enum: SshCli (orchestrator dispatches) | HttpPull (agent pulls)
- SSH CLI executor: spawn remote agents via ssh + CLI template
- Local subprocess as SSH special case (localhost)
- HostConfig with capability matching and load-based selection
- Dispatch loop: scan created tasks → select host → execute → update
- CliAdapterConfig: CLI templates for Codex and Claude Code
- Structured prompt construction (Issue → goal/constraints/validation)
- Output parsers: Codex JSON, Claude Code JSON, raw fallback
- TaskStatus::ReviewPending + review_count loop limit
- Forgejo webhook: pull_request (opened→review_pending, merged→completed)
- Forgejo webhook: push events (task/* branch → last_activity_at)
- HTTP API: dequeue only returns http_pull tasks
- HTTP API: status update only for http_pull mode
- Token auth config for http_pull agents
- Adapter module rewritten: AgentAdapter trait removed → config-driven CLI templates
- New fields: execution_mode, assigned_host, branch_name, pr_title, last_activity_at, review_count
- 30/30 tests pass
2026-05-12 14:07:56 +08:00

808 B
Raw Blame History

MODIFIED Requirements

Requirement: Agent self-registration

每台机器上的 Agent 启动时 SHALL 向 Orchestrator Registry 注册自身信息。注册成功后 SHALL 返回 registry token后续 API 调用需携带此 token。

Scenario: New agent starts and registers

  • WHEN 一个远程 Agent 在 host-worker-02 上启动
  • THEN 它 SHALL 调用 POST /api/v1/agents/register
  • AND Orchestrator 记录该 Agent 信息并返回 {agent_id, registry_token}
  • AND 后续所有 Agent API 调用 SHALL 在 header 中携带 Authorization: Bearer {registry_token}

Scenario: Duplicate registration with same agent_id

  • WHEN 已注册的 Agent 重启后再次注册(相同 agent_id
  • THEN 系统 SHALL 更新该 Agent 的信息并返回新的 registry token