Skip to content

refactor(discord): deslop discord - #163728

Merged
steipete merged 5 commits into
mainfrom
deslop/l302-deslop-discord-consolidation
Oct 2, 2026
Merged

steipete merged 5 commits into
mainfrom
deslop/l302-deslop-discord-consolidation

Conversation

@steipete

@steipete steipete commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Discord still duplicates delivery, authorization setup, registry lifecycle, and transport plumbing around existing owners. This batch removes 1,059 net production lines through deletion and consolidation.

User Impact

Supported Discord configuration, message payloads, component rendering, and persisted state stay compatible. The fixes below correct audit and timeout outcomes.

Pre-July configuration forms (voice.tts.<provider> and guild-channel allow/agentId) now stop before mutation and name the original path plus a bridge upgrade: install 2026.9.7, run openclaw doctor --fix, then upgrade again. July's strict schemas already require voice.tts.providers, enabled, and top-level bindings; streaming, nested DM access, wake-name, and supported state migrations remain.

Why This Change Was Made

  • Give polls and stickers one structured-send owner, sharing recipient resolution, authority, retries, nonces, activity, and receipts; consolidate message/reaction mutation and send-result projection.
  • Derive component send options from the normal send contract and remove action-context reconstruction while preserving sparse session metadata.
  • Reuse native-command channel-policy facts, command-control binding, wildcard descriptors, and picker ID state without changing authorization fences or serialized controls.
  • Consolidate component/modal store opening, timestamp normalization, consumption, and approval delete/update fallback while retaining persistent settlement and locks.
  • Share dispatcher types, upload conversion, scheduler pruning, Gateway shutdown cleanup, token projection, and existing normalization helpers.
  • Simplify voice-follow departure handling, authorization results, and speaker-cache ownership while retaining generation and transport boundaries.
  • Reuse the media timeout owner, canonical object coercion, undefined-field serialization, config ID-list traversal, and the common voice-channel schema.
  • Keep interaction response state with the existing queue and REST-effect owner; remove the single-use state controller and action translation without changing transition order or failure behavior.
  • Remove retired configuration transforms and enforce their refusal in Doctor's existing pre-recovery owner. This runs before automatic repair or last-known-good restoration and is rechecked before config writes; the later plugin-local detector is removed. The owning core addition is 15 net lines, offset by removing 47 plugin lines.

Fixes found along the way

  • The security audit overlooked canonical allowFrom and falsely reported that native commands had no allowlist. Canonical values, including an empty override, now take precedence over nested aliases.
  • Synchronous cancellation could resolve a timed-out operation or replace its deadline error with an abort error. The deadline now settles first; cancellation still happens in the same timer callback.
  • Doctor's mutable-name warning recommended a nonexistent setting. It now names dangerouslyAllowNameMatching.

Evidence

  • Blacksmith Testbox: Discord selection passed 3,306 tests across 277 files, plugin contracts passed 1,132 tests across 48 files, both cycle checks reported 0, and the Discord dependency scan passed. Remote runner. Wrapper command results are the proof; stopping a Testbox can cancel its hosting runner workflow.
  • Commands: node scripts/run-vitest.mjs extensions/discord, node scripts/run-vitest.mjs src/plugins/contracts, both check-madge-import-cycles.ts and check-import-cycles.ts, and Knip's production dependency scan for extensions/discord.
  • Negative controls on the original audit/timeout implementations produced the expected three failures; repaired cases pass. The original Doctor warning also failed its new regression. The final plugin Doctor suite passes 14 tests after replacing the helper-only retirement cases with an actual preflight regression.
  • Isolated Codex autoreview: clean through P2. Rebase onto fresh main preserved the patch (git range-diff).
  • Production and extension-test typechecks, changed-file guards, unused-export scans, and script lint passed. Final Doctor/component/adopted-thread selection passed 72 tests across 4 files; both import-cycle checks again reported 0. Final committed cleanup passed type-aware lint, both extension typechecks, 79 interaction/Gateway tests, 1,132 plugin-contract tests, and both cycle checks (0). Published-upgrader proof at 0ee7b9491511 passed: [email protected] → the frozen candidate tarball, base scenario, using the real published updater. Installed package identity, automatic migration, Doctor, config survival, candidate plugin requests, Gateway startup/readiness/status, and unavailable-plugin-path config preservation passed. The complete remote command (final tests/cycles, full package build, and Docker proof) took 25m44s; the full package build took 8m51s.

Measured single-worker command wall times (pnpm test <file> --maxWorkers=1): Doctor 26.109 s, security audit 27.735 s, timeouts 41.661 s. These include the existing 20–26 s compiled-worker preparation, with no new real timers, polling, or per-test process/Gateway boots. Initial exact-head hosted CI passed 44 jobs. Extension test bundles took 127, 132, 156, and 192 seconds including job setup. The new Doctor preflight file takes 56.55 s with one worker (13 tests); its added case took 793 ms. It fails on the previous recovery owner (expected refusal was absent), then passes with the early fence while preserving root, include, and valid backup bytes. At 5448e2e4dcb5, installed production CLI proof passed all 12 retired-input cases (four TTS providers plus guild allow/agentId, each at root and account scope): exact diagnostic paths, 2026.9.7 bridge guidance, byte-identical active config, and validation refusal. A separately verified live-Gateway maintenance refusal preserved config and health; the retired-input matrix ran after the owned Gateway stopped. Published [email protected] plus published @openclaw/[email protected] then repaired the combined fixture, preserving speaker settings, enable flags, mention policy, and root/account bindings. Candidate Doctor, validation, and fresh Gateway readiness passed. Core/extension types, changed-file lint, plugin contracts, docs sanity, and both zero-cycle checks also passed. The final published-updater cell on 5448e2e4dcb5 also passed in 11m59s, including installed package identity, automatic migration, Doctor, config survival, candidate plugin requests, and Gateway readiness/status. Final exact-head hosted CI passed 49 jobs, with no failures.

Consolidate Discord delivery, authorization setup, component registry, transport and voice helpers while preserving current behavior. Retire pre-July configuration transforms with unchanged-input bridge-upgrade guidance. Fix canonical allowlist audit detection and preserve deadline errors when cancellation settles work synchronously.
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: XL labels Oct 2, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 4:47 PM ET / 20:47 UTC (Revision 3).

ClawSweeper review

What this changes

The PR consolidates Discord delivery, interaction, authorization, and transport helpers, fixes audit and timeout outcomes, and replaces older configuration repairs with byte-preserving bridge-upgrade guidance.

Merge readiness

✅ Ready for maintainer review

The branch still contains useful work absent from current main. The prior documentation finding is resolved, the recorded upgrade proof covers the pinned head, and no blocking patch defect was found.

Priority: P2
Reviewed head: 5448e2e4dcb5c8d804c4ad18a1333fbf883f9316

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent consolidation with meaningful boundary regressions and production upgrade evidence, with no remaining actionable finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body connects Doctor's changed admission owner to exact-head installed-CLI refusal for all 12 retired-input cases, unchanged config bytes, published bridge repair, and candidate validation/Gateway readiness. The final published-updater run covers existing settings and bindings; registry serialization remains compatible. CI and unit regressions are supplemental.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body connects Doctor's changed admission owner to exact-head installed-CLI refusal for all 12 retired-input cases, unchanged config bytes, published bridge repair, and candidate validation/Gateway readiness. The final published-updater run covers existing settings and bindings; registry serialization remains compatible. CI and unit regressions are supplemental.
Evidence reviewed 9 items Pinned introduction reviewed: Reviewed the introduced hunks between the verified merge base and exact head across all 57 paths. The stale test merge and endpoint drift were not used to attribute changes or claim deletion of main-only behavior.
Distinct work remains absent from main: Current-main comparison confirms that the deadline-settlement fix, canonical allowlist audit handling, and Discord retired-input detector remain unique to this branch. This comparison establishes necessity, not PR ownership.
Prior documentation finding resolved: The retention section documents root/account Discord recovery through 2026.9.7, and the active migration table now excludes Discord voice TTS blocks. The diff against the earlier reviewed head verifies resolution of the retained finding.
Findings None None.
Security None None.

How this fits together

The Discord plugin turns incoming messages and interactions into OpenClaw agent requests and sends responses through Discord. Doctor prepares its stored configuration before recovery, updates, and startup.

flowchart TD
  A[Stored configuration] --> B[Doctor admission]
  B --> C[Supported configuration]
  B --> D[Preserved retired inputs and bridge guidance]
  E[Discord messages and interactions] --> F[Plugin policy and dispatch]
  C --> F
  F --> G[Agent requests and Discord replies]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -1059, Tests -135, Docs +13, Other -1. Total -1182 across 57 files.

View PR surface stats
Area Files Added Removed Net
Source 49 627 1686 -1059
Tests 5 118 253 -135
Docs 2 14 1 +13
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 5 -1
Total 57 763 1945 -1182

Review metrics

Metric Value Why it matters
Retired-input coverage 6 input forms across 2 scopes; 12 production refusal cases The recorded installed-CLI matrix covers every newly retired root/account form and its bridge recovery.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/discord/src/doctor-contract.ts, migration/backfill/repair: extensions/discord/src/doctor.ts, migration/backfill/repair: src/commands/doctor/shared/retired-config-formats.ts, unknown-data-model-change: extensions/discord/src/doctor-contract.ts, unknown-data-model-change: extensions/discord/src/doctor.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Keep one Discord owner for each delivery and interaction responsibility, preserving supported state and explicit, byte-preserving recovery guidance for retired inputs.

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

Yes, the audit precedence and synchronous timeout-settlement defects have clear source paths and focused negative-control regressions reported in the captured body; this review did not execute them.

Is this the best way to solve the issue?

Yes, the branch consolidates existing owners while retaining authorization, transport, and persistence contracts; the retired-config path uses established Doctor admission and demonstrated bridge recovery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against aac001b30ba8.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is bounded Discord consolidation with audit, timeout, and Doctor corrections, without evidence of an urgent user-facing outage.
  • merge-risk: 🚨 compatibility: Users retaining pre-July Discord fields must repair through 2026.9.7; the intentional tradeoff is documented and covered by preservation and upgrade proof.
  • 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 (live_output): The captured body connects Doctor's changed admission owner to exact-head installed-CLI refusal for all 12 retired-input cases, unchanged config bytes, published bridge repair, and candidate validation/Gateway readiness. The final published-updater run covers existing settings and bindings; registry serialization remains compatible. CI and unit regressions are supplemental.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body connects Doctor's changed admission owner to exact-head installed-CLI refusal for all 12 retired-input cases, unchanged config bytes, published bridge repair, and candidate validation/Gateway readiness. The final published-updater run covers existing settings and bindings; registry serialization remains compatible. CI and unit regressions are supplemental.

Evidence

What I checked:

  • Pinned introduction reviewed: Reviewed the introduced hunks between the verified merge base and exact head across all 57 paths. The stale test merge and endpoint drift were not used to attribute changes or claim deletion of main-only behavior. (5448e2e4dcb5)
  • Distinct work remains absent from main: Current-main comparison confirms that the deadline-settlement fix, canonical allowlist audit handling, and Discord retired-input detector remain unique to this branch. This comparison establishes necessity, not PR ownership. (extensions/discord/src/monitor/timeouts.ts:127, 5448e2e4dcb5)
  • Prior documentation finding resolved: The retention section documents root/account Discord recovery through 2026.9.7, and the active migration table now excludes Discord voice TTS blocks. The diff against the earlier reviewed head verifies resolution of the retained finding. Public docs: docs/gateway/doctor/config-migrations.md. (docs/gateway/doctor/config-migrations.md:51, 5448e2e4dcb5)
  • Refusal precedes recovery: The added detector uses Doctor's existing pre-recovery admission owner and automatic-repair guard. The new boundary regression checks exact retired paths while preserving root, included configuration, and backup bytes. (src/commands/doctor/shared/retired-config-formats.ts:91, 5448e2e4dcb5)
  • Production upgrade and preservation evidence: The captured PR body records installed production CLI proof at the exact head for all 12 retired-input cases, diagnostic paths, unchanged active configuration, and validation refusal. Published OpenClaw and Discord 2026.9.7 repaired the combined fixture while preserving speaker settings, enable flags, mention policy, and bindings; candidate Doctor, validation, and fresh Gateway readiness passed. The final exact-head published-updater cell also passed, including package identity, config survival, plugin requests, and Gateway readiness/status. (5448e2e4dcb5)
  • Intentional compatibility tradeoff: The repository-state MEMBER-authored proposal explicitly chooses preserved-input refusal and a 2026.9.7 bridge for pre-July forms, matching the documented retention policy. Those users must perform intermediate repair; this accepted operator requirement remains compatibility context rather than an unresolved acceptance request. The shipped 2026.9.7 Doctor source retains the bridge transforms. Public docs: docs/gateway/doctor/config-migrations.md. (docs/gateway/doctor/config-migrations.md:33, c074824a27c9)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Shakker: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-02T19:10:07.374Z sha 0ee7b94 :: blocked before merge. :: [P3] Update the canonical Doctor table for Discord migration retirement
  • reviewed 2026-10-02T20:32:28.522Z sha 5448e2e :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations labels Oct 2, 2026
@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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 2, 2026
@steipete
steipete merged commit cb450bc into main Oct 2, 2026
146 of 150 checks passed
@steipete
steipete deleted the deslop/l302-deslop-discord-consolidation branch October 2, 2026 20:53
@steipete

steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Oct 2, 2026
* commit '79be075e5aa46be9e42dbd53ed6e30e81469210a': (33 commits)
  fix(ui): keep selected-text comment input readable while scrolling (#163772)
  test(memory): open corpus database explicitly
  fix: bound Doctor migration capture to plugin data (#163780)
  fix(ui): gate system information at the shared reader (#160982)
  chore(db): reclassify worker inventory sites with caller evidence (#163754)
  refactor(channels): deslop Slack and Matrix (#163740)
  fix(agents): reject empty sessions_search queries in the tool schema (#129120)
  perf(nodes): load only what a worker turn needs (#160442)
  test(cli): assert concise Gateway failure copy in CLI process tests (#163649)
  refactor(discord): deslop discord (#163728)
  fix(workboard): make Sessions boards work on multi-agent Gateways (#163761)
  test(gateway): add sustained heap retention diagnostics (#163764)
  test(ui): disambiguate session filter controls
  refactor(plugins): deslop imessage, mattermost, and voice-call (#163767)
  fix(qa): run Telegram plugin source in --source-gateway userbot runs (#163718)
  feat(macos): add a --no-activate launch flag for background automation (#163758)
  fix(agents): preserve host authority across module reloads (#163725)
  perf(gateway): serve the listener before multi-gigabyte store validation and honor clean-close receipts at startup (#163690)
  fix: keep video widgets scrollable and preload initial frames (#163762)
  feat(memory): add a provider-neutral memory provider runtime (#162175)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
* refactor(discord): deslop discord

Consolidate Discord delivery, authorization setup, component registry, transport and voice helpers while preserving current behavior. Retire pre-July configuration transforms with unchanged-input bridge-upgrade guidance. Fix canonical allowlist audit detection and preserve deadline errors when cancellation settles work synchronously.

* fix(discord): finish deslop validation and Doctor guidance

* refactor(discord): keep response state with interaction effects

* docs(discord): document the retired config bridge

* fix(discord): refuse retired config before backup recovery
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 3, 2026
* commit '1fda703fb4d3630e4633461967b2a2186e8f15fd': (33 commits)
  fix(ui): keep selected-text comment input readable while scrolling (openclaw#163772)
  test(memory): open corpus database explicitly
  fix: bound Doctor migration capture to plugin data (openclaw#163780)
  fix(ui): gate system information at the shared reader (openclaw#160982)
  chore(db): reclassify worker inventory sites with caller evidence (openclaw#163754)
  refactor(channels): deslop Slack and Matrix (openclaw#163740)
  fix(agents): reject empty sessions_search queries in the tool schema (openclaw#129120)
  perf(nodes): load only what a worker turn needs (openclaw#160442)
  test(cli): assert concise Gateway failure copy in CLI process tests (openclaw#163649)
  refactor(discord): deslop discord (openclaw#163728)
  fix(workboard): make Sessions boards work on multi-agent Gateways (openclaw#163761)
  test(gateway): add sustained heap retention diagnostics (openclaw#163764)
  test(ui): disambiguate session filter controls
  refactor(plugins): deslop imessage, mattermost, and voice-call (openclaw#163767)
  fix(qa): run Telegram plugin source in --source-gateway userbot runs (openclaw#163718)
  feat(macos): add a --no-activate launch flag for background automation (openclaw#163758)
  fix(agents): preserve host authority across module reloads (openclaw#163725)
  perf(gateway): serve the listener before multi-gigabyte store validation and honor clean-close receipts at startup (openclaw#163690)
  fix: keep video widgets scrollable and preload initial frames (openclaw#163762)
  feat(memory): add a provider-neutral memory provider runtime (openclaw#162175)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime 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: XL 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