Skip to content

refactor(channels): deslop Telegram, Matrix and Feishu fourth pass - #160032

Merged
steipete merged 2 commits into
mainfrom
deslop/l134-tg-matrix-feishu4
Sep 28, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/l134-tg-matrix-feishu4

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Removes repeated argument/result projections, duplicate types and unnecessary forwarding layers remaining in Telegram, Matrix and Feishu after the earlier cleanup passes.

User Impact

The refactors preserve wire payloads, parsing, channel policies, crypto/device state, rate limits, chunking, persistence and configuration. Two bugs found during the sweep are also repaired: Telegram membership audits release their owned HTTP transport, and Mini App bootstrap handoffs reject changes to the configuration they authenticated against.

Why This Change Was Made

This fourth pass removes 629 net production lines (598 added, 1,227 deleted). It is below the requested 1,000-line threshold; the complete, size-sorted READ coverage for all 204 production files over 200 lines is attached below.

  • Feishu descendant insertion uses one request/error/result owner while retaining each caller's existing block normalization.
  • Feishu probe failures, card-action notices, comment routing and nondurable message failures share their existing context instead of rebuilding it repeatedly.
  • Feishu media, directory, message and SDK-response types come from their existing owners; redundant casts and unread forwarding members are removed.
  • Matrix client options/release modes, ingress inputs and message relation constants have one declaration; both outbound surfaces share presentation capabilities.
  • Matrix tool parameters, timestamp rendering, terminal controls and onboarding normalization use their existing readers/renderers. Dispatcher results are returned directly.
  • Telegram native-command/account/cache types reuse their owners. Unread media/forum/pin inputs, discarded callback results and an unreachable acknowledgement finalizer are removed.
  • Telegram numeric, rich-message, chunking and lazy-monitor wrappers are cut over to their owners. HTML escaping, file-reference patterns and session-binding projections retain their existing outputs with less repeated scaffolding.

Fixes found along the way

  • Membership audits previously discarded the close handle returned by their newly created Telegram transport. They now close it in finally after all response bodies settle. The regression checks exact GET request bytes and disposal of a real dispatcher on success, network failure, malformed JSON and a gated final response body.
  • Mini App authentication previously retained configuration across awaited body/URL/credential work. It now reads configuration after body collection, rechecks ownership before handoff and passes the existing currentness assertion to the bootstrap issuer. Tests cover revocation, token replacement, delayed credential responses and real issuance/persistence. The test uses the existing database-worker lane because the real issuer requires the main-thread host broker.

Evidence

Final head: da15bdd95eadbe7a68cf7980c74f102bb2d0c6b6. Its exact source tree, 834abc290ac0c775e401cc7c72e21c3b6ba8b15c, matches the source verified and checked on Blacksmith Testbox tbx_01m3k3nc9xz8ymp4gktqbdctkx. The earlier runtime/build/API campaign ran on tbx_01m3jvqe5h37w3vq9bqvw7npe1; the follow-up only tightens the assertion baseline and renames one Matrix local variable.

  • pnpm test:extensions:batch telegram,matrix,feishu: 6,749 tests / 451 files passed (1,955.59 s).

  • pnpm build: passed (425.21 s).

  • pnpm plugin-sdk:api:diff --base origin/main --head HEAD: passed; no Plugin SDK API changes (250.13 s). Export registration check passed too.

  • Import-boundary tests (fs-safe, plugin extension, test-helper extension and the boundary checker) plus the extension test-plan contract passed (9.95 s).

  • Mini App original-owner negative control: five expected refusal failures and one successful unchanged-owner control. Candidate: 19/19 route tests passed, including real bootstrap issuance with zero persisted tokens after revocation versus one for unchanged authority (16.16 s).

  • Audit original-owner negative control: 4/4 expected disposal failures. Candidate: 4/4 passed, checking exact GET bytes and real dispatcher lifetime (15.01 s).

  • Other changed-file focused runs passed: Feishu comment dispatcher 18 tests / 35.58 s; comment handler 9 / 19.31 s; Telegram audit 5 / 1.79 s; native-quote drafts 10 / 23.31 s; draft streams 56 / 20.07 s. Commands used pnpm test <file> --maxWorkers=1; cold worker preparation is included.

  • Final node scripts/check-changed.mjs: passed, including extension/test type checks, all three dead-export scans and lint. The first CI failure was the required shrink of four assertion-baseline entries; those eight removed assertions are now reflected exactly. A Matrix local-variable shadow found by lint was renamed. No baseline increase, suppression, retry or weakened assertion was used.

  • Telegram raw HTTP parity: 20 requests across 8 cases were BYTE-IDENTICAL between the baseline and candidate. The existing registered model callback fixture covers authorization, persistence, answer and edit; three added task-only cells exercise direct acknowledgement, successful eager acknowledgement, and a real HTTP 400 followed by the fallback acknowledgement. Registered rich/HTML/plain presentations and explicitly flushed HTML/rich draft quotes cover accepted and rejected quotes. Comparison preserves exact ordered method, relative path, content-type and body bytes, with no body/field normalization. Ordered trace SHA-256: e1c59d1623f2ed0099de92d742148b2ff4bdf6aab7d946149a8e9da95d1ac95f. This is the lane's explicitly allowed byte-parity proof, not a Telegram Test Server claim; question Gateway resolution is not claimed by the no-message acknowledgement cells. All temporary fixtures and production swaps were restored byte-for-byte.

All lane-owned Testboxes are stopped. Independent Codex review completed; the final baseline/rename delta is scoped-clean. Earlier alias/acknowledgement/parser findings were rejected against complete owner source and call sites. No accepted finding remains. No storage schema, serialized state, configuration key or manifest changed; the shared test-path list only selects the existing host-broker fixture lane.

Hosted CI and maintainer landing exception

The final-head CI run 36379727824 failed only checks-node-compact-large-37 and its downstream CI gate. The Bun core-unit-fast-2 partition reports two assertions in src/plugins/runtime.retention.test.ts: Completed retirement retained a successor registry and Live recovery retained its retired instance. Fail-fast cancelled remaining jobs; 48 jobs succeeded, including the changed extension configuration lanes. This is not an all-green hosted-CI claim.

Both exact assertions also fail in the same Bun partition on unrelated PR #149275 at its current head b1a73f4de56a58726f5a54b5bbf50d0733664c91: CI run 36379467856, job 108793705564. Its log shows the same registry and recovery-source child modes. These children use empty registries and a synthetic temporary plugin; they never execute this PR's Telegram, Matrix or Feishu files. The only changed test routing entry selects the Mini App database-worker lane and does not select this core fixture. The full channel Testbox proof above passed.

Peter explicitly directed exact-head admin squash landing when the only hosted failures demonstrably pre-exist in unrelated current CI, followed by repair of any unowned failure. That exception applies to head da15bdd95eadbe7a68cf7980c74f102bb2d0c6b6. The plugin fixture repair subsequently landed independently in #160200. Its identical collection placement passed this lane's 20 standalone retention runs and both real-leak negative controls. A separate OOM-fixture lifetime defect found during the shard replays was repaired and merged in #160276; no duplicate plugin-retention patch was published.

The final-head ClawSweeper review found no actionable code or security defect. Its remaining Test Server request is declined under Peter's explicit lane instruction permitting behavior-identical changes proved by byte comparisons; the exact 20-request comparison is documented above. It does not establish live Test Server behavior. Its generated configuration/data-model prompts cite unknown-truncated-pull-files; inspection of the complete diff confirms no schema, persisted-format, manifest or configuration-key change.

Blacksmith Testbox lease results and cleanup
Lease Result Final state
tbx_01m3jkmm7624bngfvsss189b0h Source sync interrupted before tests; no test result claimed. Stop confirmed already stopped.
tbx_01m3jpfy65ypf3xzp1memba4dd Focused tests and original-owner negative controls; identified the Mini App broker-fixture routing issue corrected before full proof. Stopped.
tbx_01m3jvqe5h37w3vq9bqvw7npe1 Three-plugin batch, build, SDK API/export and import-boundary proof passed; baseline/lint findings corrected in the final follow-up. Stop confirmed already stopped.
tbx_01m3k3nc9xz8ymp4gktqbdctkx Final changed checks and exact Telegram HTTP byte comparison passed. Stopped.

The separate inherited-CI repair leases and commands are recorded in the follow-up linked above.

Complete production-file coverage

Lane l134 fourth-pass coverage

Base: 47d9700dcf8. Recent merged PR subjects and name-only diffs since September 20 were read before editing. Untouched production files over 150 lines were inspected first. This table covers all 204 production TypeScript files over 200 lines at the starting base; tests and test support are excluded.

Base lines Production file Coverage and outcome
1890 extensions/feishu/src/channel.ts READ — Retained distinct authorization, action-validation, and response contracts; merging them would obscure request ordering and transport differences.
1842 extensions/feishu/src/bot.ts READ — Retained live authorization refresh, broadcast adoption, and thread-context flows; the existing dispatcher factory already owns their safe shared portion.
1643 extensions/feishu/src/reply-dispatcher.ts READ — Retained generation-scoped settlement, accepted-delivery receipts, and distinct streaming fallback behavior.
1228 extensions/feishu/src/monitor.comment.ts READ — Removed duplicated private return shape and a one-use URL wrapper; prompt bytes, pagination, retries, and request construction remain unchanged.
1127 extensions/telegram/src/channel.ts READ — Removed one-use route projection and visibility wrappers; preserved startup, token/cache lifecycle, thread scope and routing contracts.
1105 extensions/feishu/src/docx.ts READ — Unified direct and batch descendant API submission through insertDocxDescendants, preserving their distinct child normalization and all request fields.
948 extensions/telegram/src/action-runtime.ts READ — Replaced duplicate non-array record coercion in delivery pin parsing with the canonical SDK helper; action ordering and payload fields unchanged.
935 extensions/telegram/src/bot-message-context.session.ts READ — Reply ancestry, buffered forward visibility, transcript watermark and session persistence encode distinct contracts; no safe additional restructuring without reply-context proof.
921 extensions/telegram/src/message-cache.ts READ — Inlined the sole global-map forwarding wrapper with the same symbol and explicit types; retained shared cache-key codecs and bounded/retained state contracts.
919 extensions/telegram/src/bot/delivery.replies.ts READ — Removed unused runtime field from private pin-helper input; pin decision and request body unchanged.
908 extensions/feishu/src/doctor.ts READ — Retained migration inspection, bounded transcript reads, backup-before-delete, and repair recovery; apparent duplication has persisted-state contracts.
893 extensions/telegram/src/draft-stream.ts READ — Generation fences, retained-page ownership, account flood waits, deferred deletion, and observation settlement are distinct live contracts; no safe large simplification.
877 extensions/feishu/src/media.ts READ — Reused canonical FeishuSendResult and shared local media/recipient parameter contracts; byte sniffing, encoding, limits, fallback, and authority checks remain unchanged.
822 extensions/feishu/src/outbound.ts READ — Retained differing text/media/TTS ordering, reply consumption, and partial-delivery accounting.
815 extensions/telegram/src/fetch.ts READ — Preserve: dispatcher fallback health, caller-owned transport compatibility, proxy no-send classification, and request-authority guards have distinct invariants; recent transport sweeps already consolidated attempts. Public resolveTelegramFetch is a named shipped runtime export.
746 extensions/matrix/src/matrix/sdk/verification-manager.ts READ — Explicit SAS/QR state transitions, request identity, retention, and auto-confirm timing are protected E2EE/device behavior; no safe structural removal found.
725 extensions/matrix/src/matrix/sdk/client-base.ts READ — Lifecycle, startup currentness, Rust initialization, recovery state, and final persistence order are protected contracts; retain owners and lazy initialization.
725 extensions/telegram/src/bot-message-dispatch-delivery.ts READ — Accepted draft, durable send, transcript projection and partial-delivery custody have distinct boundaries; preserve existing canonical delivery owner.
719 extensions/telegram/src/bot-native-command-menu.ts READ — Reused exact SDK record/string reader while preserving the property-existence guard; removed unreachable retry-count fallback for positive array lengths.
718 extensions/feishu/src/monitor.transport.ts READ — Retained signature/rate-limit guards and transport state machine; generic abort substitution would alter same-tick ordering.
716 extensions/feishu/src/drive.ts READ — Retained root/metadata permission fallback and whole-comment/reply compatibility, which have named API contracts and distinct wire payloads.
708 extensions/matrix/src/matrix/thread-bindings.ts READ — Binding generation, delayed persistence, legacy import and ordered farewell flow retain separate lifecycle contracts; protected stored-state and timeout policy prevent speculative consolidation.
708 extensions/telegram/src/bot-message-dispatch-reply.ts READ — Buffered final settlement, progress adoption, reasoning and media acceptance require different state transitions; no safe further owner deletion.
705 extensions/telegram/src/bot-handlers.callback-router.ts READ — Removed discarded route-result projection, redundant presence check, unread username input and unreachable acknowledgement finalizer; handler and acknowledgement order unchanged.
690 extensions/matrix/src/matrix/client/config.ts READ — Auth candidate precedence, secret resolution, identity lookup and current-token backfill retain distinct currentness and cleanup boundaries; auth/device contracts unchanged.
683 extensions/telegram/src/thread-bindings.ts READ — Shared five identical session-binding projections through one closure carrying unchanged lifecycle defaults; persistence, authority and sync compatibility paths retained.
675 extensions/matrix/src/onboarding.ts READ — centralize six identical text-prompt normalization paths inside the existing configure owner; preserve prompt validation, order, credentials and patches.
673 extensions/feishu/src/streaming-card.ts READ — Merged overlapping startup option types and removed startsWith checks already covered by includes.
669 extensions/telegram/src/rich-blocks.ts READ — Derived style membership from the existing rank table and inlined sole regex/grid forwarding wrappers; parser order and output expressions unchanged.
665 extensions/telegram/src/webhook.ts READ — Preserve: old-host listener adapter has a named 2026.9.6 contract, auth ordering and durable acknowledgement differ from lifecycle cleanup; no safe structural deletion remains under this lane's transport restrictions.
661 extensions/feishu/src/send.ts READ — Derived thread-history message fields from canonical FeishuMessageInfo; retained transport fallback and pagination semantics.
660 extensions/matrix/src/cli-shared.ts READ — reuse existing SAS renderer and replace a character-filter loop with equivalent Unicode control/direction class replacement; preserve the Matrix-specific ANSI parser because SDK terminal sanitization escapes newlines instead of removing them.
660 extensions/telegram/src/bot-handlers.callback-router-controls.ts READ — no additional substantial sound reduction: authorization, terminal receipts, multi-select values, and replay retries encode distinct contracts; small async wrappers adapt result types.
652 extensions/telegram/src/bot-message-context.ts READ — Group/topic authorization and reaction timing are distinct; local reaction interface is intentionally narrower/looser than SDK controller and is not an identical type replacement.
648 extensions/telegram/src/lane-delivery-text-deliverer.ts READ — Preview acceptance, media continuation, finalization, and prompt-context projection have different partial-failure boundaries; collapsing them would hide state ownership.
645 extensions/telegram/src/doctor.ts READ — Warning order, secret resolution, username repair and shipped-host webhook fallback are intentional. No safe structural removal found.
642 extensions/telegram/src/format.ts READ — HTML promotion, role-header protection, and source-safe chunking intentionally differ from native-rich formatting; exported chunk adapters remain exposed in api.ts.
640 extensions/telegram/src/bot/helpers.ts READ — resolveTelegramReplyId only forwards to normalizeTelegramReplyToMessageId; preserve public name through a direct re-export rather than an extra body. Forum-cache, group/DM authorization, and reply-context flows have separate behavior and remain untouched.
639 extensions/matrix/src/matrix/sdk.ts READ — Removed unused client argument from membership emitter. Recovery, backup, device deletion and cross-signing remain protected crypto/device contracts.
635 extensions/matrix/src/matrix/client/shared.ts READ — Shared generation admission, monitor retirement and transient drains are already one lifecycle owner; preserve settlement and poisoned-state ordering.
634 extensions/matrix/src/matrix/monitor/handler.ts READ — Reused the canonical ingress-access parameter type; removed the duplicate shape and its now-unneeded type imports. Preserved ingress serialization, replay-claim adoption and final delivery ordering.
623 extensions/matrix/src/channel.ts READ — consume one lightweight shared Matrix presentation-capability declaration; remaining runtime delegation, target matching and account policy functions own distinct contracts.
621 extensions/matrix/src/matrix/format.ts READ — Markdown mentions, escaped tokens, spoiler crossing and metadata fallback are distinct wire-format obligations; no safe shared-parser replacement found.
614 extensions/telegram/src/polling-session.ts READ — Preserve: worker acknowledgement, spool admission, offset catch-up, graceful settlement, and conflict/stall recovery have separate ownership and cancellation requirements.
609 extensions/telegram/src/send-message.ts READ — Prepared sender already owns shared physical sends; remaining album/media/text bookkeeping has distinct receipt and projection contracts.
606 extensions/matrix/src/tool-actions.ts READ — remove speculative generic string/alias parser in favor of existing SDK readStringParam; specialize the sole poll-index array reader; use SDK timestamp conversion; share identical pin/unpin result handling.
605 extensions/matrix/src/matrix/monitor/verification-events.ts READ — Remaining logic owns strict-DM authorization, verification flow matching and SAS notices; crypto/device contracts were kept unchanged.
602 extensions/telegram/src/bot-message-dispatch-draft.ts READ — Called canonical chunking owner with identical arguments and projected rich markdown from canonical plan; retired both private forwarding wrappers.
595 extensions/matrix/src/matrix/send.ts READ — Media/text/poll/edit sends preserve different receipts, relation and idempotency contracts; current helpers already own shared content construction.
592 extensions/feishu/src/bitable.ts READ — Prior pass already combined registrations and record actions; retained best-effort placeholder cleanup and schema/API-specific result contracts.
592 extensions/telegram/src/bot-handlers.inbound-authorization.ts READ — Removed unused private model-callback username input only; authorization decisions remain with their existing owner.
589 extensions/telegram/src/bot-handlers.message-pipeline.ts READ — Removed result alias and forwarding finalizer callback; durable settlement decisions and argument values unchanged.
588 extensions/feishu/src/monitor.account.ts READ — Normalized the nested operator identity record once and removed the repeated field-reader wrapper.
581 extensions/telegram/src/bot-handlers.message-context.ts READ — cache projection, legacy transcript dedupe and session/model resolution retain distinct responsibilities; no additional sound substantive reduction found.
578 extensions/matrix/src/approval-handler.runtime.ts READ — retained: distinct pending/resolved metadata contracts, single-message fallback, receipt anchors and expiry cleanup cannot be collapsed without changing payload or authority semantics. SDK reaction rendering has different text and metadata.
572 extensions/matrix/src/matrix/crypto-state-store.ts READ — Recovery keys, IDB snapshots and shipped legacy imports have protected persistence/device contracts; retain normalization, CAS and chunk publication semantics.
571 extensions/matrix/src/matrix/actions/verification.ts READ — Self-verification, SAS/QR, recovery and diagnostics have distinct timeouts and trust transitions; protected crypto/device state remains unchanged.
568 extensions/matrix/doctor-contract-api.ts READ — Prior pass already consolidated legacy file migrations; remaining credentials/dedupe/IDB migrations have distinct shipped verification and retirement contracts.
567 extensions/telegram/src/outbound-adapter.ts READ — Adapter boundary owns canonical presentation, reaction/location routing, delivery hooks, and injected runtime resolution; no interchangeable duplicate flow.
565 extensions/matrix/src/matrix/monitor/index.ts READ — Lifecycle setup, admission and retirement are already single-owner; no sound large simplification without changing startup sequencing or auth/state ownership.
550 extensions/telegram/src/send-context.ts READ — Cached transport leases and authorization transformers are real lifecycle boundaries; retry wrappers distinguish idempotency and preserve diagnostics.
547 extensions/matrix/src/matrix/sdk/recovery-key-store.ts READ — Third pass already consolidated persistence; remaining staging, key validation, migration fallback, and ordered writes are necessary protected recovery behavior.
542 extensions/telegram/src/bot-message-dispatch.ts READ — Terminal settlement, fallback and quote selection remain distinct. Sticker vision has similar lookup logic but different optional agent argument/lazy-test surfaces, so no speculative consolidation.
535 extensions/feishu/src/presentation-card.ts READ — Retained native/generated-card distinctions, fallback markers, escaping, and envelope limits.
528 extensions/telegram/src/rich-blocks-html-map.ts READ — Table/list/figure/media island validators preserve different authored-content loss guards; generic descriptor conversion would obscure those contracts.
527 extensions/telegram/src/bot-handlers.inbound-media.ts READ — Removed unused private isForum input only; media parsing, album caption order and authorization decisions unchanged.
518 extensions/matrix/src/matrix/client/storage.ts READ — Token-root selection, device identity compatibility, legacy migration and CAS metadata updates preserve stored-state ownership; no safe migration deletion.
515 extensions/feishu/src/client.ts READ — Retained SDK multipart, proxy, redirect, and live-authority adaptations; removing them would alter request behavior or accepted-send recovery.
515 extensions/telegram/src/telegram-ingress-drain.ts READ — Preserve: lane reconciliation explicitly supports signed releases; participant settlement and frame disposition must remain separate. Shared core monitor already owns the claim pump.
513 extensions/telegram/src/bot-message.ts READ — Durable adoption, deferred replay and irrevocable-adoption recovery preserve separate failure boundaries; runtime injection selection remains explicit.
508 extensions/matrix/src/matrix/monitor/events.ts READ — Event handlers have distinct verification, decrypt-health, membership and join-introduction responsibilities; preserved event parsing and crypto diagnostics.
507 extensions/matrix/src/matrix/sdk/client-core.ts READ — SDK adapter owns explicit wire projections, transaction identity, encryption readiness, fallback media endpoint, and hydrated event reads; simple forwards preserve the adapter contract.
506 extensions/feishu/src/feishu-ingress.ts READ — Retained serialized adoption/abandonment and logical-claim settlement; repeated guards belong to separate durable recovery phases.
506 extensions/telegram/src/bot-handlers.event-bindings.ts READ — handlers materially differ in authorization, replay and error handling; generic consolidation would hide distinct contracts.
505 extensions/matrix/src/matrix/monitor/handler-ingress-content.ts READ — Ordered media preflight and reserved history slots already converge on canonical ingress owners; no redundant large path remains without changing mention/admission behavior.
503 extensions/matrix/src/matrix/sdk/decrypt-bridge.ts READ — Retry/dedupe/exhaustion/drain state has distinct lifecycle obligations; no consolidation without touching protected E2EE or timing behavior.
501 extensions/feishu/src/monitor.message-handler.ts READ — Combined duplicated nondurable rejection/release/log branches while preserving durable result handling.
499 extensions/telegram/src/bot-message-context.body.ts READ — Native command admission, media transcription and mention-source precedence are separate producer contracts; preserve exact inbound parsing.
491 extensions/matrix/src/matrix/monitor/config.ts READ — Startup and live name resolution retain different fail-closed/cache contracts; previous passes already share resolution and canonicalization owners.
487 extensions/matrix/src/matrix/sdk/transport.ts READ — Request authority, redirect custody, media/JSON limits, error classification, and response buffering have deliberate differences; do not alter protected auth/wire/rate behavior.
480 extensions/telegram/src/bot/body-helpers.ts READ — Rich inbound projection differs from outbound fallback; fixed ASCII scan has no duplicate owner, and regex conversion would be representational churn rather than a structural simplification.
475 extensions/matrix/src/matrix/delivery-plan.ts READ — Stored plan topology, endpoint identity, idempotency and cleanup protect ambiguous delivery; no redundant guard removable under hard persistence/wire contracts.
472 extensions/matrix/src/matrix/monitor/inbound-dedupe-migration.ts READ — SQLite and JSON legacy readers protect explicitly shipped upgrade sources, capacity and retirement; no safe path deletion under the persisted-state contract.
472 extensions/telegram/src/bot-native-command-dispatch.ts READ — Removed duplicate route/targetSessionKey projections already supplied by auth result; removed unconsumed private turnSettings/mediaLocalRoots result fields while retaining delivery locals.
466 extensions/telegram/src/account-throttler.ts READ — Flood ownership, replaceable requests, legacy abort bridging and scheduling are required hard rate/transport contracts.
464 extensions/feishu/src/card-action.ts READ — Reused handler parameter/context ownership and consolidated invalid-action notices without changing callback envelopes.
462 extensions/telegram/src/bot-native-command-menu-state.ts READ — Exhaustive grammY language-code record and durable locale normalization are named schema/type contracts; queue and intent-before-publish ordering retained.
460 extensions/feishu/src/setup-surface.ts READ — Retained credential inspection/manual/QR differences, account inheritance, and translated prompts; no safe structural reduction after prior pass.
430 extensions/telegram/src/bot/delivery.resolve-media.ts READ — Downloader metadata priority differs from resolveTelegramPrimaryMedia for documents versus audio/voice; unifying would change behavior. Trusted local roots, mapped container paths, retries, and source-fetch policy are concrete contracts; no safe large cleanup.
429 extensions/telegram/src/rich-block-model.ts READ — Native-rich authored subset, measurements, and readable fallback intentionally use different traversal outcomes; no duplicate writer or dead branch established.
422 extensions/matrix/src/cli-verification.ts READ — retained: third pass already shares summary-command registration; SAS and interactive self verification have different prompts/output/error boundaries.
418 extensions/feishu/src/config-schema.ts READ — Retained precise schema keys, defaults, validation issues, and legacy aliases; analogous SDK schemas have different accepted shapes.
418 extensions/telegram/src/bot-core.ts READ — middleware ordering, deferred disposition, callback acknowledgement and shutdown ownership are substantive; no sound sizeable simplification found.
417 extensions/matrix/src/matrix/poll-types.ts READ — Stable and MSC poll codecs, latest-vote selection and result visibility are observable parsing/wire contracts; keep existing canonical parsing and builders.
417 extensions/matrix/src/matrix/sdk/crypto-bootstrap.ts READ — UIA fallback, cross-signing repair, trust publication, and staged key bootstrap are protected crypto/device contracts; no safe structural change proposed.
405 extensions/telegram/src/bot-handlers.inbound-pipeline.ts READ — Removed unused downstream isForum forwarding only; event normalization remains unchanged.
401 extensions/telegram/src/interactive-fallback.ts READ — Reused canonical escapeTelegramHtml for table cells; exact character substitutions, whitespace collapse and trimming unchanged.
398 extensions/telegram/src/send-prepared.ts READ — Canonical accepted-send ledger already consolidates both send funnels; fallback generator close and observer failures preserve different acceptance states.
391 extensions/telegram/src/doctor-contract.ts READ — Legacy config removal and scope inheritance preserve shipped upgrade contracts; descriptor replacement would hide required complexity.
391 extensions/telegram/src/message-cache-codec.ts READ — Partial observations, thread provenance, hydration, media ownership and source merges are distinct persisted/event contracts.
388 extensions/feishu/src/comment-shared.ts READ — Existing request/error/parser owner already centralizes safe sharing; alternatives differ in whitespace and structured-document semantics.
383 extensions/matrix/src/matrix/sdk/idb-persistence.ts READ — Third pass already consolidated admission; IndexedDB validation, SQLite migration diagnostics, lock and strict/non-strict write paths preserve protected persistence semantics.
382 extensions/telegram/src/telegram-ingress-worker.runtime.ts READ — Preserve: initial short-poll ownership, worker-local 5xx/429 recovery, fatal 409 propagation and spool ACK ordering are distinct transport contracts.
380 extensions/matrix/src/matrix/monitor/room-history.ts READ — Per-agent watermarks, generations, reservations and retry snapshots protect independent ordering invariants; retained bounded queue and snapshot behavior.
380 extensions/telegram/src/bot-native-command-builtins.ts READ — similar model helpers differ in fallback/override behavior; synchronous store access requires broader owner migration and is outside behavior-identical cleanup.
375 extensions/feishu/src/app-registration.ts READ — Retained device registration states, domain switch ordering, timeout/abort behavior, and SSRF guarded fetch ownership.
372 extensions/matrix/src/approval-reactions.ts READ — retained: persistent target store and in-memory index serve distinct lookup versus approval-wide cleanup contracts; persistence/key/decision behavior is a hard contract.
372 extensions/matrix/src/matrix/monitor/startup-verification.ts READ — Device-aware cooldown, legacy migration and verification requests are all within the frozen crypto/device/persistence contracts.
371 extensions/telegram/src/bot-message-dispatch-progress.ts READ — Progress visibility and compaction policy differ intentionally; no interchangeable state writer.
371 extensions/telegram/src/bot-message-dispatch-turn.ts READ — Provider-message sending, queued callbacks and current turn custody are meaningful adapters; do not merge callbacks with differing return/admission semantics.
363 extensions/matrix/src/matrix/actions/messages.ts READ — Thread cursors, poll hydration and replacement projections protect distinct event/history cases; no equivalent cheaper owner exists.
362 extensions/telegram/src/bot-native-commands.ts READ — Applied canonical TelegramCommandExecutorParams type reuse, preserving identical native registration inputs.
358 extensions/telegram/src/network-errors.ts READ — Preserve: transport-safe replay differs from general recoverability; nested retry-after precedence is not equivalent to a generic graph walk.
357 extensions/telegram/src/bot-handlers.inbound-processing.ts READ — Removed unused isForum forwarding only; retained abort authorization timing and all media lifecycle branches.
356 extensions/feishu/src/thread-bindings.ts READ — Retained manager-to-SDK projection, expiry, replacement-manager fencing, and metadata inheritance.
352 extensions/matrix/src/approval-native.ts READ — retained: plugin/exec authority and suppression differ; recent approval-surface fix is not duplicated.
351 extensions/telegram/src/approval-handler.runtime.ts READ — request/view guards and terminal notification state have real behavior; base-path helper has no existing SDK seam to replace it.
349 extensions/telegram/src/bot-native-command-login.ts READ — SDK already owns provider flow; remaining code expresses Telegram delivery, current authority, session adoption and lane release.
341 extensions/matrix/src/matrix/monitor/handler-context.ts READ — Context visibility, ingress finalization and acknowledgement decisions use canonical owners already; projection fields have distinct observable meanings.
340 extensions/telegram/src/channel-actions.ts READ — Currentness checks, host-authority stripping, account union discovery and aliases remain required boundary behavior.
337 extensions/telegram/src/send-message-text.ts READ — Removed empty-object versus undefined branch from spread-only request helper; both paths contribute identical request properties.
336 extensions/matrix/src/matrix/sdk/client-verification.ts READ — Retained device-trust and backup status methods under the explicit no-crypto/device-state-change constraint; no active-path simplification outside that boundary remains.
325 extensions/matrix/src/matrix/client/sync-cache-state.ts READ — Shipped raw-sync compatibility, digest validation, generation locking and chunk publish order are protected state contracts.
322 extensions/feishu/src/policy.ts READ — Reused already typed ingress parameters at the existing resolver owner without changing policy.
322 extensions/matrix/src/matrix/monitor/handler-ingress-access.ts READ — Untouched candidate; room admission, pairing and reaction dispatch are authorization-sensitive and share reservation cleanup already. Its exported parameter type now serves the caller too.
321 extensions/telegram/src/bot-update-tracker.ts READ — Preserve: accepted IDs, completed IDs and safe persistence floor serve different acknowledgement/dedupe contracts. getState is test-only but deleting it would require a separate meaningful test migration, not mechanical cleanup.
318 extensions/feishu/src/bot-content.ts READ — Retained message-type parsing, mention substitution, and media resource behavior.
314 extensions/feishu/src/accounts.ts READ — Retained distinct inspect/strict secret resolution and named-account/default inheritance semantics.
311 extensions/matrix/src/cli-account.ts READ — retained: account publication deliberately happens after setup retires; profile/bootstrap/device results and warning semantics are distinct.
309 extensions/matrix/src/matrix/direct-management.ts READ — Replaced hand-written mapped-room normalization with SDK normalizeUniqueTrimmedStringList and typed-room dedupe with uniqueStrings; preserved first-seen ordering, trim/filter rules and mapping writes.
307 extensions/feishu/src/comment-handler.ts READ — Initial and refreshed dynamic routes now share one route constructor; authorization rechecks remain in place.
303 extensions/telegram/src/config-schema.ts READ — Fields and refinements are user config contracts; existing SDK builders already own shared shapes.
302 extensions/feishu/src/read-policy.ts READ — Preliminary, metadata-assisted, group, and direct-member gates protect distinct contracts; no sound further consolidation.
301 extensions/feishu/src/monitor.vc-meeting-invited-handler.ts READ — Retained invitation-specific cancellation and commit settlement; earlier passes removed the safe shared portion.
301 extensions/telegram/src/button-types.ts READ — Control conversion owns typed action distinctions and callback byte limits; select mapping and row separation preserve wire layout.
300 extensions/matrix/src/matrix/monitor/handler-reply-dispatcher.ts READ — Removed construction/destructuring/renaming of a temporary dispatcher object and the single-call completion wrapper. Returned the existing API directly, preserving merged receipt computation before next-block/typing transitions.
300 extensions/matrix/src/matrix/send/chunking.ts READ — Table/spoiler/underline source preservation and UTF-16 reserve accounting are specialized chunking contracts; shared SDK chunker is already used.
299 extensions/telegram/src/sendchataction-401-backoff.ts READ — 401 serial recovery and transient cooldown differ from account flood waits; shared Handler type has real production callers.
297 extensions/telegram/src/bot-handlers.inbound-buffer.ts READ — singleton and combined paths intentionally preserve different metadata and provenance; no sound substantial reduction remains.
293 extensions/telegram/src/bot-native-command-plugins.ts READ — Removed repeated null/nonobject normalization guaranteed by canonical executeRegisteredPluginCommand; kept renderability and fallback behavior.
292 extensions/matrix/src/outbound.ts READ — consume shared presentation capabilities; remaining payload/media delivery fanout retains per-part receipt, reply and unknown-send handoff fields.
291 extensions/feishu/src/docx-markdown.ts READ — Retained bounded AST reparsing and independent-reference request boundaries; splitting algorithms encode different Markdown contracts.
291 extensions/matrix/src/matrix/monitor/direct.ts READ — Explicit, strict-membership, invite and local-promotion cases have distinct admission/fallback contracts; prior cleanup already shares promotion side effects.
281 extensions/telegram/src/outbound-media.ts READ — Removed private unread caption projection only; retained caption computation and both outbound caller inputs.
280 extensions/telegram/src/probe.ts READ — Preserve: bounded transport cache owns close-on-eviction, getMe and optional webhook info have deliberately different failure semantics.
279 extensions/matrix/src/matrix/monitor/reaction-events.ts READ — Approval settlement, terminal presentation and ordinary own-message notifications have distinct authorization/lifecycle contracts; no safe shared-policy collapse.
278 extensions/feishu/src/bot-broadcast.ts READ — Retained adoption/abandonment arbitration and independently owned lane claims.
278 extensions/feishu/src/chat.ts READ — Retained preliminary metadata authorization and group/direct member checks with their distinct required order.
275 extensions/telegram/src/model-buttons.ts READ — Callback compatibility shapes remain explicitly documented and exported; page-size accessor and button builders are on api.ts, so they are not dead private exports.
274 extensions/feishu/src/post.ts READ — Retained rich-post locale resolution, inline escaping, mentions, and attachment order; parsing bytes are a hard contract.
274 extensions/telegram/src/send-special.ts READ — Poll routing registration preserves durable acceptance, channel/group capability, and finally settlement; no safe policy change under hard contracts.
273 extensions/matrix/src/cli-verification-backup.ts READ — retained: previous pass owns command runner; bootstrap, restore, reset and device verification have distinct CLI argument order, output and destructive confirmation contracts.
273 extensions/matrix/src/exec-approvals.ts READ — retained: account eligibility and request filters run at different trust boundaries; preserve auth/allowlist behavior.
273 extensions/telegram/src/account-inspect.ts READ — Derived inspection fields and credential status from canonical ResolvedTelegramAccount; no auth or secret logic changed.
271 extensions/telegram/src/conversation-route.ts READ — Preparation already unifies sync inspection and async touch; remaining paths express route ownership and binding lifetime contracts.
270 extensions/telegram/src/send-edit.ts READ — Text/caption fallback preserves different endpoints and cache observation; existing helper already owns repeated recovery.
269 extensions/telegram/src/bot/inbound-text-entities.ts READ — Entity nesting, CRLF, quote-edge splitting and code delimiter padding differ from generic Markdown helpers; replacing them would alter parse bytes.
266 extensions/matrix/src/matrix/read-policy.ts READ — Current-room, direct-operator, DM/group and named-account policies authorize different cases; preserve live authority rechecks and allowlists.
265 extensions/matrix/src/matrix/config-update.ts READ — Nullable patch/delete, secret coercion, named-account promotion and shallow room copies express distinct config contracts; no safe generic replacement without changing shape or copy depth.
264 extensions/telegram/src/history-policy.ts READ — Automatic physical windows and explicit paged history differ intentionally; checks after awaits preserve current authority.
261 extensions/feishu/src/wiki.ts READ — Retained opaque ID validation before account creation, pagination validation, and action-specific request/result fields.
260 extensions/matrix/src/matrix/client/file-sync-store.ts READ — Live SDK accumulator, freeze/discard, clean-shutdown and failed-flush lifecycle are already centralized; protected persistence behavior retained.
258 extensions/telegram/src/rich-block-split.ts READ — Block-specific budget, caption/credit placement, row-span atomicity, and media counts are essential wire semantics.
257 extensions/telegram/src/sequential-key.ts READ — Preserve: control, approval, question, poll and reaction lanes encode different privileged ordering; merging branches risks wire/event/lifecycle changes.
255 extensions/feishu/src/comment-reaction.ts READ — Removed repeated internal reaction parameter projections while preserving literal provider request construction.
254 extensions/telegram/src/status-reaction-variants.ts READ — Exact emoji selectors, candidate ordering and per-chat availability are wire policy; previous pass already centralized normalization.
253 extensions/feishu/src/docx-table-ops.ts READ — Retained adaptive widths, UTF-16/codepoint accounting, merge metadata cleanup, and operation-specific table payloads.
251 extensions/matrix/src/matrix/send/media.ts READ — AIFC fallback duration, thumbnails and encrypted upload preserve exact payload/privacy contracts; no cross-owner replacement with equal behavior found.
249 extensions/feishu/src/markdown.ts READ — Retained AST soft-break semantics and serialized envelope chunking; generic helpers would not preserve request boundaries.
249 extensions/telegram/src/send-actions.ts READ — Reaction/delete/pin/typing handlers have distinct return and failure contracts; shared preparation/API ownership already extracted.
248 extensions/feishu/src/subagent-hooks.ts READ — Retained requester disambiguation and stored-delivery precedence; no sound remaining reduction.
248 extensions/matrix/src/matrix/monitor/mentions.ts READ — Untouched candidate; exact metadata ownership, visible-label checks and punctuation rules defend distinct mention formats. Kept event/mention parsing identical.
247 extensions/matrix/src/matrix/format-spoiler-ranges.ts READ — Untouched candidate; source ranges distinguish code, links, references, autolinks, tables and underline metadata; consolidating these parsers changes rendered/wire content.
245 extensions/telegram/src/ingress.ts READ — Preserve: native command identity preparation, configured-owner authorization and ordinary ingress authorization are different boundaries; auth is a hard contract.
245 extensions/telegram/src/miniapp/routes.ts READ — Fixed stale owner-config authority by pinning post-body validated config through URL lookup, native issuer admission and response; gated registered-route and real issuer regressions added.
245 extensions/telegram/src/rich-blocks-html.ts READ — Fragment stack and renderer callbacks preserve literal unsupported content and shared source ranges; no alternate parser to retire.
244 extensions/feishu/src/interactive-message-content.ts READ — Retained precedence among template variables, nested elements, tables, localized arrays, and rich-post fallback.
244 extensions/matrix/src/matrix/deps.ts READ — Native package repair and per-platform binding filenames retain dependency/runtime contracts; no dead install fallback established.
238 extensions/matrix/src/matrix/monitor/handler-draft-controller.ts READ — Inlined the one-use draft text slice helper into its update owner; preserved generation offsets, pending boundaries and draft visibility semantics.
238 extensions/telegram/src/telegram-text-delivery.ts READ — Native-rich, plain and HTML plans intentionally differ in fallback/source metadata and acceptance boundaries; preserve authored output.
237 extensions/matrix/src/matrix/accounts.ts READ — Sync setup and async runtime account views already share prepared facts; preserve auth precedence and credential-read ownership.
236 extensions/telegram/src/bot-message-dispatch-context.ts READ — Forum recovery preserves admitted payload identity and reads only the recovered history scope; no safe removal under reply-context contract.
231 extensions/feishu/src/probe.ts READ — Shared cached error projection for timeout, provider error, missing bot identity, and thrown request errors; kept abort/success cache contracts.
228 extensions/telegram/src/send-outbound.ts READ — Existing canonical preparation/finalization owner; acceptance before projection failure must remain ordered.
226 extensions/feishu/src/native-card.ts READ — Retained sanitation differences between raw native cards and structured presentation controls.
225 extensions/telegram/src/update-offset-store.ts READ — Preserve persistence validation, token rotation and purge-before-identity-commit; optional local type-alias removal saves little and does not simplify ownership.
224 extensions/telegram/src/status-issues.ts READ — Runtime versus config findings preserve distinct grace/staleness and membership diagnostics; no safe shared projection reduces complexity.
222 extensions/matrix/src/doctor-contract.ts READ — retained: shipped legacy streaming/private-network/DM/room aliases are explicit migration contracts; no runtime compatibility restoration.
221 extensions/telegram/src/history-read.ts READ — Repeated checks revalidate live authority around awaited policy/cache work; exact account/chat/topic binding is required.
219 extensions/telegram/src/polling-lease.ts READ — Preserve: process-backed symbol registry is also accessed by runtime test support; replacing with globalThis singleton is a state-owner change, not an equivalent helper substitution.
218 extensions/feishu/src/dynamic-agent.ts READ — Retained duplicate/limit policy checks inside the config mutation owner and the legacy default-account identity contract.
218 extensions/telegram/src/bot-processing-outcome.ts READ — settlement holds, cancellation owner and inherited ALS frames encode durable-ingress invariants; no structural change warranted.
217 extensions/matrix/src/setup-config.ts READ — retained: named-account promotion, credential precedence and input validation preserve operator configuration; generic account helpers do not preserve this exact promotion policy.
217 extensions/telegram/src/topic-name-cache.ts READ — Inlined sole persistent-store opener with identical namespace/maxEntries; hydration and monotonic update/merge contracts unchanged.
216 extensions/matrix/src/matrix/draft-stream.ts READ — Existing SDK finalizable lifecycle owns queue/cleanup; Matrix flags preserve edit/fallback/live-marker outcomes and throttle behavior.
215 extensions/matrix/src/matrix/sdk/client-support.ts READ — Shared status types and diagnostic timeout owner are canonical; no structural cleanup with meaningful benefit. timedOut is unconsumed but deleting internal result shape is optional and low value.
213 extensions/matrix/src/matrix/monitor/handler-helpers.ts READ — Reused the existing send/types RelationType owner instead of a duplicate monitor constant; retained media, history and session-notice logic.
213 extensions/telegram/src/monitor.ts READ — Existing lazy loader now imports polling-session owner directly; deleted private one-line forwarding barrel after whole-tree, public artifact and history checks.
211 extensions/telegram/src/format-html.ts READ — Entity/source offset map and grapheme splitting preserve authored encodings; no safe replacement with generic escaping/HTML libraries.
205 extensions/matrix/src/config-schema.ts READ — retained: public keys, strictness and named-account streaming/secret shape remain unchanged.
204 extensions/telegram/src/progress-draft-preview.ts READ — Recent cleanup already unified row content across HTML and native blocks; remaining wire encodings and priority ordering differ intentionally.
203 extensions/feishu/src/doctor-contract.ts READ — Retained ordered legacy streaming/webhook/entry transforms and exact migration notes; these affect operator state.
201 extensions/matrix/src/matrix/sdk/types.ts READ — Runtime facade types deliberately model partial crypto implementations and raw event projections; retain protected event/state contracts and SDK type aliases.
201 extensions/telegram/src/target-writeback.ts READ — Config and cron stores have separate save/error contracts; prefix/topic-preserving rewrites are upgrade compatibility.

Reuse canonical parameter, result, presentation and lifecycle owners across the three plugins, and remove unused forwarding layers while preserving their wire and state contracts.

Also close Telegram membership-audit transports after response settlement and reject Mini App bootstrap handoffs after the validated config changes. Add disposal and authority-race regressions, including real bootstrap issuance through the existing database-worker test lane.
@clawsweeper

clawsweeper Bot commented Sep 28, 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: matrix Channel integration: matrix channel: telegram Channel integration: telegram channel: feishu Channel integration: feishu size: XL labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 1:15 AM ET / 05:15 UTC (Revision 4).

ClawSweeper review

What this changes

The branch simplifies Telegram, Matrix, and Feishu channel code, closes Telegram membership-audit transports, and rechecks Mini App owner configuration before issuing a Control UI bootstrap credential.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open. Current main still has both Telegram defects addressed by this branch, and the reviewed cleanup remains useful. The assertion-baseline follow-up is present, but Telegram-visible callback and draft behavior still lacks the Test Server proof required by the Telegram plugin guide.

Priority: P2
Reviewed head: da15bdd95eadbe7a68cf7980c74f102bb2d0c6b6

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has focused negative controls and substantial validation, but the required Telegram-visible proof remains incomplete.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 8 items Current main audit behavior: The audit obtains a Telegram fetch transport and returns its result without closing the owned transport.
Introduced audit repair: The PR retains the transport handle and closes it in finally after group responses settle; the added test checks dispatcher disposal and request bytes.
Current main Mini App behavior: Current main captures configuration before reading the request body and issues an operator bootstrap token after awaited work without passing a currentness assertion to the issuer.
Findings None None.
Security None None.

How this fits together

The three channel plugins turn platform events and OpenClaw configuration into authorized agent turns and platform replies. Telegram also checks group membership and offers a Mini App route that can issue a short-lived Control UI credential.

flowchart LR
A[Platform events and config] --> B[Channel plugins]
B --> C[Access and routing]
C --> D[Agent turns]
D --> E[Platform replies]
B --> F[Telegram membership audit]
B --> G[Mini App owner check]
G --> H[Bootstrap credential]
Loading

Before merge

  • Resolve merge risk (P1) - The local byte-level Telegram comparisons do not show callback acknowledgement and edited draft or reply behavior on Telegram's Test Server, as the scoped channel review policy requires before merging this refactor.
  • Complete next step (P2) - Add redacted Telegram Test Server evidence for callback acknowledgement and edited draft or reply behavior before merge.
  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • 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: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Prove Telegram chat parity (recommended)
    Capture a redacted Telegram Test Server callback and edited reply or draft trace against this head before merge.

Technical review

Best possible solution:

Retain the targeted transport and credential fixes, then attach a redacted Test Server trace for the changed callback and streaming paths before landing the channel cleanup.

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

Yes for the two targeted defects: current-main source shows an unclosed audit transport and a Mini App configuration snapshot retained across awaited work. The PR reports negative-control runs; I did not execute those tests locally.

Is this the best way to solve the issue?

Yes for the targeted repairs: they use the existing transport and credential-admission owners. The wider cleanup still needs the Telegram-visible proof required for the paths it touches.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 02e1ac8391f8.

Labels

Label changes:

  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.

Label justifications:

  • P2: The branch is useful channel maintenance with two bounded repairs, while its remaining merge gate is scoped behavior proof.
  • merge-risk: 🚨 message-delivery: The diff touches Telegram callback, draft, and reply paths whose visible delivery parity has not been shown on the Test Server.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The refactor touches Telegram callbacks and draft or reply presentation that a Test Server user can observe.

Evidence

What I checked:

Likely related people:

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

Rank-up moves

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

  • Show callback acknowledgement and edited draft or reply delivery in a redacted Telegram Test Server trace for this head.

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 (3 earlier review cycles)
  • reviewed 2026-09-28T02:12:22.643Z sha cc8972f :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-28T02:19:31.647Z sha cc8972f :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-28T03:34:42.153Z sha cc8972f :: blocked before merge. :: none

@steipete
steipete marked this pull request as ready for review September 28, 2026 02:13
@clawsweeper clawsweeper Bot added proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 28, 2026
Apply the exact assertion-safety reductions generated for the four cleaned channel files, and name the merged Matrix delivery result without shadowing its filter callback.
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 28, 2026
@steipete
steipete merged commit 16d6d16 into main Sep 28, 2026
136 of 199 checks passed
@steipete
steipete deleted the deslop/l134-tg-matrix-feishu4 branch September 28, 2026 06:09
MarMarLabs added a commit to MarMarLabs/openclaw that referenced this pull request Sep 28, 2026
28 upstream commits, including the fourth cleanup pass over Telegram,
Matrix and Feishu (openclaw#160032), which touches 22 Feishu files.

One conflict, in extensions/feishu/src/comment-dispatcher.ts. This branch
resolves the comment chunk limit and chunk mode from account.accountId and
adds the comment table mode right after them. openclaw#160032 shortened the typing
reaction setup below them to createCommentTypingReactionLifecycle({ ...params })
and dropped startTypingReaction from the returned object. The resolution
keeps both. The spread passes the lifecycle the same six fields the old
object did, and nothing in the tree still reads startTypingReaction.

comment-dispatcher.test.ts, send.ts and the database-workers test routing
list changed on both sides in separate places and merged cleanly. Each of
the four files carries the same branch changes over the new main as it did
over the old one, and the new upstream assertion in comment-dispatcher.test.ts
is kept. Every name this branch uses from a file openclaw#160032 changed is still
exported with the same shape.

Upstream left the generated config baseline and the channel metadata
unchanged in this range. build:docker ran in a separate detached checkout
of this commit outside the nested node_modules install, and regenerating
there changed nothing, so the counts stay at core 2464, channel 3788,
plugin 4351 with the same hashes. The three generated-file checks pass
there.

Upstream deleted two files in this range, neither a test and neither
touched by this branch.

Feishu: 106 files and 1853 tests in the extension project, 17 files and
312 tests in the database-workers project. The one test fewer than before
is the comment-handler case openclaw#160032 folded into comment-dispatcher.test.ts.
The forwarder test and the routing guards pass, 1958 tests. tsgo:core,
tsgo:extensions, tsgo:extensions:test, tsgo:test:root, the line-cap,
max-lines and assertion-safety ratchets against upstream/main, oxlint and
oxfmt on the 43 changed code files all pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…penclaw#160032)

Share canonical types and parameter/result owners, remove unused forwarding layers and callback projections, and preserve channel wire formats and policy contracts. Remove 629 net production lines across the fourth-pass sweep.

Fix Telegram membership audits leaking owned transports and Mini App bootstrap issuance retaining stale configuration across awaited work. Add disposal and real-issuer currentness regressions with original-owner negative controls.

Validation: 6,749 channel tests, build, changed checks, SDK API/export checks, import boundaries, and 20 byte-identical Telegram HTTP requests on Blacksmith Testbox. Exact-head CI has only the unrelated Bun plugin-retention failures also present in run 36379467856 on unrelated PR openclaw#149275; landed under the explicit maintainer exception, with a separate plugin-fixture repair to follow. See PR evidence for complete coverage, commands and limitations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu channel: matrix Channel integration: matrix channel: telegram Channel integration: telegram merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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