Skip to content

refactor(channels): unify bundled setup ownership and remove duplicate paths - #117188

Merged
steipete merged 1 commit into
mainfrom
codex/100k-wave2-channel-setup-2d45
Aug 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/100k-wave2-channel-setup-2d45

Conversation

@steipete

@steipete steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Bundled Slack, Matrix, and Nostr channels duplicated setup metadata, account-state handling, status resolvers, and runtime plugin definitions. Core setup account mutation likewise repeated root/named-account writes and promotion paths, increasing drift risk during onboarding and upgrades.

Why This Change Was Made

Make lightweight setup definitions authoritative for shared channel metadata while keeping heavy runtime functionality lazy and plugin-owned. Reuse canonical account-section reads/writes, one promotion path, typed Nostr setup input, and a shared Nostr status owner. Preserve every shipped external Plugin SDK setup export, released legacy setup/setupWizard adapters, setupContract precedence, CLI flags, account-key spelling, disabled-account semantics, Matrix capability differences, and Slack runtime security/doctor behavior.

Production LOC: 173 added / 401 removed = 228 fewer lines; zero test deletions and zero public SDK surface changes.

User Impact

No intended user-visible behavior change. Operators retain existing guided and non-interactive setup, named/default accounts, pairing/allowlist policies, plugin compatibility, and all Slack, Matrix, and Nostr capabilities.

Evidence

  • Remote Blacksmith Testbox: https://github.com/openclaw/openclaw/actions/runs/30681190710
  • Focused real owner/sibling proof: 14 files, 143 tests, 7 Vitest projects passed, covering setup helpers, account promotion, import safety, modern/legacy contract precedence, wizard/proxy/binary/legacy policy, channels CLI, channels add, and Slack/Matrix/Nostr setup.
  • Full remote pnpm check:changed passed: public Plugin SDK API baseline, plugin-boundary guard, dead-export scans, core/core-test/plugin/plugin-test type checks, changed lint, formatting, dependency/security/database guards, and zero runtime import cycles.
  • Full remote pnpm build passed, including all 148 public Plugin SDK subpaths and bundled-plugin/runtime startup imports.
  • Real isolated packaged operator proof passed: channels add configured Nostr, Slack, and Matrix; channels list --json returned all three installed/configured default accounts; doctor --non-interactive completed and preserved security, pairing, and allowlist diagnostics.
  • Fresh structured autoreview: gpt-5.6-sol/high, clean; confidence 0.99.
  • Compatibility directly verified against shipped v2026.6.33, v2026.7.2-beta.5, and docs/plugins/sdk-setup.md / docs/plugins/sdk-migration.md.
  • The dedicated Testbox was stopped after proof.

@openclaw-barnacle openclaw-barnacle Bot added channel: matrix Channel integration: matrix channel: nostr Channel integration: nostr channel: slack Channel integration: slack size: L maintainer Maintainer-authored PR labels Aug 1, 2026
@steipete
steipete marked this pull request as ready for review August 1, 2026 03:18
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 11:24 PM ET / August 1, 2026, 03:24 UTC.

ClawSweeper review

What this changes

This PR consolidates setup metadata, account-promotion behavior, and status ownership for bundled Slack, Matrix, and Nostr channel plugins while keeping their heavier runtime code lazy and plugin-owned.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal maintainer merge review. The inspected refactor preserves the existing setup-contract precedence and lazy plugin-runtime boundary, with no discrete patch regression found; the maintainer label and still-running current-head checks require explicit human handling before merge.

Priority: P2
Reviewed head: 09e2a1aafe99caf53879b746b1c1ea1c2842a3d8
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The refactor has strong stated packaged proof, passing focused and contract checks, and no concrete correctness finding from source review.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The PR supplies after-fix packaged operator proof for configuring all three affected channels, listing their configured accounts, and running Doctor; redact any private tokens or endpoints if that evidence is expanded in discussion.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR supplies after-fix packaged operator proof for configuring all three affected channels, listing their configured accounts, and running Doctor; redact any private tokens or endpoints if that evidence is expanded in discussion.
Evidence reviewed 6 items Shared promotion coverage: The existing shared-helper tests cover promotion of legacy Matrix root keys into both default and sole named accounts, including preservation of named-account values.
Released setup-contract precedence: Current setup execution explicitly prefers setupContract while retaining the released legacy setup adapter as one compatibility boundary, matching the refactor’s stated compatibility goal.
Nostr setup ownership remains lightweight: The proposed Nostr adapter keeps the status factory next to its typed setup adapter; it resolves configured state and relay status without loading the heavy runtime module.
Findings None None.
Security None None.

How this fits together

OpenClaw’s channel setup path turns guided or CLI setup input into canonical channel configuration, then loads the channel plugin runtime and Doctor diagnostics as needed. This change moves duplicated setup definitions to lightweight plugin-owned surfaces while shared helpers retain account-name and legacy single-account promotion behavior.

flowchart LR
  Input[Guided or CLI channel setup] --> Contract[Channel setup contract]
  Contract --> Config[Canonical channel configuration]
  Config --> Promotion[Account promotion and naming]
  Config --> Plugin[Lightweight plugin setup metadata]
  Plugin --> Runtime[Lazy channel runtime]
  Runtime --> Doctor[Status and Doctor diagnostics]
Loading

Decision needed

Question Recommendation
Should the bundled-channel setup owner approve this compatibility-sensitive consolidation after the current-head build and remaining check shards complete? Approve after current checks finish: Accept the canonical setup ownership refactor once the remaining required checks on this exact head are green.

Why: The patch is a broad ownership refactor across shared setup logic and three bundled channel plugins; automated review found no concrete defect, but the protected maintainer workflow requires a human merge decision.

Before merge

  • Resolve merge risk (P1) - This is compatibility-sensitive because shared setup mutation and promotion logic affects existing root and named-account configurations; merge only after the remaining current-head build and compact-check shards complete successfully.
Agent review details

Security

None.

PR surface

Source -228. Total -228 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 8 173 401 -228
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 173 401 -228

Review metrics

Metric Value Why it matters
Public Plugin SDK surface 0 API baseline changes The provided check-plugin-sdk-api-baseline result and PR scope indicate the refactor does not intentionally expand, remove, or rename the released setup SDK surface.

Merge-risk options

Maintainer options:

  1. Complete compatibility gate (recommended)
    Merge after the current-head build and remaining checks confirm the refactor preserves existing setup, account-promotion, and Plugin SDK behavior.
  2. Pause for an upgrade replay
    If any current check exposes a setup regression, pause this refactor and add a narrow regression case for the affected stored configuration shape.

Technical review

Best possible solution:

Land one canonical lightweight setup surface per bundled channel while retaining the released setup SDK compatibility boundary and the existing account-promotion semantics for upgraded configurations.

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

Not applicable: this PR is a behavior-preserving ownership refactor rather than a report of a failing user path. The relevant evidence is setup-contract and account-promotion coverage plus the supplied packaged operator proof.

Is this the best way to solve the issue?

Yes. Keeping lightweight setup metadata in plugin-owned setup surfaces while retaining the shared canonical mutation helpers is the narrower maintainable design and preserves the existing lazy-runtime boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 865a7286c8a5.

Labels

Label changes:

  • add P2: The refactor affects established bundled channel setup behavior but has bounded blast radius and no demonstrated active user regression.
  • add merge-risk: 🚨 compatibility: Shared account naming and single-account promotion are changed beneath Slack, Matrix, and Nostr setup flows used by existing configurations.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies after-fix packaged operator proof for configuring all three affected channels, listing their configured accounts, and running Doctor; redact any private tokens or endpoints if that evidence is expanded in discussion.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR supplies after-fix packaged operator proof for configuring all three affected channels, listing their configured accounts, and running Doctor; redact any private tokens or endpoints if that evidence is expanded in discussion.

Label justifications:

  • P2: The refactor affects established bundled channel setup behavior but has bounded blast radius and no demonstrated active user regression.
  • merge-risk: 🚨 compatibility: Shared account naming and single-account promotion are changed beneath Slack, Matrix, and Nostr setup flows used by existing configurations.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR supplies after-fix packaged operator proof for configuring all three affected channels, listing their configured accounts, and running Doctor; redact any private tokens or endpoints if that evidence is expanded in discussion.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies after-fix packaged operator proof for configuring all three affected channels, listing their configured accounts, and running Doctor; redact any private tokens or endpoints if that evidence is expanded in discussion.

Evidence

What I checked:

  • Shared promotion coverage: The existing shared-helper tests cover promotion of legacy Matrix root keys into both default and sole named accounts, including preservation of named-account values. (src/channels/plugins/setup-helpers.test.ts:366, 865a7286c8a5)
  • Released setup-contract precedence: Current setup execution explicitly prefers setupContract while retaining the released legacy setup adapter as one compatibility boundary, matching the refactor’s stated compatibility goal. (src/channels/plugins/setup-contract.ts:162, 865a7286c8a5)
  • Nostr setup ownership remains lightweight: The proposed Nostr adapter keeps the status factory next to its typed setup adapter; it resolves configured state and relay status without loading the heavy runtime module. (extensions/nostr/src/setup-adapter.ts:115, 09e2a1aafe99)
  • Feature provenance: The surrounding bundled-channel setup-contract refactor appears to date to the immediately preceding merged setup work, and the proposed branch continues that ownership consolidation. (src/channels/plugins/setup-helpers.ts:1, 9e4381eb1c8c)
  • Current-main and release status: The PR head is not an ancestor of either current main or the latest release tag, so its central refactor is neither already implemented nor shipped. (09e2a1aafe99)
  • After-fix operator proof: The PR body reports an isolated packaged run that configured Nostr, Slack, and Matrix, listed all three accounts, and completed non-interactive Doctor while preserving security diagnostics; the provided checks also show the dedicated real-behavior-proof job passed. (09e2a1aafe99)

Likely related people:

  • steipete: Current feature history attributes the bundled channel setup-contract work and the proposed follow-on consolidation to Peter Steinberger; blame also attributes the Nostr setup adapter to the same author. (role: feature owner and recent area contributor; confidence: high; commits: 9e4381eb1c8c, 533807ab61e9, 09e2a1aafe99; files: src/channels/plugins/setup-helpers.ts, extensions/nostr/src/setup-adapter.ts, extensions/slack/src/shared.ts)

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 654744d into main Aug 1, 2026
190 of 203 checks passed
@steipete
steipete deleted the codex/100k-wave2-channel-setup-2d45 branch August 1, 2026 03:33
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@clawsweeper

clawsweeper Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor(channels): unify bundled setup ownership and remove duplicate paths This is item 3/3 in the current shard. Shard 8/46.

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.

vincentkoc added a commit to chenyangjun-xy/openclaw that referenced this pull request Aug 1, 2026
* origin/main:
  fix(onboard): stop a full reset from resetting the default workspace when the config is unreadable (openclaw#114110)
  refactor(i18n): remove unused Apple contradiction report (openclaw#117182)
  fix(google): stop scraping Gemini CLI OAuth credentials (openclaw#117167)
  perf: count large histories before Gateway prewarm (openclaw#117118)
  fix(signal): restore provider-safe original attachment filenames (openclaw#115107)
  refactor(channels): unify setup ownership across bundled channels (openclaw#117188)
  fix: allow gateway service commands for named profiles (openclaw#116314)
  fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041)
  fix(ollama): honor model requests and pull completion contracts (openclaw#117171)
  fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168)
  fix(telegram): confirm polling before long poll (openclaw#116970)
  fix(tlon): wire autoDiscoverChannels through the settings-store round-trip (openclaw#114949)
  fix(gateway): yield before post-ready background work (openclaw#117083)
  test(google): cover live transcript overflow
  fix(google): bound live transcript accumulation
sunlit-deng pushed a commit to sunlit-deng/openclaw that referenced this pull request Aug 1, 2026
* commit '441d6ab254df14fb6939a8a261f474904ff9c500': (388 commits)
  fix(qqbot): ignore blank app id fallbacks (openclaw#109460)
  fix(feishu): consume implicit reply targets across media delivery (openclaw#117196)
  fix(exec): preserve approved command output when sessions resume (openclaw#117177)
  fix(qa): use public subagent fanout evidence (openclaw#116832)
  fix(googlechat): cancel unread auth response bodies before release (openclaw#115873)
  fix(queue): prevent cron saturation from starving hook dispatch (openclaw#116666)
  fix(gateway): sessions.steer retry no longer interrupts an active run when replaying a cached idempotency key (openclaw#116969)
  fix(irc): config validation rejects documented channels.irc.configWrites key (openclaw#112392)
  fix(mistral): keep terminal error branch lint-clean
  fix(onboard): stop a full reset from resetting the default workspace when the config is unreadable (openclaw#114110)
  refactor(i18n): remove unused Apple contradiction report (openclaw#117182)
  fix(google): stop scraping Gemini CLI OAuth credentials (openclaw#117167)
  perf: count large histories before Gateway prewarm (openclaw#117118)
  fix(signal): restore provider-safe original attachment filenames (openclaw#115107)
  refactor(channels): unify setup ownership across bundled channels (openclaw#117188)
  fix: allow gateway service commands for named profiles (openclaw#116314)
  fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041)
  fix(ollama): honor model requests and pull completion contracts (openclaw#117171)
  fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168)
  fix(telegram): confirm polling before long poll (openclaw#116970)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
* origin/main:
  fix(onboard): stop a full reset from resetting the default workspace when the config is unreadable (openclaw#114110)
  refactor(i18n): remove unused Apple contradiction report (openclaw#117182)
  fix(google): stop scraping Gemini CLI OAuth credentials (openclaw#117167)
  perf: count large histories before Gateway prewarm (openclaw#117118)
  fix(signal): restore provider-safe original attachment filenames (openclaw#115107)
  refactor(channels): unify setup ownership across bundled channels (openclaw#117188)
  fix: allow gateway service commands for named profiles (openclaw#116314)
  fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041)
  fix(ollama): honor model requests and pull completion contracts (openclaw#117171)
  fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168)
  fix(telegram): confirm polling before long poll (openclaw#116970)
  fix(tlon): wire autoDiscoverChannels through the settings-store round-trip (openclaw#114949)
  fix(gateway): yield before post-ready background work (openclaw#117083)
  test(google): cover live transcript overflow
  fix(google): bound live transcript accumulation
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
* commit 'ae4e662145b6aa162777cdb1c011b3f04ddd230d': (388 commits)
  fix(qqbot): ignore blank app id fallbacks (openclaw#109460)
  fix(feishu): consume implicit reply targets across media delivery (openclaw#117196)
  fix(exec): preserve approved command output when sessions resume (openclaw#117177)
  fix(qa): use public subagent fanout evidence (openclaw#116832)
  fix(googlechat): cancel unread auth response bodies before release (openclaw#115873)
  fix(queue): prevent cron saturation from starving hook dispatch (openclaw#116666)
  fix(gateway): sessions.steer retry no longer interrupts an active run when replaying a cached idempotency key (openclaw#116969)
  fix(irc): config validation rejects documented channels.irc.configWrites key (openclaw#112392)
  fix(mistral): keep terminal error branch lint-clean
  fix(onboard): stop a full reset from resetting the default workspace when the config is unreadable (openclaw#114110)
  refactor(i18n): remove unused Apple contradiction report (openclaw#117182)
  fix(google): stop scraping Gemini CLI OAuth credentials (openclaw#117167)
  perf: count large histories before Gateway prewarm (openclaw#117118)
  fix(signal): restore provider-safe original attachment filenames (openclaw#115107)
  refactor(channels): unify setup ownership across bundled channels (openclaw#117188)
  fix: allow gateway service commands for named profiles (openclaw#116314)
  fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041)
  fix(ollama): honor model requests and pull completion contracts (openclaw#117171)
  fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168)
  fix(telegram): confirm polling before long poll (openclaw#116970)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: matrix Channel integration: matrix channel: nostr Channel integration: nostr channel: slack Channel integration: slack 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant