Skip to content

refactor(channels): move single-account promotion keys to plugin declarations - #112293

Merged
steipete merged 5 commits into
mainfrom
steipete/channel-promotion-key-ownership
Jul 21, 2026
Merged

steipete merged 5 commits into
mainfrom
steipete/channel-promotion-key-ownership

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Part 2 of #112238. Core hardcoded channel-specific single-account promotion keys: setup-promotion-keys.ts listed signalNumber, homeserver, authDir, cliPath, and ~25 more channel-owned config keys, and setup-helpers.ts carried a hardcoded per-channel named-account map for matrix/telegram — duplicating declarations those plugins already make via the ChannelSetupAdapter contract (singleAccountKeysToMove / namedAccountPromotionKeys).

Why This Change Was Made

Owner-specific migration/config behavior belongs in the owner plugin (repo architecture rule); the adapter contract already existed. This PR:

  • Shrinks core lists to channel-agnostic keys (policy keys, shared messaging-common fields, cross-channel conventions like token/tokenFile/botToken/webhookPath).
  • Moves channel-specific keys into the owning plugins' setup adapters (signal, imessage, whatsapp, matrix, irc, twitch, tlon, telegram, zalo, nextcloud-talk, slack), each also declaring setupFeatures.configPromotion so doctor can resolve declarations from bundled artifacts without full plugin load. Matrix's setup-only artifact now carries its declarations (it previously exposed a bare adapter).
  • Deletes the hardcoded matrix/telegram named-account map; both promotion paths (doctor + direct setup) consume one resolver, and callers with a scoped plugin in hand pass its setup surface (scoped/setup-only plugins are not guaranteed globally registered). The moveSingleAccountChannelSectionToDefaultAccount SDK helper gains an optional, additive setupSurface parameter.
  • Compatibility, verified against published third-party tarballs: botId/secret stay core-promoted for Tencent's out-of-tree WeCom plugin (commented, with removal condition), and a clearly named legacy tier preserves the former automatic promotion for adapters that have not adopted declarations — a surface is "declared" iff singleAccountKeysToMove is present (empty array is authoritative). The legacy tier is inert for all in-repo channels and is scheduled for removal when declarations become mandatory at the next SDK major.
  • One intentional behavior change: when no declarations are available and a channel section holds root keys outside generic+legacy coverage, doctor defers the whole channel's promotion instead of creating a partial accounts.default that would permanently strand plugin-owned keys at root (existing-default channels are skipped by design).

User Impact

No behavior change for any in-repo channel: per-channel effective promotion key sets are proven identical (parity table in the review artifacts). Out-of-tree adapters keep migrating exactly as before via the legacy tier. The doctor deferral only affects configs that would previously have been half-migrated.

Evidence

  • Focused suites green: setup-promotion-helpers (caller precedence, declared/undeclared/declared-empty matrix, legacy-tier inertness for declaring plugins), setup-helpers, setup-wizard-helpers, doctor-legacy-config.migrations (absent-plugin deferral, late-install atomic promotion), doctor-config-flow, telegram account promotion, matrix/whatsapp setup-only artifact tests, clickclack setup.
  • Full remote changed gate green (Blacksmith Testbox, ~21m: typechecks, lint shards, SDK baseline, boundaries, shrinkwrap, import cycles); official catalog regen verified drift-free.
  • Structured review (Codex gpt-5.6-sol): one P1 accepted and fixed (undeclared out-of-tree adapters would have lost the automatic tier and doctor could strand credentials via partial promotion — now covered by the legacy tier + completeness contract); final run clean.
  • Core production TS net-deletes; SDK API baseline regenerated for the additive parameter.

@steipete
steipete marked this pull request as ready for review July 21, 2026 12:35
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: imessage Channel integration: imessage channel: matrix Channel integration: matrix channel: nextcloud-talk Channel integration: nextcloud-talk channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: whatsapp-web Channel integration: whatsapp-web channel: zalo Channel integration: zalo commands Command implementations channel: twitch Channel integration: twitch channel: irc size: L maintainer Maintainer-authored PR size: XL and removed size: L labels Jul 21, 2026
@steipete
steipete force-pushed the steipete/channel-promotion-key-ownership branch from 285276d to 8caea3a Compare July 21, 2026 13:31
@clawsweeper

clawsweeper Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor(channels): move single-account promotion keys to plugin declarations This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@clawsweeper

clawsweeper Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor(channels): move single-account promotion keys to plugin declarations This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete merged commit e1d5d3d into main Jul 21, 2026
119 checks passed
@steipete
steipete deleted the steipete/channel-promotion-key-ownership branch July 21, 2026 13:48
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 22, 2026
…arations (openclaw#112293)

* refactor(channels): move single-account promotion keys to plugin declarations

* fix(channels): keep legacy promotion tier for undeclared setup adapters

* fix(channels): keep plugin discovery lazy in setup promotion helpers

* fix(channels): resolve bundled promotion surfaces from setup-only artifacts

* test(matrix): use vi.stubEnv in setup test env helper
wangmiao0668000666 added a commit to wangmiao0668000666/openclaw that referenced this pull request Aug 14, 2026
Declare singleAccountKeysToMove on both channel setup adapters and add
configPromotion setupFeature to their package manifests, completing the
per-channel migration started in openclaw#112293.

Co-Authored-By: Claude <[email protected]>
wangmiao0668000666 added a commit to wangmiao0668000666/openclaw that referenced this pull request Sep 10, 2026
…n keys

Declare singleAccountKeysToMove on both channel setup adapters and add
configPromotion setupFeature to their package manifests, completing the
per-channel migration started in openclaw#112293.

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: imessage Channel integration: imessage channel: irc channel: matrix Channel integration: matrix channel: nextcloud-talk Channel integration: nextcloud-talk channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: twitch Channel integration: twitch channel: whatsapp-web Channel integration: whatsapp-web channel: zalo Channel integration: zalo commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant