a18cb2824e
fix: agent capability matching in dispatch — only agent: labels are requirements
...
Previous bug: only code:* and review labels were checked, so agent:document,
agent:tests etc. were never filtered. Any agent could pick up any task.
Now: labels with agent: prefix are matched against agent capabilities.
Other labels are treated as metadata. Includes regression test.
2026-05-12 23:51:08 +08:00
1f351a1734
docs: replace localhost with FLEET_API_URL, add persistence and heartbeat guidance
...
- Replace all localhost:9090 with FLEET_API_URL:PORT placeholder
- Add Step 0: persist Fleet API URL to agent memory
- Clarify heartbeat must be periodic loop (60s interval)
- Add execution mode self-selection decision flow
- Add persisting configuration section (URL, agent_id, token)
2026-05-12 18:34:23 +08:00
01f5fac718
fix: SSH executor uses source ~/.profile for remote PATH
...
SSH non-interactive sessions don't load .profile, causing 'claude: command not found'.
Prepend 'source ~/.profile 2>/dev/null;' to ensure user PATH is available.
Verified: end-to-end test passed (arm0 → WSL2 Claude Code, 77s execution).
2026-05-12 16:36:02 +08:00
d1a746a8cb
docs: add agent API reference, onboarding guide, and universal skill
...
- docs/agent-api-reference.md (473 lines): complete HTTP API reference for all 12 endpoints
- docs/agent-onboarding-guide.md (272 lines): ssh_cli and http_pull workflows, Forgejo integration
- skill/SKILL.md (281 lines): universal agent skill, platform-agnostic, curl-based examples
All content in English. No code changes.
2026-05-12 14:57:05 +08:00
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
1bc7580ecc
refactor: remove Matrix bot, make agent-fleet platform-agnostic API service
...
- Remove src/integrations/matrix/ (bot connection, command parsing, notification formatting)
- Remove matrix-sdk dependency from Cargo.toml
- Remove MatrixConfig from config.rs and [matrix] from config.example.toml
- Add GET /api/v1/tasks (list with status/agent_id filter)
- Add POST /api/v1/tasks/{task_id}/retry (Failed/AgentLost → Assigned)
- Add EventStore::list_tasks() with parameterized query
- 29/29 tests pass
Platform integration (Telegram, Matrix, Feishu) is Agent-side responsibility.
agent-fleet is now a pure HTTP API orchestration engine.
2026-05-12 10:59:19 +08:00
6efca09018
feat: Matrix ChatOps bot (Task 5)
...
- Matrix bot via matrix-sdk: connect, join room, sync loop
- /fleet status: list all agents with status table
- /assign <agent> <issue>: manual task assignment
- /retry <issue>: re-queue failed/agent_lost task
- Notification formatting: task assigned/completed/failed, agent offline
- Per-agent thread support via Matrix Relation::Thread
- 15 tests: command parsing, notification formatting, fleet status table
2026-05-12 01:12:59 +08:00
1dacd17231
feat: Agent Adapter Interface (Task 7)
...
- AgentAdapter trait: register, heartbeat, execute, submit_receipt, deregister
- AdapterRunner: lifecycle management (start with health check, heartbeat loop, graceful stop)
- AdapterInstanceConfig: per-adapter config (type, work_dir, model, capabilities, env, connection)
- Config integration: adapters field in Config + config.example.toml
- 3 tests: config extraction, runner lifecycle, fake execute
22/22 tests pass.
2026-05-12 00:46:11 +08:00
f60f028f96
feat: Forgejo integration + Receipt protocol
...
Tasks completed:
- 4.1: Forgejo API client (reqwest, HMAC-SHA256, Issue/Comment/Label/PR)
- 4.2: POST /api/v1/webhooks/forgejo (signature verify, event parse)
- 4.3: Issue → Task conversion (agent:* → type, priority:* → priority)
- 4.4: Task status → Issue label sync (status:todo/doing/done)
- 4.5: Receipt → Issue comment (emoji + summary + artifacts)
- 4.6: Reconciliation stub
- 4.7: Tests for HMAC, Issue→Task conversion
- 6.1: POST /api/v1/receipts (validate + transition)
- 6.2: PR artifact validation via Forgejo API
- 6.3: No-trust check (only Completed after validation)
- 6.4: Receipt tests
19/19 tests pass. cargo check clean.
2026-05-11 19:42:03 +08:00
b75546bda6
feat: agent registry API + heartbeat checker + core unit tests
...
Tasks completed:
- 2.7: Core unit tests (14 tests: state machine, event store, queue, timeout, retry)
- 3.1: POST /api/v1/agents/register (upsert on duplicate)
- 3.2: POST /api/v1/agents/heartbeat
- 3.3: POST /api/v1/agents/deregister (offline + requeue running tasks)
- 3.4: GET /api/v1/agents (filter by capability + status)
- 3.5: Background heartbeat checker (marks offline, sets tasks agent_lost)
- 3.6: API unit tests (register, duplicate, heartbeat, deregister, checker)
All 14 tests pass. cargo check clean (warnings only).
2026-05-11 19:29:16 +08:00
2658a74730
fix: resolve 3 CRITICAL + 5 MAJOR issues from Codex review
...
C1: Arc<Mutex<EventStore>> changed from tokio::sync to std::sync + spawn_blocking
C2: StateMachine::transition merged into single lock scope
C3: Transaction boundaries (BEGIN/COMMIT) on all composite writes
M4: retry_count no longer overwritten by update_task_status
M5: RetryPolicy::handle_failure now atomic (single lock + transaction)
M6: Per-task timeout_seconds used in SQL instead of global config
M7: Explicit Priority::order() method instead of relying on variant order
M8: dequeue_and_assign uses CAS-style WHERE status='created' for atomicity
2026-05-11 19:08:18 +08:00
b1a4d66c13
docs: add AGENTS.md for Codex working instructions
2026-05-11 14:59:24 +08:00
647d0ea7f6
chore: sync task checkboxes with implemented code
2026-05-11 14:58:36 +08:00
4e01728a67
feat: implement orchestrator core (Rust)
...
Task 1.1: ✅ Cargo.toml with axum, rusqlite, matrix-sdk, serde, etc.
Task 1.2: ✅ Directory structure: src/core, src/adapters, src/integrations, src/api
Task 1.5: ✅ config.example.toml with full schema
Task 2.1: ✅ Data models: Agent, Task, Receipt, Artifact, TaskEvent
Task 2.2: ✅ Event Store: SQLite append-only with task/agent tables
Task 2.3: ✅ Task state machine: created→assigned→running→completed/failed
Task 2.4: ✅ Global task queue with priority ordering
Task 2.5: ✅ Background timeout checker
Task 2.6: ✅ Retry policy with configurable max_retries
Compiles clean (warnings only, no errors).
API handler stubs in place for Phase 2.
2026-05-11 14:57:23 +08:00
e983955036
gitignore: exclude .env.local
2026-05-11 14:38:08 +08:00
aabd52ed52
init: OpenSpec project scaffolding with proposal, design, specs, tasks
...
- 7 capabilities: agent-registry, task-router, receipt-protocol,
forgejo-integration, matrix-chatops, agent-adapter, orchestrator-core
- Tech stack: Rust + axum + zigbuild (single binary)
- Forgejo as task source of truth
- Matrix as real-time ChatOps layer
- Adapter pattern for multi-agent type support
2026-05-11 14:37:43 +08:00