agent-fleet/openspec/changes/dual-execution-model/specs/notification-via-forgejo/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

1.6 KiB
Raw Blame History

MODIFIED Requirements

Requirement: Git branch as task execution unit

每个任务 SHALL 关联一个 Git 分支无论哪种执行模式。Agent 在该分支上工作,通过 PR 提交结果。

Scenario: ssh_cli mode — Orchestrator creates branch

  • WHEN ssh_cli 模式任务开始执行
  • THEN Orchestrator SHALL 在目标仓库创建分支 task/{task_id}(通过 SSH 在远程主机执行 git checkout -b
  • AND 将分支名传入 Agent prompt

Scenario: http_pull mode — Agent creates branch

  • WHEN http_pull 模式任务被 Agent 领取
  • THEN Agent SHALL 自行创建分支 task/{task_id}

Requirement: PR webhook as completion notification

无论哪种执行模式Agent 完成任务后 SHALL 通过 Forgejo PR 触发状态更新。

Scenario: ssh_cli mode — Agent creates PR via CLI

  • WHEN ssh_cli 模式的 Agent 执行完成
  • THEN Agent或 Orchestrator 通过 SSH SHALL push 到 task 分支并创建 PR
  • AND Forgejo PR webhook 触发状态更新

Scenario: http_pull mode — same flow

  • WHEN http_pull 模式的 Agent 执行完成
  • THEN Agent SHALL push 到 task 分支并创建 PR
  • AND Forgejo PR webhook 触发状态更新(与 ssh_cli 模式相同)

Requirement: Push events as progress tracking

无论哪种执行模式Forgejo push webhook SHALL 作为进度信号。

Scenario: ssh_cli mode — push detected

  • WHEN ssh_cli 模式执行中Agent push 到 task 分支
  • THEN Orchestrator 更新 last_activity_at(与 http_pull 模式相同)