2.9 KiB
2.9 KiB
Multi-Machine Agent Orchestration
Purpose
Coordinate agents running on multiple computers while keeping commands auditable, recoverable, and safe.
Recommended Architecture
Use two channels:
- SSH for live control.
- GitHub repository command bus for asynchronous coordination and durable logs.
Avoid exposing a custom always-open command API unless it is explicitly needed and secured.
Machine Agent Daemon
Each managed computer can run a local daemon or scheduled service called garage-agent-runner.
Responsibilities:
- pull the shared knowledge repository;
- read commands addressed to its machine;
- execute only allowed command types;
- write status, logs, and results back to the repository;
- push updates using that machine's configured Git identity;
- keep a heartbeat file current.
Command Bus Layout
Use this structure:
agent-bus/
commands/<machine>/
results/<machine>/
heartbeats/<machine>.md
locks/
Command files should be Markdown or YAML text files. Do not store secrets.
Command Lifecycle
- Controller writes a command file to
agent-bus/commands/<machine>/. - Machine daemon pulls the repository.
- Daemon validates the command against an allowlist.
- Daemon creates a lock in
agent-bus/locks/. - Daemon runs the task.
- Daemon writes result to
agent-bus/results/<machine>/. - Daemon updates heartbeat.
- Daemon commits and pushes.
Live Control
For immediate work, use SSH:
ssh <user>@<host> '<command>'
Use SSH for:
- starting/stopping services;
- checking process state;
- running inventory commands;
- launching interactive agent sessions through
tmux; - troubleshooting network or daemon failures.
Safety Rules
- Use per-machine users such as
airM1, not root, for normal repository work. - Do not store passwords, API tokens, VNC passwords, camera credentials, or SSH private keys.
- Commands must be logged.
- Destructive commands require explicit user approval.
- Daemons should reject commands outside the project allowlist.
- Git commits from a machine should use that machine's configured identity.
Minimum Machine Setup
Each machine should have:
- SSH access;
- Git;
- access to
krustophski/agent-knowledge-base; - machine identity configured in Git;
- local
AGENTS.mdwhere applicable; - optional VNC/camera access documented in
locations/; - optional
garage-agent-runnerservice.
Heartbeat Format
# Machine Heartbeat
## Machine
machine-name
## Last Seen
YYYY-MM-DD HH:MM TZ
## Current Task
Task or `idle`.
## Repositories
- path:
- branch:
- dirty:
## Services
- service:
- status:
## Notes
- note:
First Implementation Recommendation
Start simple:
- Use SSH for direct control.
- Use GitHub files for durable handoff.
- Add a
tmuxsession per machine for long-running agent work. - Add a daemon only after command patterns are clear.
This gives control now without prematurely building an unsafe custom remote execution service.