Skip to content

refactor(channels): deslop msteams, imessage, signal, mattermost and googlechat - #156952

Merged
steipete merged 1 commit into
mainfrom
deslop/l28-channel-owners
Sep 24, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/l28-channel-owners

Conversation

@steipete

@steipete steipete commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Repeated transport flows, forwarding layers, and redundant state make the Teams, iMessage, Signal, Mattermost, and Google Chat plugins harder to maintain consistently.

User Impact

No intended behavior change. Authorization order, webhook verification, credential precedence and diagnostics, message formatting/chunking, configuration, protocol, SDK exports, and persisted formats remain unchanged.

Why This Change Was Made

This is an explicit maintainer-requested channel-maintenance deliverable: consolidate these five bundled transports, preserve their existing contracts, and remove at least 1,000 net production lines. It is the requested exception to the refactor-only contribution rule.

Keep each responsibility with its existing owner and remove the parallel implementations and private indirection around it.

  • Teams: dispatch activities directly instead of emulating an ActivityHandler registry; share Graph reaction/SharePoint request flows, guarded attachment fetching, action parameter handling, and streaming fallback settlement. Remove the remote-media branch unreachable from production callers.
  • iMessage: share outbound request translation, approval record lookup, capability probing, and echo-cache expiry; remove the redundant UUID-to-short-ID mirror and forwarding layers around recovery and dispatch. performIMessageCatchup still owns per-row failure conversion, and extractAuthoritativeRecoveryProjection still rejects missing conversation anchors.
  • Signal: translate RPC operations directly into container requests, reuse delivered-reaction registration, and remove redundant target/approval/mention projections.
  • Mattermost: share channel/user/post cache handling, slash payload decoding and account matching, media forwarding, and interaction responses; remove unused private barrel exports.
  • Google Chat: share approval-card construction, credential-file diagnostics, and Google-auth header normalization; remove monitor forwarding layers and the unused post-auth token projection.

extensions/imessage/src/monitor/conversation-repair.ts reconstructs an incoming message object from the read-only chats.list and messages.history RPCs. It does not write stored data or implement a migration/backfill. The admitted projection has the same fields and missing-field behavior, including clearing an absent destination_caller_id to null; its producer already requires a usable conversation anchor. Existing recovery cases in monitor.behavior.test.ts passed again in the final affected-owner replay. No stored-data upgrade contract changes, so no new migration is required.

The assertion-safety baseline only shrinks to match deleted assertions. Tests for retired private paths were removed or moved onto the surviving entry point; meaningful transport and lifecycle coverage remains.

Evidence

  • node scripts/check-changed.mjs --base origin/main: passed on Blacksmith, including typechecks, dead-export scans, all selected lint batches, formatting, and boundary guards.
  • pnpm test:extensions:batch msteams,imessage,signal,mattermost,googlechat: 322 files passed; 5,376 tests passed, 3 macOS-only ACL tests skipped on Linux.
  • node scripts/run-vitest.mjs <cross-shard files below>: all 10 routed Vitest shards passed (603.98 seconds including E2E runtime preparation).
  • pnpm test extensions/msteams/src/attachments/remote-media.test.ts extensions/msteams/src/monitor-handler.adaptive-card.test.ts extensions/msteams/src/monitor.conversation-allowlist.lifecycle.test.ts extensions/msteams/src/monitor.lifecycle.test.ts extensions/msteams/src/reply-stream-controller.test.ts --maxWorkers=1: 5 files / 101 tests passed; 21.54 seconds wall time.
  • pnpm build: passed on the final candidate (5m 5.4s). Its UI size report printed a non-failing Mermaid gzip notice (1,555.8 KiB versus 960 KiB); this PR changes no UI files.
  • Final affected-owner replay after lint corrections: 8 files / 407 tests passed in 59.73 seconds.
  • Codex autoreview: scoped-clean through P2. Supplied complete iMessage owner modules to resolve the initial diff-only hypotheses.

Remote proof used Blacksmith Testbox tbx_01m38g4aqb27x58rsenjwtj0sa, with source-byte verification before commands: https://github.com/openclaw/openclaw/actions/runs/35942663656

Production source only: 1,553 net lines removed (63 files, 996 insertions, 2,549 deletions). The work-order command reports:

65 files changed, 1001 insertions(+), 2573 deletions(-)
git diff --shortstat $(git merge-base origin/main HEAD) -- . ':(exclude)**/*.test.*' ':(exclude)**/test/**' ':(exclude)docs/**'
Cross-shard tests found by consumer searches
node scripts/run-vitest.mjs \
  src/agents/tools/message-tool.test.ts \
  src/auto-reply/reply/route-reply.imessage.test.ts \
  src/commands/channels.surfaces-signal-runtime-errors-channels-status-output.test.ts \
  src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.ts \
  test/imessage-reply-alias.integration.test.ts \
  test/msteams-read-target.integration.test.ts \
  test/msteams-read-authority.integration.test.ts \
  test/outbound-sanitize-text-delivery.test.ts \
  src/channels/turn/message-turn-guardrails.test.ts \
  src/channels/message-access/context-builder-callers.test.ts \
  src/channels/plugins/bundled.shape-guard.test.ts \
  test/scripts/test-projects.test.ts \
  src/channels/plugins/contracts/mattermost-read-authority.contract.test.ts \
  test/contracts/ask-user-msteams-presentation.test.ts \
  test/e2e/mattermost-send-owner.e2e.test.ts \
  test/plugins/signal-account-policy.integration.test.ts

The requested production-filtered shortstat includes test-helper and baseline bookkeeping; production-only accounting excludes both. No changelog, manifest, dependency, schema, protocol, or public SDK export changes.

Local control: the Google Chat guarded-transport suite timed out in its 180-second import hook on both the candidate and a clean checkout at the merge base. Its sibling authority suite passed all nine tests on both. The local full-tree Knip scan also reached its unchanged 600-second limit; the same gate passed on Blacksmith. The complete five-plugin batch passed on the isolated Testbox, including that transport suite; three macOS-only Signal ACL cases are skipped on Linux.

Exact-head CI is green for eb53f5ffda1bf2f1d0a4d39d46d0000d184c77e4: CI run 35949535724, attempt 2. The first attempt was explicitly deferred before preflight by Full Release Validation priority; it was restarted only after that hold cleared. No CI or test gate was bypassed. Selected extension test jobs took 692s, 182s, and 175s including runner setup and all tests in each job.

Consolidate request, dispatch, cache, approval, and delivery flows in msteams, imessage, signal, mattermost, and googlechat while preserving public contracts.
@clawsweeper

clawsweeper Bot commented Sep 24, 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 24, 2026, 12:02 AM ET / 04:02 UTC (Revision 3).

ClawSweeper review

What this changes

The branch consolidates dispatch, approval, attachment, cache, and delivery code in the bundled Teams, iMessage, Signal, Mattermost, and Google Chat plugins.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains distinct from current main. The consolidation is coherent, and review found no concrete introduced defect or unresolved merge blocker.

Priority: P3
Reviewed head: eb53f5ffda1bf2f1d0a4d39d46d0000d184c77e4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The refactor is coherent and broadly validated, with no concrete blocker found in this read-only review.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this member-authored PR. The body reports isolated Testbox tests and exact-head CI, without a live provider interaction; the iMessage recovery edit reads RPC history and changes no stored-data contract.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this member-authored PR. The body reports isolated Testbox tests and exact-head CI, without a live provider interaction; the iMessage recovery edit reads RPC history and changes no stored-data contract.
Evidence reviewed 9 items Introduced branch scope: The pinned merge-base-to-head diff changes five bundled channel plugins and an assertion baseline; it does not change manifests, dependencies, public SDK files, or schemas.
Still absent from main and release: Current main and release v2026.9.6 retain the Teams handler registry replaced by this branch.
Latest release check: The latest supplied release tag also contains the older Teams registry implementation.
Findings None None.
Security None None.

How this fits together

Bundled channel plugins receive provider events and attachments, check access, and pass accepted messages to OpenClaw. They also send replies and actions back through provider APIs.

flowchart LR
A[Provider events] --> B[Channel plugins]
B --> C[Account and sender checks]
C --> D[Conversation dispatch]
D --> E[Reply delivery]
E --> F[Provider APIs]
G[Attachments and callbacks] --> B
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -1553, Tests -158, Other -1. Total -1712 across 70 files.

View PR surface stats
Area Files Added Removed Net
Source 63 996 2549 -1553
Tests 6 71 229 -158
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 5 6 -1
Total 70 1072 2784 -1712

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/imessage/src/monitor/conversation-repair.ts, unknown-data-model-change: extensions/imessage/src/monitor/conversation-repair.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep one plugin-owned path for each affected responsibility while preserving channel access checks, delivery results, and existing operator state.

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

Not applicable: this PR proposes maintenance cleanup rather than reporting a broken behavior. The review compared the pinned diff with current source and did not execute provider interactions.

Is this the best way to solve the issue?

Yes for the stated maintenance goal: the changed flows remain in their existing plugin owners, and inspection found no competing implementation or introduced contract change.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2765f7a3341b.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal maintenance cleanup with no intended user-visible behavior change or established urgent defect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this member-authored PR. The body reports isolated Testbox tests and exact-head CI, without a live provider interaction; the iMessage recovery edit reads RPC history and changes no stored-data contract.

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)
  • Shakker: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • goffern: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • zw-xysk: 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)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-24T03:12:08.032Z sha eb53f5f :: blocked before merge. :: none
  • reviewed 2026-09-24T03:36:08.045Z sha eb53f5f :: blocked before merge. :: none

@steipete
steipete merged commit 6b0f45f into main Sep 24, 2026
167 of 168 checks passed
@steipete
steipete deleted the deslop/l28-channel-owners branch September 24, 2026 04:43
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
Consolidate request, dispatch, cache, approval, and delivery flows in msteams, imessage, signal, mattermost, and googlechat while preserving public contracts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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