Skip to content

fix(controller): avoid openclaw doctor migration on channel connect#736

Merged
Siri-Ray merged 1 commit intomainfrom
fix/channel-config-doctor-migration
Apr 1, 2026
Merged

fix(controller): avoid openclaw doctor migration on channel connect#736
Siri-Ray merged 1 commit intomainfrom
fix/channel-config-doctor-migration

Conversation

@lefarcen
Copy link
Copy Markdown
Collaborator

@lefarcen lefarcen commented Apr 1, 2026

What

Move account-scoped channel config (dmPolicy, allowFrom, groupPolicy) from channel top level into individual account objects.

Why

When connecting a new channel (e.g. Discord), the config compiler placed dmPolicy/allowFrom/groupPolicy at the channel top level (channels.discord.dmPolicy) while accounts used named IDs (e.g. discord-<APP_ID>). OpenClaw's doctor detected this as legacy single-account format and auto-migrated values into accounts.default, which:

  1. Modified the config file on disk
  2. Triggered a second config change detection
  3. Caused a double gateway restart (~20s total downtime instead of ~10s)

After the fix, connecting Discord triggers a single hot reload (config hot reload applied) instead of two full gateway restarts.

How

  • channel-binding-compiler.ts: Move dmPolicy, allowFrom, groupPolicy from channel top-level into each account object (discord, slack, feishu)
  • openclaw-config.ts: Add dmPolicy and allowFrom to discordAccountSchema
  • Update test assertions for feishu account config

Affected areas

  • Desktop app (Electron shell)
  • Controller (backend / API)
  • Web dashboard (React UI)
  • OpenClaw runtime
  • Skills
  • Shared schemas / packages
  • Build / CI / Tooling

Checklist

  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes
  • pnpm generate-types run (if API routes/schemas changed)
  • No credentials or tokens in code or logs
  • No any types introduced (use unknown with narrowing)

Notes for reviewers

Verified locally: Discord connect now shows config hot reload applied (channels.discord) instead of double SIGUSR1 → gateway restart.

…enclaw doctor migration

Channel config compiler was placing dmPolicy, allowFrom, groupPolicy at
the channel top level while using named account IDs (not 'default').
OpenClaw doctor detected this as legacy single-account format and
auto-migrated values into accounts.default, modifying the config file
and triggering a second gateway restart on every new channel connect.

Move these fields into each account object so doctor has nothing to
migrate. Affects discord, slack, and feishu channels.
@Siri-Ray Siri-Ray merged commit 04d0d3b into main Apr 1, 2026
9 checks passed
@lefarcen lefarcen mentioned this pull request Apr 1, 2026
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.

2 participants