feat(daemon): add profile-aware daemon naming for multi-gateway support#671
feat(daemon): add profile-aware daemon naming for multi-gateway support#671bjesuiter wants to merge 7 commits intoopenclaw:mainfrom
Conversation
Changes the default base path from "/" to "./" so the control UI works correctly when served under a custom basePath (e.g., /jbclawd/). Previously, assets were referenced with absolute paths like /assets/..., which failed when the UI was served under a subpath. With relative paths (./assets/...), the browser resolves them relative to the HTML location, making the UI work regardless of the configured basePath.
…bjesuiter/clawdbot into ui-build-default-to-relative-path
Enable running multiple gateway daemons simultaneously by incorporating CLAWDBOT_PROFILE into service names: - macOS: com.clawdbot.<profile> (was: com.clawdbot.gateway) - Linux: clawdbot-gateway-<profile> - Windows: Clawdbot Gateway (<profile>) This allows users to run separate gateways for different configurations (e.g., personal + work) on the same machine without conflicts.
|
Should we support this instead of steering people to use one gateway? we support multi-agent and multi-provider? |
|
@joshp123 also sth where i am curious about your opt |
|
@steipete Yes, I'd like to support that! I'm running two gateways on my Mac mini, so that I have two distinct bots, one normal bot and a rescue bot. Comes in very handy if I or my main agent messes up it's own config and the gateway does not start up anymore. |
|
ahhhhhh FAIR |
|
I wasa thinking of emergency commands that spin up a claude but this is better. Use the --dev skill with C-3PO for a fun cos-play agent!! |
Change daemon service methods (isLoaded, stop, restart) to accept profile?: string instead of env: Record<string, string | undefined>. This makes the API cleaner and more explicit - callers now pass just the profile value rather than the entire env object. Internal functions extract env.CLAWDBOT_PROFILE at the call site.
Cover resolveGatewayLaunchAgentLabel, resolveGatewaySystemdServiceName, and resolveGatewayWindowsTaskName with tests for default profile, custom profiles, edge cases (empty, whitespace, case-insensitive 'default').
|
@steipete I reviewed this pr in tandem with opencode. Note that i can't test it with linux or windows right now. Please check if you like the signature change on the service interface (if there is any from your perspective). service.restart({env: process.env})and I wanted to make it explicit what is passed, so i explicitely pass Should be ready to merge otherwise! :) Examples running on macosFirst run of
|
# Conflicts: # src/cli/daemon-cli.ts # src/daemon/schtasks.ts
|
this time i merged main properly :D |
updates on main are too fast :/ I have to go to bed now, if this thing is still here in the morning, i'll give it to claude for fixing ^^ |
|
No need to worry about keeping up with main, we will re-base it when we merge it! |
|
Created follow-up issue for browser tool port conflict: #898 This tracks the CDP port configuration needed for multi-gateway support. |
|
@steipete If full multi-gateway support sounds too scary to you, we could also update the config to have dedicated "main gateway" and "recovery gateway". |
Thanks @bjesuiter. Co-authored-by: Benjamin Jesuiter <bjesuiter@gmail.com>
|
Landed on main with squash commit 77cf40d.
Tests: pnpm lint (2 warnings: typescript-eslint/restrict-template-expressions in src/infra/outbound/channel-selection.ts and src/gateway/server-methods/agent.ts), pnpm build, pnpm test. Thanks @bjesuiter! |
Thanks @bjesuiter. Co-authored-by: Benjamin Jesuiter <bjesuiter@gmail.com>
* fix: run Rust tests in CI Fixes openclaw#670 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: run Rust tests in CI Adds a separate test.yml workflow to run existing Rust unit tests. Fixes openclaw#670 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: use mock TranscriptionManager in CI tests Swap to a mock adapter during CI to avoid compiling whisper/Vulkan. The mock has the same interface but no heavy dependencies. Existing tests don't exercise transcription code, so this is safe. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Enable running multiple gateway daemons simultaneously by incorporating CLAWDBOT_PROFILE into service names:
This allows users to run separate gateways for different configurations (e.g., main bot + rescue bot with redundant gateway) on the same machine without conflicts.
Use Case
Run multiple Clawdbot instances with different profiles AND DIFFERENT GATEWAYS on the same machine, each gateway with its own daemon service that can be independently started/stopped/managed.
Allows to have "recovery" agents on the same machine as your main bot but with reduced config for "failsafe" mode.
I configure this bot with a way cheaper model, like the free ones from opencode zen or the free google antigravity subscription with gemini-3-flash. It's enough to have the bot call the "usage" skill to check limits or restart the main bot.
Note for users
You should use this multi-gateway feature only for redundancy for failure recovery cases!
One gateway can serve different agent configs/profiles already, like work and personal.