This repository has been archived on 2026-07-09. You can view files and clone it, but cannot push or open issues or pull requests.
agent-knowledge-base-archived/skills/multi-machine-agent-orchestration.md

2.9 KiB

Multi-Machine Agent Orchestration

Purpose

Coordinate agents running on multiple computers while keeping commands auditable, recoverable, and safe.

Use two channels:

  1. SSH for live control.
  2. 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

  1. Controller writes a command file to agent-bus/commands/<machine>/.
  2. Machine daemon pulls the repository.
  3. Daemon validates the command against an allowlist.
  4. Daemon creates a lock in agent-bus/locks/.
  5. Daemon runs the task.
  6. Daemon writes result to agent-bus/results/<machine>/.
  7. Daemon updates heartbeat.
  8. 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.md where applicable;
  • optional VNC/camera access documented in locations/;
  • optional garage-agent-runner service.

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:

  1. Use SSH for direct control.
  2. Use GitHub files for durable handoff.
  3. Add a tmux session per machine for long-running agent work.
  4. Add a daemon only after command patterns are clear.

This gives control now without prematurely building an unsafe custom remote execution service.