Skip to content

feat: fleetkit v1, self-hosted agent fleet in one compose stack - #1

Merged
anianroid merged 5 commits into
stagingfrom
growth/fleet-image
Oct 7, 2026
Merged

anianroid merged 5 commits into
stagingfrom
growth/fleet-image

Conversation

@anianroid

Copy link
Copy Markdown
Contributor

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 setup wizard writes fleet.yaml + .env
  • Subscriptions only: ./fleet login claude / ./fleet login chatgpt; no API keys anywhere
  • Discord, Telegram, WhatsApp per agent; owner-only DMs by default
  • install.sh + cloud-init.yaml for fresh Ubuntu/Debian servers
  • CI: shellcheck, compose config, full boot test; publishes multi-arch images to GHCR on main

Tested 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T06:21:24.630634Z ffef9b5 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +264 to +266
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"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +289 to +290
for index, agent in enumerate(hermes_agents(fleet)):
aid, home = agent["id"], hermes_home(index, agent)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +233 to +237
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)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +8 to +9
export TZ="${FLEET_TZ:-${TZ:-UTC}}"
[ -f /run/fleet-secrets/fleet.env ] && set -a && . /run/fleet-secrets/fleet.env && set +a

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread fleet
Comment on lines +18 to +20
memory_enabled() {
awk '/^memory:/{m=1;next} /^[^ #]/{m=0} m && /enabled:/{print $2; exit}' fleet.yaml |
grep -qv false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread fleet
Comment on lines +268 to +270
mkdir -p "$out"
cp fleet.yaml .env "$out/"
chmod 600 "$out/.env"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@anianroid
anianroid merged commit f3a1fa2 into staging Oct 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant