Repository navigation
feat: multi-person fleets with optional personal ChatGPT - #3
Conversation
People listed in fleet.yaml share the fleet's subscriptions. With a Tailscale auth key the dashboard identifies each person, so they can connect their own ChatGPT and have their new chats billed to it. Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ddaf45976
ℹ️ 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".
| user: root | ||
| cap_add: ["NET_ADMIN"] | ||
| ports: !reset [] |
There was a problem hiding this comment.
Pass the TUN device into the Tailscale container
When TS_AUTHKEY is enabled on a normal Docker host, this override grants NET_ADMIN but never exposes /dev/net/tun or starts tailscaled in userspace-networking mode, so the daemon cannot create its network interface. Tailscale documents that kernel networking requires both the TUN device and capabilities (container parameters); because this override also removes every published port and the gateway is switched to loopback, the Control UI becomes unreachable rather than falling back to localhost.
Useful? React with 👍 / 👎.
| exec setpriv --reuid=node --regid=node --init-groups --inh-caps=-all \ | ||
| /usr/local/bin/fleet-entrypoint gateway |
There was a problem hiding this comment.
Authenticate Tailscale before dropping root privileges
In Tailscale mode this re-executes the entrypoint as node, after which line 57 runs tailscale up; on Linux only root can manage tailscaled unless a non-root operator has first been configured (Tailscale operator-permission documentation). Thus, even after providing a TUN device, the login fails with prefs write access denied, while the script continues to a loopback-only gateway with no published port.
Useful? React with 👍 / 👎.
| if [ "$(id -u)" = 0 ]; then | ||
| mkdir -p /var/lib/tailscale | ||
| tailscaled --state=/var/lib/tailscale/tailscaled.state >/var/log/tailscaled.log 2>&1 & | ||
| exec setpriv --reuid=node --regid=node --init-groups --inh-caps=-all \ | ||
| /usr/local/bin/fleet-entrypoint gateway |
There was a problem hiding this comment.
Drop privileges before starting background helpers
When TS_AUTHKEY is set, the root invocation has already started the warden and board supervisors on lines 41–46 before this exec; those child processes survive the re-exec, and the new node invocation starts a second copy of each. Consequently every warden cron entry can run twice, while the second board server repeatedly fails to bind and restarts, so the privilege transition needs to happen before launching either helper.
Useful? React with 👍 / 👎.
| compose exec -it openclaw openclaw models accounts login openai \ | ||
| --method device-code --person "$pid" |
There was a problem hiding this comment.
Run personal account login with an identified connection
The packaged OpenClaw CLI does not accept a person ID for models accounts login; its reference explicitly says account commands target the person identified by the Gateway connection and do not accept an owner-id flag (OpenClaw models CLI). Therefore ./fleet user <person> fails on the unsupported --person argument, and merely removing it would still leave this local CLI connection without the required identity-bearing endpoint; the login must instead run through the person's Tailscale identity or be completed in their Control UI.
Useful? React with 👍 / 👎.
| ids = [str(p.get(chan) or "").lstrip("+") for p in people] | ||
| ids = [i for i in ids if i] | ||
| if not ids and len(people) == 1: | ||
| ids = [i for i in [os.environ.get(env_var, "").lstrip("+")] if i] |
There was a problem hiding this comment.
Preserve the owner's environment IDs in multi-person fleets
For the advertised setup flow where teammates are added, fleet.yaml contains multiple people but the owner's chat IDs are still collected only into OWNER_* variables. This condition then disables the environment fallback solely because len(people) > 1; after teammate IDs are filled in, the generated OpenClaw and Hermes allowlists contain those teammates but omit the owner, preventing the person who configured the fleet from DMing its agents.
Useful? React with 👍 / 👎.
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. |
What
people:infleet.yaml. Everyone listed can talk to the agents and shares the fleet's subscriptions.TS_AUTHKEYset, the fleet joins a tailnet and serves the dashboard over Tailscale Serve, which identifies each browser. A person then connects their own ChatGPT under Settings → Profile → Connected accounts, and their new chats bill that account.Tested
auth.orderpoints both providers at the shared:fleetprofile, Tailscale stays off without a key.Not tested
Made with Cursor