Skip to content

fix(gateway): remove --dev flag from gateway startup args#167

Merged
hazeone merged 1 commit intomainfrom
fix/remove-dev-flag-from-gateway
Feb 25, 2026
Merged

fix(gateway): remove --dev flag from gateway startup args#167
hazeone merged 1 commit intomainfrom
fix/remove-dev-flag-from-gateway

Conversation

@hazeone
Copy link
Copy Markdown
Contributor

@hazeone hazeone commented Feb 25, 2026

Summary

  • Remove --dev flag from gateway startup args in GatewayManager.startProcess()
  • The --dev flag caused OpenClaw gateway to run ensureDevGatewayConfig() on first startup, which wrote agents.list: [{ id: "dev", default: true }] with a C3-PO identity to ~/.openclaw/openclaw.json
  • This made all packaged builds permanently default to the dev workspace (~/.openclaw/workspace-dev) instead of the standard "main" agent workspace

Root cause

manager.ts:571 always passed --dev in gatewayArgs:

['gateway', '--port', ..., '--token', ..., '--dev', '--allow-unconfigured']

OpenClaw's gateway subcommand treats --dev as a convenience flag that auto-creates a dev config + workspace (with agent id "dev", identity "C3-PO"). This is intended for OpenClaw CLI development, not for production ClawX usage.

Test plan

  • Start ClawX with a clean ~/.openclaw/ directory, verify no agents.list with id: "dev" is created
  • Verify gateway still starts successfully with --allow-unconfigured
  • Verify provider/channel config written by ClawX is properly picked up by the gateway

Note for existing users: After this fix, users who already have the stale agents.list[0].id = "dev" in their ~/.openclaw/openclaw.json will need to manually remove the agents.list entry (or delete the config file to regenerate).

Made with Cursor

The --dev flag caused OpenClaw gateway to run in dev mode, which on first
startup triggers ensureDevGatewayConfig() writing a "dev" agent with
id="dev", default=true, and a C3-PO identity to ~/.openclaw/openclaw.json.
This made all packaged builds default to the dev workspace instead of the
standard "main" agent workspace.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hazeone hazeone merged commit 2804b6d into main Feb 25, 2026
2 checks passed
@hazeone hazeone deleted the fix/remove-dev-flag-from-gateway branch February 25, 2026 10:29
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