Repository navigation
feat: fleetkit v1, self-hosted agent fleet in one compose stack - #1
Conversation
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffef9b556b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def hermes_home(index, agent): | ||
| """The first Hermes agent is the default profile; the rest are named profiles.""" | ||
| return HERMES if index == 0 else HERMES / "profiles" / agent["id"] |
There was a problem hiding this comment.
Preserve Hermes homes by agent ID
When Hermes agents are reordered or a new agent is inserted first, this positional mapping assigns the existing default home to a different agent. Because SOUL.md is written only once and authentication/session data also lives in that home, the new first agent inherits the old agent's identity and history while the original agent starts with a fresh named profile. Persist the default-profile owner or migrate homes by stable agent ID rather than recomputing ownership from list order.
Useful? React with 👍 / 👎.
| for index, agent in enumerate(hermes_agents(fleet)): | ||
| aid, home = agent["id"], hermes_home(index, agent) |
There was a problem hiding this comment.
Stop Hermes profiles removed from fleet.yaml
When a Hermes agent is removed, this loop never revisits its existing default home or named profile, so its bot credentials and configuration remain intact in the persistent volume while the hermes service continues running. Named profiles are automatically served from profiles/ by the multiplex gateway, so the supposedly removed agent can keep answering messages; disable/archive omitted profiles and clear the old default profile's channel credentials while retaining any files meant for recovery. See the Hermes profile-serving behavior.
Useful? React with 👍 / 👎.
| enabled.add(chan) | ||
| ops += [{"path": f"channels.{chan}.accounts.{aid}.{k}", "value": v} for k, v in account.items()] | ||
| bindings.append({"type": "route", "agentId": aid, "match": {"channel": chan, "accountId": aid}}) | ||
|
|
||
| ops += [{"path": f"channels.{chan}.enabled", "value": True} for chan in sorted(enabled)] |
There was a problem hiding this comment.
Remove omitted OpenClaw channel accounts
After an OpenClaw channel or agent is removed from fleet.yaml, this reconciliation only writes currently desired accounts and only enables channels; it never unsets the old channels.<channel>.accounts.<id> entry or disables the channel in the persistent openclaw.json. Although bindings is replaced, unmatched traffic can still route to a configured/default owner, and bindings are not access control, so the old bot may remain connected and answer through the default agent. Explicitly remove stale accounts and disable unused channels. See the OpenClaw routing behavior.
Useful? React with 👍 / 👎.
| export TZ="${FLEET_TZ:-${TZ:-UTC}}" | ||
| [ -f /run/fleet-secrets/fleet.env ] && set -a && . /run/fleet-secrets/fleet.env && set +a |
There was a problem hiding this comment.
Apply the fleet timezone after loading fleet.env
For any non-UTC owner timezone, TZ is exported before fleet.env supplies FLEET_TZ, so it remains the image default UTC for the lifetime of the gateway. The warden's crontab only contains a timezone comment, meaning its nightly and weekly jobs run on UTC rather than the configured local schedule; source the file first and then export TZ, or put CRON_TZ in the crontab. Supercronic documents that schedules use its TZ environment variable in the timezone section.
Useful? React with 👍 / 👎.
| memory_enabled() { | ||
| awk '/^memory:/{m=1;next} /^[^ #]/{m=0} m && /enabled:/{print $2; exit}' fleet.yaml | | ||
| grep -qv false |
There was a problem hiding this comment.
Default omitted memory configuration to enabled
If a hand-edited fleet.yaml omits the optional memory block or its enabled key, this pipeline emits no input and returns false, disabling the Compose memory profile. In contrast, load_fleet() defaults the same setting to true, so init configures the agents to use engram even though the database and engram services were not started. Make this host-side parser use the same default as fleet-init.
Useful? React with 👍 / 👎.
| mkdir -p "$out" | ||
| cp fleet.yaml .env "$out/" | ||
| chmod 600 "$out/.env" |
There was a problem hiding this comment.
Restrict backup file permissions
On a normal 0022 umask, this creates a world-readable backup directory, and the subsequent container-created volume archives and host-created database dump are also typically mode 0644. Those archives contain subscription logins, bot credentials, sessions, and engram tokens, so another local account on the server can read them even though only the copied .env is chmodded. Set a restrictive umask or chmod the directory and every generated backup artifact.
Useful? React with 👍 / 👎.
What
Packages the agent fleet (OpenClaw, Hermes, engram memory, session-warden, fleet board) as a Docker Compose stack anyone can run on a VPS.
./fleet setupwizard writesfleet.yaml+.env./fleet login claude/./fleet login chatgpt; no API keys anywhereinstall.sh+cloud-init.yamlfor fresh Ubuntu/Debian serversTested locally
Fresh boot from empty volumes: init exits 0, gateway healthy, Hermes running, board serves, engram healthy and reachable over MCP from the gateway, warden cron running.
Not yet tested
Real subscription logins and real bot tokens (needs a human).
Made with Cursor