Repository navigation
refactor(channels): deslop channels - #165883
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed October 5, 2026, 8:37 PM ET / October 6, 2026, 00:37 UTC. ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherChannel 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]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
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. |
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.
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.
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]>
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.
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 (digestff7b090f). 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=1in the maintainer-authorizednice -n 15local 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.