Skip to content

refactor(channels): unify bundled channel setup contracts - #117106

Merged
steipete merged 2 commits into
mainfrom
codex/loc-channel-setup-2d45
Jul 31, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/loc-channel-setup-2d45

Conversation

@steipete

@steipete steipete commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Bundled channel plugins exposed two competing setup surfaces, while modern contract-only channels could lose account promotion and agent-binding behavior.

Why This Change Was Made

Use the channel-owned setup contract as the single bundled runtime, onboarding, and test surface. Preserve the published legacy setup adapter and the exact public Plugin SDK API at explicit compatibility boundaries for existing third-party plugins.

User Impact

Contract-only channels preserve account promotion and agent binding, including Signal multi-account routes and Matrix plugin-owned binding hooks. Existing onboarding commands, configuration, CLI flags, and third-party legacy plugins continue to work unchanged.

Evidence

Real production runtime proof: exact reviewed head

Blacksmith Testbox tbx_01kyx9eqb3t96g1vfng9rcaxcy executed the actual production Signal and Matrix bundled plugins, production setup resolver, promotion helper, account configuration owner, and agent-binding owner, plus the released external-plugin legacy-only adapter shape. No mocked owner or fabricated channel result; all assertions passed (exitCode: 0): https://github.com/openclaw/openclaw/actions/runs/30674024132

EXACT_HEAD a1336166dd6c1fef47557f3dc420f1486916b5d8
SIGNAL_CONTRACT_ONLY {"legacySetupPresent":false,"executionUsesContract":true,"promotionKeys":["account"]}
SIGNAL_BEFORE {"account":"+1555***0123","transport":{"kind":"managed-native","httpPort":8080}}
SIGNAL_PROMOTED {"transport":{"kind":"managed-native","httpPort":8080},"accounts":{"default":{"account":"+1555***0123"}}}
SIGNAL_AFTER {"transport":{"kind":"managed-native","httpPort":8080},"accounts":{"work":{"enabled":true,"account":"+1555***0124","transport":{"kind":"managed-native","httpHost":"127.0.0.1","httpPort":8081}}},"account":"+1555***0123","enabled":true}
SIGNAL_BINDING_EXPLICIT [{"type":"route","agentId":"ops","match":{"channel":"signal","accountId":"work"}}]
SIGNAL_BINDING_AUTOMATIC [{"type":"route","agentId":"ops","match":{"channel":"signal","accountId":"*"}}]
MATRIX_CONTRACT_BINDING {"legacySetupPresent":false,"hook":"ops","binding":[{"type":"route","agentId":"ops","match":{"channel":"matrix","accountId":"ops"}}]}
EXTERNAL_LEGACY_BEFORE {"vendorCredential":"[redacted]"}
EXTERNAL_LEGACY_AFTER {"accounts":{"default":{"vendorCredential":"[redacted]"},"vendor":{"enabled":true,"credentialConfigured":true,"name":"Vendor"}}}
EXTERNAL_LEGACY_ABI {"contractPresent":false,"adapterIdentityPreserved":true,"inputIdentityPreserved":true,"legacyBinding":"vendor-ops"}
PROOF_RESULT PASS

Exact head was fully materialized and all 84 changed files inspected; GitHub reports the head mergeable against current main. All 50 channel-contract files / 481 tests pass, the published Plugin SDK API hash and export surface are unchanged, no config/default or persisted schema is changed, and the exact-head required CI and security scans are green:

Both completed ClawSweeper rank-up moves are addressed: the redacted real production promotion/binding/legacy trace is above, and exact-head materialization, current-main mergeability, and completed required checks have been refreshed without changing the reviewed commit.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr 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 channel: zalouser Channel integration: zalouser commands Command implementations channel: feishu Channel integration: feishu channel: twitch Channel integration: twitch channel: irc channel: qqbot channel: qa-channel Channel integration: qa-channel channel: synology-chat channel: sms Channel integration: sms channel: raft Channel integration: Raft channel: reef Channel integration: reef channel: buzz size: L maintainer Maintainer-authored PR labels Jul 31, 2026
@steipete
steipete marked this pull request as ready for review July 31, 2026 23:26
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 31, 2026, 7:41 PM ET / 23:41 UTC.

ClawSweeper review

What this changes

This PR removes duplicate setup adapters from bundled channel plugins, makes setupContract their canonical onboarding/configuration surface, and updates promotion and agent-binding callers to prefer that contract while preserving legacy third-party adapter support.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 5 items remain

Keep this PR open for human review. The supplied diff consistently moves bundled channels to the channel-owned setup contract and retains the public legacy adapter fallback, but the PR head was unavailable in the local promisor checkout and GitHub DNS was unavailable, so this review could not verify the complete 84-file diff, the exact three-way merge result, or the linked runtime artifacts.

Priority: P2
Reviewed head: a1336166dd6c1fef47557f3dc420f1486916b5d8

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The proposed architecture aligns with the documented contract direction, but exact-head review and real behavior proof are unavailable in this review environment.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports tests, checks, and CI, but the available context contains no inspectable after-fix live or runtime artifact for the changed onboarding/configuration behavior. Add a redacted real setup or harness transcript showing promotion and binding behavior, then update the PR body for a fresh review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports tests, checks, and CI, but the available context contains no inspectable after-fix live or runtime artifact for the changed onboarding/configuration behavior. Add a redacted real setup or harness transcript showing promotion and binding behavior, then update the PR body for a fresh review.
Evidence reviewed 5 items Current compatibility boundary: Current main defines setupContract as the modern channel surface and marks setup deprecated; the setup resolver prefers a contract when present and otherwise wraps a released legacy adapter.
Current callers still read legacy setup: Before this PR, account configuration, bundled promotion, and agent binding read plugin.setup; the supplied patch updates each path to prefer setupContract while retaining the legacy fallback.
Published SDK guidance: The checked-in setup documentation says released external plugins may continue using setup, new plugins should expose setupContract, and OpenClaw prefers the contract when both exist; this matches the intended compatibility direction.
Findings None None.
Security None None.

How this fits together

Bundled channel plugins provide account setup rules to onboarding, configuration writes, root-to-account promotion, and agent binding. Those flows persist channel settings that the channel runtime later uses to authenticate and route messages.

flowchart LR
  Plugin[Bundled channel plugin]
  Contract[Channel-owned setup contract]
  Onboarding[CLI onboarding and setup wizard]
  Promotion[Account promotion]
  Binding[Agent account binding]
  Config[Persisted channel configuration]
  Runtime[Channel runtime]
  Plugin --> Contract
  Contract --> Onboarding
  Contract --> Promotion
  Contract --> Binding
  Onboarding --> Config
  Promotion --> Config
  Binding --> Config
  Config --> Runtime
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports tests, checks, and CI, but the available context contains no inspectable after-fix live or runtime artifact for the changed onboarding/configuration behavior. Add a redacted real setup or harness transcript showing promotion and binding behavior, then update the PR body for a fresh review.
  • Resolve merge risk (P1) - This changes the shared setup/configuration path for many bundled channels; an omitted promotion, binding, or wizard caller could make an existing configured channel land on the wrong account or fail setup after upgrade.
  • Resolve merge risk (P1) - The exact PR head, four omitted changed files, merge result, and linked proof artifacts could not be inspected because the promisor object was unavailable locally and GitHub DNS failed.
  • Resolve merge risk (P1) - The PR carries the protected maintainer label, so it requires explicit maintainer handling even if its focused compatibility tests pass.
  • Complete next step (P2) - The protected maintainer label and unavailable exact-head evidence require a human compatibility review; there is no discrete, safely automatable repair finding.
Agent review details

Security

None.

Review metrics

None.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete setup compatibility proof (recommended)
    Verify the exact head through onboarding, account promotion, and agent binding for a contract-only bundled channel plus a legacy external-plugin adapter before merge.
  2. Pause for maintainer ownership review
    Hold the refactor if the repository cannot provide exact-head compatibility evidence for the shared setup boundary.

Technical review

Best possible solution:

Land only after a maintainer verifies the exact head preserves both contract-only bundled-channel behavior and the documented legacy setup path for an external plugin, with focused onboarding, promotion, and agent-binding evidence.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR refactors established setup behavior rather than reporting a standalone failure. The supplied patch adds focused contract-only promotion and binding coverage, but the exact branch tests could not be run or inspected from this checkout.

Is this the best way to solve the issue?

Unclear: consolidating bundled channels on setupContract matches the documented SDK direction and removes duplicate policy, but exact-head caller coverage and legacy-plugin compatibility proof remain necessary before confirming it is the best safe landing path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 83e0be6efee6.

Labels

Label changes:

  • add P2: The change affects the shared configuration and onboarding path for numerous bundled channels, but no current user-facing regression is established.
  • add merge-risk: 🚨 compatibility: Removing duplicated bundled setup surfaces can affect existing onboarding, account-promotion, agent-binding, and third-party legacy plugin behavior if any caller remains legacy-only.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports tests, checks, and CI, but the available context contains no inspectable after-fix live or runtime artifact for the changed onboarding/configuration behavior. Add a redacted real setup or harness transcript showing promotion and binding behavior, then update the PR body for a fresh review.

Label justifications:

  • P2: The change affects the shared configuration and onboarding path for numerous bundled channels, but no current user-facing regression is established.
  • merge-risk: 🚨 compatibility: Removing duplicated bundled setup surfaces can affect existing onboarding, account-promotion, agent-binding, and third-party legacy plugin behavior if any caller remains legacy-only.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports tests, checks, and CI, but the available context contains no inspectable after-fix live or runtime artifact for the changed onboarding/configuration behavior. Add a redacted real setup or harness transcript showing promotion and binding behavior, then update the PR body for a fresh review.

Evidence

What I checked:

  • Current compatibility boundary: Current main defines setupContract as the modern channel surface and marks setup deprecated; the setup resolver prefers a contract when present and otherwise wraps a released legacy adapter. (src/channels/plugins/types.plugin.ts:84, 83e0be6efee6)
  • Current callers still read legacy setup: Before this PR, account configuration, bundled promotion, and agent binding read plugin.setup; the supplied patch updates each path to prefer setupContract while retaining the legacy fallback. (src/channels/plugins/account-config-mutation.ts:36, 83e0be6efee6)
  • Published SDK guidance: The checked-in setup documentation says released external plugins may continue using setup, new plugins should expose setupContract, and OpenClaw prefers the contract when both exist; this matches the intended compatibility direction. Public docs: docs/plugins/sdk-setup.md. (docs/plugins/sdk-setup.md:165, 83e0be6efee6)
  • Owner-path provenance: resolveBindingAccountId on current main is attributed to Peter Steinberger in the local blame output; the proposed change specifically extends this owner path to contract-only plugins. (src/commands/agents.bindings.ts:263, 661afc22ac0e)
  • Inspection limitation: The local checkout could not materialize PR head a1336166dd6c1fef47557f3dc420f1486916b5d8, and GitHub access failed with DNS resolution errors. The complete branch, merge result, and linked action artifacts therefore remain unverified.

Likely related people:

  • steipete: The supplied PR contains the contract consolidation, and current-main blame attributes the adjacent agent-binding owner path to Peter Steinberger. (role: recent area contributor and proposed refactor author; confidence: medium; commits: 5a7060c547f9, a1336166dd6c, 661afc22ac0e; files: src/channels/plugins/setup-contract.ts, src/commands/agents.bindings.ts, src/channels/plugins/setup-promotion-helpers.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted after-fix evidence from a real or mock-gateway setup flow covering a contract-only channel’s account promotion and agent binding.
  • Rebase or refresh the PR so the exact head can be inspected against current main and the remaining checks can complete.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 9e4381e into main Jul 31, 2026
139 of 145 checks passed
@steipete
steipete deleted the codex/loc-channel-setup-2d45 branch July 31, 2026 23:57
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: buzz channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: irc channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: qa-channel Channel integration: qa-channel channel: qqbot channel: raft Channel integration: Raft channel: reef Channel integration: reef channel: slack Channel integration: slack channel: sms Channel integration: sms channel: synology-chat 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 channel: zalouser Channel integration: zalouser commands Command implementations maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant