Skip to content

fix(gateway): use account-scoped reload for channel account changes#517

Open
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-43938-fix-gateway-account-scoped-reload
Open

fix(gateway): use account-scoped reload for channel account changes#517
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-43938-fix-gateway-account-scoped-reload

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

Use account-scoped hot reload for config changes under:

  • channels.<channel>.accounts.<accountId>.*

instead of always restarting the entire channel.

What changed

  • added account-scoped restart planning to GatewayReloadPlan
  • detect account-scoped channel config paths in buildGatewayReloadPlan
  • route those changes through:
    • stopChannel(channelId, accountId)
    • startChannel(channelId, accountId)
  • preserve full channel restart behavior for:
    • channel-global config changes
    • mixed changes where full-channel restart takes precedence

Why

The gateway reload framework already has account-scoped channel lifecycle support, but hot reload planning previously collapsed all matching channel config changes into full channel restarts.

That makes account-only config edits broader and more disruptive than necessary.

Tests

Added coverage for:

  • account-scoped channel account config -> account-only restart
  • channel-global config -> full channel restart
  • mixed account-scoped + channel-global changes -> full channel restart wins
  • multiple account-scoped changes in one channel -> collect all impacted accounts

Validated with:

corepack pnpm exec vitest run src/gateway/config-reload.test.ts src/gateway/server.reload.test.ts

Scope / non-goals

This change is intentionally narrow.

It does not redesign active reply draining, typing lifecycle coordination, or provider-specific recovery behavior.

Closes openclaw#43935

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.

Gateway: account-scoped channel config changes restart the entire channel and can disrupt active traffic

2 participants