Skip to content

refactor(channels): deslop channels - #165883

Merged
steipete merged 1 commit into
mainfrom
deslop/l400-types-guards-channels-20261005
Oct 6, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/l400-types-guards-channels-20261005

Conversation

@steipete

@steipete steipete commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Channel plugins repeat private types and recheck internal states already defined by their parsers, factories, and SDK owners, adding contracts that can drift independently.

User Impact

No intended user-visible change. Configuration keys, persisted data, wire payloads, tool descriptions, plugin manifests, and UI rendering stay unchanged. No migration or operator action is required.

Why This Change Was Made

The batch removes 1,210 net production lines, excluding tests and shared ratchets. It derives private contracts from their existing owners and retains validation at wire, config, persistence, authorization, and lifecycle boundaries. No code moves outside the monorepo.

  • Discord and Telegram: derive component/session context, command/media options, voice recovery and TTS results; consume normalized voice-command payloads directly.
  • Slack and Matrix: infer private draft/presence/fallback and configuration results; reuse message-hook and direct-room tracker contracts while retaining the concrete Matrix DM schema extension.
  • Feishu and Teams: reuse Lark/Azure dependency types, infer ingress, comment, Graph, send-context and routing results, and share existing text/card option contracts.
  • WhatsApp, iMessage and Signal: derive inbound projections, catchup/ingress and reply-delivery types; remove redundant checks on normalized Signal send results and a redundant Baileys listener assertion.
  • Mattermost, LINE and Zalo: reuse SDK callback, retry and slash-command contracts; infer client/ingress/parser results and remove duplicate Zalo response assertions.
  • ClickClack, Buzz, Tlon and Team Reports: derive parser, access, media, source and controller contracts, preserving narrower media inputs and intentional host/server compatibility.
  • Google Chat, SMS and the remaining channels: infer private delivery/media/probe/ingress results. X ingress consumes already parsed posts while its raw and durable-event parsers continue to validate input.

Shared assertion counts only shrink to reflect removed casts. Three unused private type exports are retired, and two existing test annotations now derive their producer contracts. Assertions and fixtures are unchanged. No new tests, dependencies, suppressions, or SDK exports are introduced.

Evidence

Independent Codex autoreview is clean at P0–P2, including the final private-export/test-annotation cleanup.

Blacksmith Testbox tbx_01m4731fw0f426p28y0ghm311q (lease provisioning run) passed 2,976 focused tests across 152 files, all 1,140 plugin-contract tests, and the suppression suite. Production and extension-test types passed. Both runtime and Madge checks reported zero; clean-base Madge also reported zero. The canonical SDK comparison reported no API changes (digest ff7b090f). The provisioning workflow was canceled when the owned lease was stopped; these are the completed payload results. The subsequent cleanup only privatized unused types and changed two test annotations; it introduces no runtime change.

An emission comparison of all 130 changed production files, using the repository's verbatim-module setting and normalizing formatting/comments, found identical JavaScript in 125 files. The five runtime changes remove checks for states excluded by their producers in Discord voice, iMessage reflection matching, Signal delivery, and X ingress. No UI source, generated manifest, schema, or tool-description changes are included.

The final type-only test edits passed pnpm test <file> --maxWorkers=1 in the maintainer-authorized nice -n 15 local fallback: ClickClack setup-core, 466.49 seconds wall; WhatsApp access-control, 289.06 seconds wall. Cold shared-worker preparation took 254.8 and 179.5 seconds respectively on the loaded host. The tests add no cases, timers, boots, retries, or assertions; hosted CI passed all 20 ClickClack cases and 21 WhatsApp cases, reporting 0.344 and 0.171 seconds of test-case time respectively (excluding shared setup).

The fallback was used after the Testbox lifetime/source-capture limit and an AWS broker readiness timeout. Local type-aware lint could not prepare SDK declarations within its 300-second build deadline, so local lint/full changed-check success is not claimed. Hosted CI run 37394598649 passed on 4f9a10a51f110b6d4d1e408be8d27a67e3bcc5a4: 59 jobs succeeded and 25 were intentionally skipped, including passing lint, dependency, production/test type, build, and test gates. The final pre-push runtime and Madge checks both reported zero. Production, full-tree, and script unused-export scans all passed with zero entries.

Normal squash auto-merge completed as 90c6934d630f7f57a13bfde6c3d08e30fdd242fd; ancestry was verified on current main. No CI rerun, correction push, or inherited-failure exception was needed.

Derive private parser, factory, callback, and option contracts from their
existing owners. Retain leaf interfaces, optional input contracts, and
validation at wire, config, persistence, and authority boundaries.

Remove redundant checks on normalized internal results and retire three
unused private type exports. Configuration, wire formats, persisted data,
model-facing text, and UI rendering are unchanged.
@clawsweeper

clawsweeper Bot commented Oct 6, 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 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: 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 channel: zalouser Channel integration: zalouser channel: feishu Channel integration: feishu channel: twitch Channel integration: twitch channel: irc channel: synology-chat channel: sms Channel integration: sms channel: buzz extensions: clickclack plugin: team-reports channel: x size: XL labels Oct 6, 2026
@steipete
steipete enabled auto-merge (squash) October 6, 2026 00:37
@clawsweeper

clawsweeper Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 5, 2026, 8:37 PM ET / October 6, 2026, 00:37 UTC.

ClawSweeper review

What this changes

The PR replaces copied private channel-plugin types with producer-derived contracts and removes redundant checks on normalized internal results.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this remains useful cleanup, and no concrete introduced correctness defect was found. The author’s verified repository-admin role also excludes automatic closure.

Likely related people: steipete — high-confidence routing based on prior merged channel work.

Priority: P3
Reviewed head: 4f9a10a51f110b6d4d1e408be8d27a67e3bcc5a4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent cleanup with concrete producer guarantees and substantial reported validation; no actionable introduced defect was found.
Proof confidence 🌊 off-meta tidepool Not applicable: The verified repository-admin author is exempt from ordinary external-contributor proof. The inspected changes do not materially alter authority; reported tests and emission comparison are supplemental validation, and no stored-data contract changes require migration proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The verified repository-admin author is exempt from ordinary external-contributor proof. The inspected changes do not materially alter authority; reported tests and emission comparison are supplemental validation, and no stored-data contract changes require migration proof.
Evidence reviewed 8 items Pinned introduced changes: Read the merge-base-to-head changes, including files omitted from the prompt’s bounded inventory. The patch primarily derives private contracts; the two test changes update annotations without changing fixtures or assertions.
Discord payload producer guarantee: Command delivery projects replies through projectOutboundPayloadPlanForJson, which supplies text from normalized reply parts and omits reasoning payload flags. This supports the simplified Discord voice text handling and diagnostic counters.
Signal result remains normalized: sendMessageSignal validates recipient delivery and always constructs messageId as a string before returning, supporting the removed consumer-side string check.
Findings None None.
Security None None.

How this fits together

Channel plugins translate incoming service messages into OpenClaw agent turns and deliver replies back through each service’s transport. This cleanup changes their internal types and result handling while retaining input parsing and authorization boundaries.

flowchart LR
  A[Service messages] --> B[Channel parsers]
  B --> C[Authorization and routing]
  C --> D[Agent turns]
  D --> E[Normalized reply results]
  E --> F[Channel delivery]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/feishu/src/doctor.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep private contracts derived from their existing producers while preserving validation at external input, persistence, authorization, and lifecycle boundaries.

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

Not applicable: this PR proposes internal cleanup rather than reporting a user-facing defect; no failing runtime reproduction was executed.

Is this the best way to solve the issue?

Yes: deriving private contracts from their producers reduces duplicate ownership, and the inspected runtime simplifications retain validation at the actual input boundaries.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is internal contract cleanup with no intended user-facing capability or urgent reported failure.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P3: This is internal contract cleanup with no intended user-facing capability or urgent reported failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

  • Pinned introduced changes: Read the merge-base-to-head changes, including files omitted from the prompt’s bounded inventory. The patch primarily derives private contracts; the two test changes update annotations without changing fixtures or assertions. (4f9a10a51f11)
  • Discord payload producer guarantee: Command delivery projects replies through projectOutboundPayloadPlanForJson, which supplies text from normalized reply parts and omits reasoning payload flags. This supports the simplified Discord voice text handling and diagnostic counters. (src/infra/outbound/payloads.ts:328, 4f9a10a51f11)
  • Signal result remains normalized: sendMessageSignal validates recipient delivery and always constructs messageId as a string before returning, supporting the removed consumer-side string check. (extensions/signal/src/send.ts:336, 4f9a10a51f11)
  • X ingress retains boundary validation: Stream events pass through parseXPostEnvelope, API pages validate each post, and stored ingress events still deserialize through parseXPostEnvelope. The removed admission check repeats parsing of already-normalized posts. (extensions/x/src/api.ts:140, 4f9a10a51f11)
  • Current-main necessity check: Fetched main still contains the copied Discord voice context and defensive payload checks, as well as X’s repeated ingress parser call. No verified merged replacement was supplied or established; no implemented-on-main closure is justified. (extensions/discord/src/voice/ingress.ts:27, eb405f0d5c50)
  • Verified author role: GitHub’s collaborator-permission endpoint reports steipete as repository admin, resolving the conflicting MEMBER and CONTRIBUTOR association fields for trusted-author handling.

Likely related people:

  • steipete: 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.

@steipete
steipete merged commit 90c6934 into main Oct 6, 2026
161 of 185 checks passed
@steipete
steipete deleted the deslop/l400-types-guards-channels-20261005 branch October 6, 2026 00:43
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Compatibility review is complete for the full 133-file diff. Config keys/defaults, schemas, plugin manifests, wire payloads, and persisted representations are unchanged. No migration or operator upgrade action is required.

The Feishu Doctor change removes only a duplicated TypeScript return annotation; it emits identical JavaScript. The config/type changes also erase without changing executable code. The five runtime differences consume facts already guaranteed by their producers and retain external-input, persistence, authorization, and lifecycle validation. The canonical SDK comparison reports no API changes.

This satisfies the review's config-compatibility and data-model checklist items. The review itself reports no correctness or security findings; the stored-model flag came from the Doctor path and an incomplete file inventory. Exact-head hosted CI passed, and the merged commit is verified on current main.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
Derive private parser, factory, callback, and option contracts from their
existing owners. Retain leaf interfaces, optional input contracts, and
validation at wire, config, persistence, and authority boundaries.

Remove redundant checks on normalized internal results and retire three
unused private type exports. Configuration, wire formats, persisted data,
model-facing text, and UI rendering are unchanged.
MarMarLabs added a commit to MarMarLabs/openclaw that referenced this pull request Oct 6, 2026
261 upstream commits. In Feishu, openclaw#121463 advertises the group chat type
in capabilities and adds a test for it. The channel refactors openclaw#165431,
openclaw#165718 and openclaw#165883 trim several Feishu modules, and openclaw#165883 moves
send.ts to the SDK's message types. Those hunks are separate from this
branch's table-mode and envelope changes in channel.ts and send.ts, and
both sides merge cleanly. The branch's 20 Feishu test files are
unchanged apart from upstream's new chat-types case.

Only docs/.generated/config-baseline.sha256 conflicted. It was
regenerated from this merge rather than hand-merged. build:docker ran in
a separate detached checkout of this commit. Counts stay core 2505,
channel 3874 and plugin 4490. The core and plugin hashes match
upstream/main, and the channel hash is unchanged because upstream did
not touch any channel schema. The generated metadata differs from
upstream/main only by the two Feishu markdown.tables entries. The three
generated-file checks pass there.

Feishu: 101 files and 1521 tests in the extension project, 17 files and
218 tests in the database-workers project, all passing. The forwarder
test and the routing guards pass, 503 tests. tsgo:core, tsgo:extensions,
tsgo:extensions:test, tsgo:test:root, the line-cap, max-lines,
assertion-safety, database-worker, test-timeout-race and test-mock-
exports ratchets against upstream/main, oxlint and oxfmt on the 43
changed code files all pass.
madmada added a commit to madmada/openclaw that referenced this pull request Oct 6, 2026
Main's channel deslop (openclaw#165883) replaced the explicit history page type in
history-catchup.ts with one inferred from queryBuzzRoomHistoryPage. The
conflict is resolved by keeping the rate-limit retry loop and adopting main's
inferred type, so the function no longer declares its return type.

Main also made startBuzzBus require a plugin service scheduler (openclaw#162669). The
two rate-limit tests that call startBuzzBus directly now pass
createTestPluginServiceScheduler(), like the rest of the file.

Co-authored-by: Claude Code <[email protected]>
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: signal Channel integration: signal 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: x channel: zalo Channel integration: zalo channel: zalouser Channel integration: zalouser extensions: clickclack plugin: team-reports size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant