Skip to content

refactor(channels): consolidate private transport paths - #173128

Merged
steipete merged 3 commits into
mainfrom
deslop/y14-ext-channels-a-20261015-2
Oct 15, 2026
Merged

steipete merged 3 commits into
mainfrom
deslop/y14-ext-channels-a-20261015-2

Conversation

@steipete

@steipete steipete commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Consolidates private channel transport paths and removes obsolete defensive machinery in Discord, Telegram, Slack, and Matrix.

User Impact

Discord modal role selections retain their selected role IDs when Discord omits some or all resolved role metadata, rather than rendering blank values. No feature removal, configuration, protocol, or persisted-format changes. Authorization at effects, normal shutdown write settlement, conversation continuity, transport recovery, and bounded-resource protections remain. Rare recoverable projection or malformed-private-caller failures are explicitly best effort below. Standalone session memory Phase E is untouched.

Why This Change Was Made

Use the existing transport and SDK owners rather than maintaining parallel adapters: native Discord message/interaction facts, complete private Telegram dependencies, native Slack socket clients, straight-line slash registration, and shared Matrix boundary coercion/CLI execution.

Net production LOC: 532 removed in the reviewed candidate; tests, fixtures, test-support, generated files, and declarations excluded. Only exact shrink-only assertion/environment/max-lines inventory updates are included outside the four channel plugins.

Best-effort tradeoffs accepted

Evidence

Reviewed signed head: 7917254ea517771a4f53c1775562adc3cd4c2267 (conflict-only rebase of the reviewed repair).

Final exact-head CI 38739640719 is green. Complete census: 126 check runs, 69 successes, 1 neutral CodeQL, 55 skips, zero failures, and 1 cancelled superseded context/evidence run whose actual check and cleanup steps all succeeded; its replacement also succeeded. The required openclaw/ci-gate passed. No CI rerun or admin exception.

Production and test extension type graphs pass; runtime-value and static/madge cycle checks both report zero cycles. Exact inventories pass: assertions 2692 files / 6274 grandfathered assertions, max-lines 532, environment references 453/453. Formatting and whitespace checks pass; the scoped changed-check plan was inspected (not a full local check-changed pass). Final focused channel configs passed: Discord 13 files / 166 tests, database-worker 10 / 194, Telegram 3 / 30, Matrix 1 / 4, Slack 3 / 64. This includes both new native modal-role regressions and the corrected Slack presence fixture.

Fresh independent P0-P2 review of the additional 133-net-line structural delta and adjacent modal fix completed scoped-clean. The modal defect was reproduced through native interaction construction and text formatting with valid omitted/incomplete resolved-role metadata. The new regression exercises that native boundary, without a live Discord/API claim.

The reviewed 399-line first commit has passing focused Discord 17 files / 253 tests, database-worker 12 / 209, Telegram 7 / 74, and Matrix 2 / 33. Slack initially had 324 passes and one fixture-migration failure: constructing a fresh sequential mock per client resolution prevented an away-to-active transition. That fixture now preserves the same mock across polls, with assertions unchanged, and its corrected final-source replay passed. A required APIUser fixture field found by the test type graph was also corrected; the graph then passed. The first commit's independent review completed with two findings declined against actual ownership/control flow; it was not reported as a clean verdict.

Initial exact-head CI run 38735556376, attempt 1, failed on four underlying jobs plus the aggregate gate. Each failure was investigated rather than retried:

Job Cause and repair
check-lint-extensions-1 Ours: removed the unused Telegram thread-manager type import left by the deleted obsolete-shape test.
checks-node-changed-extensions-bundle-1-2 Ours: both provider client fixtures omitted required native REST options.timeout, stopping command deployment before four existing assertions. Supply the normalized 15-second fact to both fakes; assertions unchanged.
checks-node-changed-extensions-bundle-1-3 Campaign-owned stale Matrix preview assertion from the already-merged privacy packet. Initially removed only that obsolete case; main independently updated it in #173108 during this repair. Conflict-only rebase keeps main's content-free length assertion unchanged, along with full agent-context / diagnostic non-disclosure coverage. No production logging restored.
checks-fast-baseline-ratchets Ours: five CLI test mocks discarded module exports. Preserve originals with partial mocks, without suppressions or assertion changes.

The repair is test-only, leaving net production removal unchanged. Its extension test types, formatting, and mock-export ratchet pass. Fresh independent P0-P2 repair review completed scoped-clean. Focused repair replay passed Discord 2 files / 32 tests, Telegram database-worker 1 / 19, and Matrix 3 / 67 (including CLI and retained privacy boundary). Required suppression replay still reports only the documented inherited oc-path mismatch. No CI rerun was requested.

GitHub reported CONFLICTING on the repaired head, so rebased onto ad95e29cdac09d711f5fd1ff3be44a13b4055a5e. Only conflict was Matrix's retired preview test versus main's updated non-content assertion; main's version is retained byte-for-byte. Range-diff also drops an already-landed baseline shrink, with no production delta. Conflict proof passes: Matrix 2 files / 66 tests, suppression 3/3, extension test types, runtime cycles zero, static/madge cycles zero, formatting and whitespace.

Known gaps/failures: the earlier inherited oc-path suppression mismatch passes after the conflict-only rebase onto main. Local typed lint declaration preparation exceeded its existing deadline. A same-provider remote attempt failed in its local command-group supervisor before payload execution and its exact lease was confirmed completed. No remote lint proof is claimed. An earlier untouched bot.test settlement timeout remains unclassified; do not treat later passing cases as a repair. No retries, skips, timeout increases, or CI reruns were added.

Coverage and retained boundaries

Discovery started with three-day additions, then fourteen-day history, then largest-file-first passes. The task-local y14 ledger records file/line, mechanism, introducing commit/PR, human-versus-synthetic evidence, and each KEEP/removal decision.

Keep examples include human Discord session/history reports #16333/#16979, live policy report #140550, archived-thread recovery #111148, Slack CJS interop #45950/#45953, Slack external-menu startup #21715/#28702, Matrix recovery-key verification #70213/#70401, actual transport quiet windows, ambiguous-send receipts/idempotency, crypto ownership, and normal write settlement. No recent dormant feature foundation was removed. Matrix's two object-reader consolidations retain all external shape/relation/string checks, including existing array acceptance.

@clawsweeper

clawsweeper Bot commented Oct 15, 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.

@steipete
steipete marked this pull request as ready for review October 15, 2026 12:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T13:09:11.335867Z 7917254 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: matrix Channel integration: matrix channel: slack Channel integration: slack channel: telegram Channel integration: telegram size: XL labels Oct 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates private transport plumbing across four channel plugins and preserves Discord modal role IDs when resolved names are missing.

Example: A Discord modal selects roles 111 and 222, but resolved metadata names only role 111 as Maintainers.

  • Before: The submitted Roles field renders Maintainers with a blank second value.
  • After: The submitted Roles field renders Maintainers, 222.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, source-supported consolidation with meaningful native-boundary coverage, one verified fixture defect, and an unclassified lint result.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its supplied evidence exercises native Discord modal construction and formatting plus focused transport suites, without claiming live-channel execution.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Duplicated private channel plumbing increases maintenance risk, and Discord modal submissions can lose selected role IDs when role names are unavailable.
Reason: The maintainer-authored direction and explicit accepted tradeoffs agree with repository ownership and simplicity policy; the modal correction has a concrete native-input case.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored PR open: the consolidation is justified, but an incomplete Discord provider fixture causes a verified CI failure.

Priority: P2
Reviewed head: 55d98a9d327ae112921d23da8dd8119a40a10d32

Before merge

  • Update the provider fixture for the required REST timeout (P2) - The native RequestClient guarantees options.timeout, but the client returned by providerTesting.setCreateClient in extensions/discord/src/monitor/provider.test.ts still supplies only REST methods. This new access throws before deployCommands runs, breaking the command-deployment assertions. Exact-head CI records this exception and four failing provider cases. Add options: { timeout: 15_000 } to that fixture, as this PR already does for provider.deploy.test.ts, while preserving the existing assertions.

Findings

  • [P2] Update the provider fixture for the required REST timeout — extensions/discord/src/monitor/provider.deploy.ts:116

Tests

  • Missing end-to-end proof: The supplied native modal regression exercises construction and formatting in process; no real Discord modal submission is claimed.
Agent review details

How this fits together

Channel plugins translate native events into shared SDK routing, session, and delivery operations, then send replies through their transport clients.

flowchart LR
A[Channel events] --> B[Native transport clients]
B --> C[Plugin handlers]
C --> D[Shared SDK owners]
D --> E[Agent and session processing]
E --> F[Channel replies]
Loading

Technical review

Best possible solution:

Keep the consolidation and modal-role fix, and complete the Discord provider fixture migration to the native REST contract.

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

Source establishes the missing-role-name rendering defect on fetched main, and exact-head CI independently records the introduced provider-fixture failure; no target code was executed during this review.

Is this the best way to solve the issue?

The existing native transport and SDK owners support the consolidation, and the modal fallback fixes the observed empty-name case without adding configuration or competing policy.

Full review comments:

  • [P2] Update the provider fixture for the required REST timeout — extensions/discord/src/monitor/provider.deploy.ts:116
    The native RequestClient guarantees options.timeout, but the client returned by providerTesting.setCreateClient in extensions/discord/src/monitor/provider.test.ts still supplies only REST methods. This new access throws before deployCommands runs, breaking the command-deployment assertions. Exact-head CI records this exception and four failing provider cases. Add options: { timeout: 15_000 } to that fixture, as this PR already does for provider.deploy.test.ts, while preserving the existing assertions.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.92

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Discord presence admission and bookkeeping changes intended behavior with a stated reason (f59a035: Presence arrivals needed bounded, durable greeting admission; later live-policy work addressed stale authorization during active Control UI turns.)
  • Discord startup socket drainage changes intended behavior with a stated reason (4de1606: Startup restart waited for old socket closure; this PR explicitly accepts overlapping bounded close under the current native Gateway owner.)
  • Telegram partial private dependency seams changes intended behavior with a stated reason (5915d7c: Partial runtime overrides supported test import-cost isolation; production already supplies complete defaults, and this PR migrates private fixtures.)
  • Telegram rich-text delivery keeps the original intent (2cf7251: Centralize text planning and degradation while preserving caller transport lifecycles; the consolidation continues using that shared owner.)
  • Slack native reconnect keeps the original intent (1d9530c: Enable SDK-native reconnect after pong timeouts and observe failed starts; the PR retains recovery and shutdown fencing while removing private shape probes.)
  • Matrix durable delivery plan keeps the original intent (07b7d64: Reconcile ambiguous sends through stable native transaction IDs; fresh decoding, identity validation, persistence, and idempotency remain.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test extensions/discord/src/monitor/provider.test.ts extensions/discord/src/monitor/provider.deploy.test.ts --maxWorkers=1
  • node scripts/run-oxlint.mjs --tsconfig extensions/tsconfig.json extensions/discord/src/monitor/provider.test.ts
  • pnpm check:changed
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f59a035 adds extensions/discord/src/monitor/listeners.ts:107 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f59a0352b31c; files: extensions/discord/src/monitor/listeners.ts)
  • brokemac79: Raw commit 1d9530c adds extensions/slack/src/monitor/provider-support.ts:79 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 1d9530cc4b05; files: extensions/slack/src/monitor/provider-support.ts)
  • Vincent Koc: Raw commit 1aec8af adds extensions/matrix/src/cli-direct.ts:129 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 1aec8afb98a0; files: extensions/matrix/src/cli-direct.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Labels

Label changes:

  • add P2: A useful channel refactor and limited modal-rendering fix need a focused fixture repair; no urgent production outage is established.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: A useful channel refactor and limited modal-rendering fix need a focused fixture repair; no urgent production outage is established.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 15, 2026, 8:51 AM ET / 12:51 UTC.

@steipete
steipete force-pushed the deslop/y14-ext-channels-a-20261015-2 branch from a9b0221 to 7917254 Compare October 15, 2026 13:04
@steipete
steipete enabled auto-merge (squash) October 15, 2026 13:18
@steipete
steipete merged commit ace1908 into main Oct 15, 2026
128 of 129 checks passed
@steipete
steipete deleted the deslop/y14-ext-channels-a-20261015-2 branch October 15, 2026 13:22
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

steipete added a commit that referenced this pull request Oct 15, 2026
…3343)

## What Problem This Solves

Channel hot paths repeatedly reconstruct or validate facts their internal owner has already prepared. Several adapters also maintain parallel bookkeeping for the same delivery, preference, or pending-message state.

## User Impact

No intended user-visible feature or configuration change. Channel adapters consume prepared internal facts once; security checks, accepted delivery and ordinary restart behavior remain owned by their existing boundary. No operator action is required.

## Why This Change Was Made

- Discord uses its existing target resolver directly, carries one prepared channel/role projection, and trusts native Message and schema-validated configuration facts. Voice retains session-instance identity rather than a duplicate realtime counter; receive frames no longer get copied again after MessagePort cloning.
- Slack verifies its renderer's existing HMAC before consuming the signed typed plan, rather than rebuilding that plan. Send options and compiled message facts come from their existing owner instead of mirrored declarations and forwarding blocks.
- Matrix consumes SDK-hydrated events once, serializes owned delivery/sync facts without preliminary deep copies, and trusts binding snapshots captured inside its serialized persistence queue.
- iMessage shares accepted-send bookkeeping and content echo-cache entries. Signal tracks pending inbound entries in one map and consumes validated configuration facts. WhatsApp consumes its mandatory typed admission fact; redundant send-error log/rethrow wrappers are gone.

Authorization/effect checks, external-input parsing, FIFO, common restart durability, accepted-work settlement, cache bounds, public schemas/config keys/SDK exports and protocol shapes remain. Telegram is excluded and parked separately pending the required Test Server proof. The standalone Phase E memory backend is untouched.

## Best-effort tradeoffs accepted

- An internal consumer mutating a handed-off delivery plan, frame, speaker context, presentation array, or error snapshot can affect its other readers; inspected production consumers only read these owner-held values. Immediate serialization still detaches durable bytes, and shared borrowed cache freezes remain.
- A fake native Discord Message with divergent `channelId`, `channel_id`, or raw payload aliases no longer recovers through alternate layouts. The native constructor owns the canonical field; #173128 retired the old transport adapters. External channel payload projection still validates primitive fields.
- A fake gateway missing a required typed voice-cache method now fails instead of silently returning no roster. The native gateway contract supplies the method; absence of the gateway itself is still supported.
- Duplicate voice states supplied outside GatewayVoiceStateCache's one-state-per-user contract are not deduplicated by a second roster reconstruction. Normal roster ordering and both resource caps remain; the removed second pass came from #166974, not a cited human incident.
- A caller passing invalid numeric/config enum types directly into internal typed send/config helpers may fail rather than use a fallback. User config remains schema-validated once; numeric limits, defaults and all valid configuration choices are unchanged.
- A process clock rollback/restart can temporarily rank a future-dated model preference ahead of a new choice. Preference ordering is best effort; persisted input validation remains. #169405 and the inspected refactor history do not identify a human incident requiring the removed process-clock defenses.
- A JavaScript process at the Date representability limit no longer disables an internal short pairing cache. The existing 30-second TTL and cooldown remain; contemporary clocks behave identically.
- An unsupported foreign writer updating Matrix binding storage concurrently is not merged into an already-serialized owner's snapshot. #168485 describes an implementation hazard, not a linked human report; current snapshots are captured after earlier queued touches settle, and that ordering proof remains.
- A metadata class with inherited `toJSON` receives normal JSON serialization semantics instead of first being spread into a plain object. The metadata boundary still JSON-normalizes, detaches and strips undefined values; plain record behavior is unchanged.
- Discord request and WhatsApp send failures propagate their original error instead of an extra logging/rewrapping layer. No retry, approval, or accepted-receipt behavior is removed.

## Size

**519 net production lines removed** (638 added / 1,157 deleted), excluding tests, fixtures, support, generated files, declarations and nonproduction ratchet metadata. Signed repair head: 7abd83c.

## Evidence

- Completed initial Discord selection: 9 files, 161 tests passed.
- Completed iMessage echo-cache contracts: 1 file, 38 tests passed.
- Final focused lint-suppression contracts: 1 file, 3 tests passed.
- Matrix focused proof: 3 files, 44 tests passed. Initial Slack proof: 98 passed and one stale internal forwarding assertion failed; the assertion now checks forwarded config, while the existing real downloader contract verifies actual credential use. Corrected Slack replay: 2 files, 50 tests passed, plus lint-suppression contracts passed again (1 file, 3 tests).
- Production extension typecheck passed after correcting the Matrix caller's readonly annotation and retaining null-to-undefined conversion at Discord's raw snapshot boundary.
- Runtime import cycles: 0. Full Madge import cycles: 0. Formatting and diff whitespace passed. Only shrink-only assertion/max-lines baseline updates are included.
- Independent P2 review completed. Two findings proposed restoring shape checks in Slack's typed portable builders; both were declined after tracing raw presentation parsing in normalizeMessagePresentation/normalizeTableBlock/normalizeChartBlock and all production callers. Raw Block Kit parsing and platform semantic limits remain unchanged.
- The lint wrapper timed out during SDK boundary declaration preparation at its existing 300-second limit, before producing lint diagnostics. No timeout was raised. The older broad local focused attempts were stopped to release the checkout for corrections; unfinished shards are not reported as passes. Exact-head PR CI remains the broad proof.
- The required check-changed invocation initially found stale shrink-only baselines; those entries were pruned. Its later SQLite worker scan made no progress for over 50 minutes and was stopped; targeted types and cycle checks above finished. The committed SDK API comparison was stopped without a verdict after roughly an hour under severe host load; its helper worktrees were cleaned up. No SDK source, entrypoint metadata or dependency surface is changed. This is a local API-check gap, not a passing result.

### CI repair attribution

The original exact-head run38780915649 on b2dbcaf exposed owned fixture/options failures, not inherited main failures. The repair preserves every behavior assertion: the shared fake Discord client now supplies the required native Gateway roster contract through the real voice-state cache, including null for an unknown roster, and Slack no longer forwards positional text or an absent media-roots key as send options. Fresh independent P2 review of this two-file repair was scoped-clean; formatting and whitespace passed. Slack reply replay:29 tests passed, plus three suppression contracts. The redundant local voice build was stopped during prerequisite preparation after the current-head hosted voice/transcript jobs passed; local exit2 is not a passing replay. Current-head jobs116608971711,116608971178,116608970950,116608970910 and116608970865 passed, including the repaired native fixture and Slack reply families. Exact-head required CI gate passed in run38788900607/job116613171952 and the aggregate status passed in run38790431500. No old CI jobs were rerun and no timeout was changed.

| Exact-head failed job | Attribution / repair |
| --- | --- |
|116581625877 checks-node-compact-small-2-2|Owned shared Gateway fixture; transcript audio family.|
|116581625782 checks-node-changed-compact-large-21|Owned shared Gateway fixture; transcript lifecycle family.|
|116581625694 checks-node-changed-extensions-bundle-1-4|Owned shared Gateway fixture; voice receive/session/recording families.|
|116581625172 checks-node-changed-extensions-bundle-1-3|Owned shared Gateway fixture; realtime/consult/transcript families.|
|116581625548 checks-node-changed|Owned shared Gateway fixture; targeted voice-runtime E2E.|
|116581625674 checks-node-changed-extensions-bundle-2-1|Owned Slack send-options projection; existing strict assertion retained.|
|116599822613 openclaw/ci-gate|Aggregate rejection for the six owned suite failures above; no inherited-only exception claimed.|

An earlier PR-context failure116574789633 was repaired by the authored problem/evidence headings; its subsequent context run passed. Superseded auto-response/context cancellations are advisory, not missing suite proof. The repair head has its own completed hosted CI; prior-head green jobs are not represented as current-head evidence.
- A proposed Telegram storage-sanitizer deletion exposed undefined-field encoding failures and was fully reverted before parking. It is not part of this PR.

Local proof is isolated from operator state. Hosted CI on the exact submitted head is the broad gate. No live channel or platform claim is made.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
)

* refactor(channels): consolidate private transport owners

* refactor(channels): complete native transport consolidation

* test(channels): align transport fixtures with native contracts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…nclaw#173343)

## What Problem This Solves

Channel hot paths repeatedly reconstruct or validate facts their internal owner has already prepared. Several adapters also maintain parallel bookkeeping for the same delivery, preference, or pending-message state.

## User Impact

No intended user-visible feature or configuration change. Channel adapters consume prepared internal facts once; security checks, accepted delivery and ordinary restart behavior remain owned by their existing boundary. No operator action is required.

## Why This Change Was Made

- Discord uses its existing target resolver directly, carries one prepared channel/role projection, and trusts native Message and schema-validated configuration facts. Voice retains session-instance identity rather than a duplicate realtime counter; receive frames no longer get copied again after MessagePort cloning.
- Slack verifies its renderer's existing HMAC before consuming the signed typed plan, rather than rebuilding that plan. Send options and compiled message facts come from their existing owner instead of mirrored declarations and forwarding blocks.
- Matrix consumes SDK-hydrated events once, serializes owned delivery/sync facts without preliminary deep copies, and trusts binding snapshots captured inside its serialized persistence queue.
- iMessage shares accepted-send bookkeeping and content echo-cache entries. Signal tracks pending inbound entries in one map and consumes validated configuration facts. WhatsApp consumes its mandatory typed admission fact; redundant send-error log/rethrow wrappers are gone.

Authorization/effect checks, external-input parsing, FIFO, common restart durability, accepted-work settlement, cache bounds, public schemas/config keys/SDK exports and protocol shapes remain. Telegram is excluded and parked separately pending the required Test Server proof. The standalone Phase E memory backend is untouched.

## Best-effort tradeoffs accepted

- An internal consumer mutating a handed-off delivery plan, frame, speaker context, presentation array, or error snapshot can affect its other readers; inspected production consumers only read these owner-held values. Immediate serialization still detaches durable bytes, and shared borrowed cache freezes remain.
- A fake native Discord Message with divergent `channelId`, `channel_id`, or raw payload aliases no longer recovers through alternate layouts. The native constructor owns the canonical field; openclaw#173128 retired the old transport adapters. External channel payload projection still validates primitive fields.
- A fake gateway missing a required typed voice-cache method now fails instead of silently returning no roster. The native gateway contract supplies the method; absence of the gateway itself is still supported.
- Duplicate voice states supplied outside GatewayVoiceStateCache's one-state-per-user contract are not deduplicated by a second roster reconstruction. Normal roster ordering and both resource caps remain; the removed second pass came from openclaw#166974, not a cited human incident.
- A caller passing invalid numeric/config enum types directly into internal typed send/config helpers may fail rather than use a fallback. User config remains schema-validated once; numeric limits, defaults and all valid configuration choices are unchanged.
- A process clock rollback/restart can temporarily rank a future-dated model preference ahead of a new choice. Preference ordering is best effort; persisted input validation remains. openclaw#169405 and the inspected refactor history do not identify a human incident requiring the removed process-clock defenses.
- A JavaScript process at the Date representability limit no longer disables an internal short pairing cache. The existing 30-second TTL and cooldown remain; contemporary clocks behave identically.
- An unsupported foreign writer updating Matrix binding storage concurrently is not merged into an already-serialized owner's snapshot. openclaw#168485 describes an implementation hazard, not a linked human report; current snapshots are captured after earlier queued touches settle, and that ordering proof remains.
- A metadata class with inherited `toJSON` receives normal JSON serialization semantics instead of first being spread into a plain object. The metadata boundary still JSON-normalizes, detaches and strips undefined values; plain record behavior is unchanged.
- Discord request and WhatsApp send failures propagate their original error instead of an extra logging/rewrapping layer. No retry, approval, or accepted-receipt behavior is removed.

## Size

**519 net production lines removed** (638 added / 1,157 deleted), excluding tests, fixtures, support, generated files, declarations and nonproduction ratchet metadata. Signed repair head: 7abd83c.

## Evidence

- Completed initial Discord selection: 9 files, 161 tests passed.
- Completed iMessage echo-cache contracts: 1 file, 38 tests passed.
- Final focused lint-suppression contracts: 1 file, 3 tests passed.
- Matrix focused proof: 3 files, 44 tests passed. Initial Slack proof: 98 passed and one stale internal forwarding assertion failed; the assertion now checks forwarded config, while the existing real downloader contract verifies actual credential use. Corrected Slack replay: 2 files, 50 tests passed, plus lint-suppression contracts passed again (1 file, 3 tests).
- Production extension typecheck passed after correcting the Matrix caller's readonly annotation and retaining null-to-undefined conversion at Discord's raw snapshot boundary.
- Runtime import cycles: 0. Full Madge import cycles: 0. Formatting and diff whitespace passed. Only shrink-only assertion/max-lines baseline updates are included.
- Independent P2 review completed. Two findings proposed restoring shape checks in Slack's typed portable builders; both were declined after tracing raw presentation parsing in normalizeMessagePresentation/normalizeTableBlock/normalizeChartBlock and all production callers. Raw Block Kit parsing and platform semantic limits remain unchanged.
- The lint wrapper timed out during SDK boundary declaration preparation at its existing 300-second limit, before producing lint diagnostics. No timeout was raised. The older broad local focused attempts were stopped to release the checkout for corrections; unfinished shards are not reported as passes. Exact-head PR CI remains the broad proof.
- The required check-changed invocation initially found stale shrink-only baselines; those entries were pruned. Its later SQLite worker scan made no progress for over 50 minutes and was stopped; targeted types and cycle checks above finished. The committed SDK API comparison was stopped without a verdict after roughly an hour under severe host load; its helper worktrees were cleaned up. No SDK source, entrypoint metadata or dependency surface is changed. This is a local API-check gap, not a passing result.

### CI repair attribution

The original exact-head run38780915649 on b2dbcaf exposed owned fixture/options failures, not inherited main failures. The repair preserves every behavior assertion: the shared fake Discord client now supplies the required native Gateway roster contract through the real voice-state cache, including null for an unknown roster, and Slack no longer forwards positional text or an absent media-roots key as send options. Fresh independent P2 review of this two-file repair was scoped-clean; formatting and whitespace passed. Slack reply replay:29 tests passed, plus three suppression contracts. The redundant local voice build was stopped during prerequisite preparation after the current-head hosted voice/transcript jobs passed; local exit2 is not a passing replay. Current-head jobs116608971711,116608971178,116608970950,116608970910 and116608970865 passed, including the repaired native fixture and Slack reply families. Exact-head required CI gate passed in run38788900607/job116613171952 and the aggregate status passed in run38790431500. No old CI jobs were rerun and no timeout was changed.

| Exact-head failed job | Attribution / repair |
| --- | --- |
|116581625877 checks-node-compact-small-2-2|Owned shared Gateway fixture; transcript audio family.|
|116581625782 checks-node-changed-compact-large-21|Owned shared Gateway fixture; transcript lifecycle family.|
|116581625694 checks-node-changed-extensions-bundle-1-4|Owned shared Gateway fixture; voice receive/session/recording families.|
|116581625172 checks-node-changed-extensions-bundle-1-3|Owned shared Gateway fixture; realtime/consult/transcript families.|
|116581625548 checks-node-changed|Owned shared Gateway fixture; targeted voice-runtime E2E.|
|116581625674 checks-node-changed-extensions-bundle-2-1|Owned Slack send-options projection; existing strict assertion retained.|
|116599822613 openclaw/ci-gate|Aggregate rejection for the six owned suite failures above; no inherited-only exception claimed.|

An earlier PR-context failure116574789633 was repaired by the authored problem/evidence headings; its subsequent context run passed. Superseded auto-response/context cancellations are advisory, not missing suite proof. The repair head has its own completed hosted CI; prior-head green jobs are not represented as current-head evidence.
- A proposed Telegram storage-sanitizer deletion exposed undefined-field encoding failures and was fully reverted before parking. It is not part of this PR.

Local proof is isolated from operator state. Hosted CI on the exact submitted head is the broad gate. No live channel or platform claim is made.
HeZ2z added a commit to HeZ2z/openclaw that referenced this pull request Oct 20, 2026
Remove the adoption initializer and old-shape simulation added for the
prior review: PR openclaw#173128 deliberately requires a restart when replacing
historic source modules across registry shapes. The factory keeps its
runtimeByManager initialization, and the retained-owner refusal fix plus
its real plugin-instance proof are unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: matrix Channel integration: matrix channel: slack Channel integration: slack channel: telegram Channel integration: telegram P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant