Skip to content

fix(channels): isolate Mattermost sends and retain capture owner proof - #150915

Merged
RomneyDa merged 1 commit into
mainfrom
fix/release-2026.9.5-required-channels
Sep 29, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/release-2026.9.5-required-channels

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes Mattermost first-send stalls when the outbound runtime also loads inbound monitoring.

User Impact

Mattermost outbound sends no longer load the inbound monitor; account startup still starts monitoring normally. No configuration, permission, stored-data, migration, or release-version changes are required.

Why This Change Was Made

Keep the monitor import at its account-startup owner. Preserve Discord capture coverage with loader-faithful artifact metadata and exact provider/instance identity assertions through model selection and rerouting. The shared prepared-registry handoff already landed in #160658 and is not duplicated here.

This replaces the obsolete release ancestry with a four-file change based on main at eef2c0588a244, preserving the current instance-scoped fixture, late-transcription fencing, original-owner history, and cleanup.

Evidence

  • The strict Mattermost import regression fails on the original monitor re-export and passes after its removal. The standalone cold run also passes on the current toolchain: 39.61 s wall / 37.43 s Vitest duration, with the unchanged timeout, assertions, and monitor-rejection mock. The historical 120-second failure is not reproduced by this candidate.
  • 107 focused Mattermost tests pass, plus all 9 current send-owner HTTP/E2E cases and the complete Discord capture E2E flow. Discord verifies exact provider/instance identity, capture after turn settlement, late-STT exclusion, rerouting, original-owner history, and resource cleanup.
  • Full pnpm build passes on the exact four-file source tree, as do changed formatting, typechecks, lint, and guards. Independent P0–P2 autoreview found no actionable findings in the unchanged four-file patch. That review preceded integrating the canonical registry handoff from main; subsequent build and boundary tests verified the final source tree.
  • Configured Blacksmith Testbox command receipts report exit 0, settled, with verified source tree 7c9e8334b2823fe871ab8cd75ebc2df73ce37345, based on eef2c0588a244c3e144f39399829ca2990fae3a1; all four source hashes were verified. The backing Actions run 36495082467 is CANCELLED following lease cleanup; these are successful Testbox command/source-tree results, not successful hosted PR CI. Full build: 392.14 s. Mattermost E2E: 546.26 s wall, including 499.5 s required runtime preparation, then 35.96 s Vitest duration. Discord E2E: 66.45 s wall / 57.20 s Vitest duration.
  • Mattermost built-entry cold-import profile is qualified: 102.95 MiB peak RSS, 209 ms CPU, verified child cleanup. This is an import snapshot, not a live-send latency measurement.
  • Proof boundary: isolated HTTP/mock-Gateway and synthetic Discord/codec/STT edges, not live Mattermost or Discord platform proof. The expensive import test retains the real outbound dependency graph; the capture test needs the real Gateway/model-publication/lifecycle composition. Their preparation cost is reported rather than hidden behind broader mocks or relaxed deadlines.
  • Hosted PR CI passed for head 2fbfb55844b5e702a8cc9469f1781cc753c076c6: CI run 36497513140, with the aggregate openclaw/ci-gate reporting that CI and applicable security-review requirements passed. CI recorded 0.282 s test time for the Mattermost import regression inside its selected extension shard, and 56.803 s test time / 58.98 s file duration for Discord capture. These are separate from the cold standalone measurements above.
  • ClawSweeper reviewed this exact head: ready for maintainer review, high confidence, platinum hermit (4/6), no actionable code or security findings, no before-merge items. No merge or auto-merge was requested. Historical release-validation and dirty 16-file results are not used as exact-candidate evidence.
Execution-environment notes

Local E2E artifact preparation was refused because the runner could not verify separation from managed Gateway artifacts; the documented network-isolated runner hit the same preparation check. No safeguard was disabled. The completed Testbox runs above supply the E2E evidence instead. An initial local focused run was rejected before execution when overlapping isolated-snapshot cleanup changed the compiler namespace; after cleanup settled, the same selection passed all 107 cases. These are environment/preparation failures, not claimed product fixes. Testbox command/source-verification receipts completed successfully despite a non-fatal portal-sync warning, and the task-owned lease was stopped.

Human credit: @steipete, @RomneyDa, @vincentkoc.

Work sessions

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: mattermost Channel integration: mattermost agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Sep 17, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 17, 2026 13:30
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 7:42 PM ET / 23:42 UTC (Revision 5).

ClawSweeper review

What this changes

The branch separates Mattermost outbound loading from inbound monitoring and strengthens a Discord Gateway transcript test’s checks that the selected provider instance survives publication and rerouting.

Merge readiness

✅ Ready for maintainer review

Current main still loads Mattermost’s inbound monitor through the outbound runtime. The merged plugin-capture fix covers a separate part of the earlier work, while this focused, protected PR retains a distinct fix.

Priority: P1
Reviewed head: 2fbfb55844b5e702a8cc9469f1781cc753c076c6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The small owner-boundary change and focused regression coverage are strong, with useful isolated execution evidence and no actionable finding.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The bot-authored PR is exempt from the contributor proof gate. Its body reports after-fix cold-import, Mattermost HTTP boundary, and Discord Gateway capture runs; it does not claim measured live Mattermost send latency. No stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The bot-authored PR is exempt from the contributor proof gate. Its body reports after-fix cold-import, Mattermost HTTP boundary, and Discord Gateway capture runs; it does not claim measured live Mattermost send latency. No stored-data contract changes.
Evidence reviewed 8 items Current main retains the coupling: The current-main outbound runtime barrel still reexports the inbound monitor, so loading it can load monitoring code.
Introduced Mattermost boundary: The pinned patch removes that reexport and imports the monitor at the account-startup call site. The verified test merge retains these two production changes.
Outbound entry point: The Mattermost outbound adapter loads the runtime before calling the send operation, which connects the barrel import to the reported first-send path.
Findings None None.
Security None None.

How this fits together

Mattermost’s channel adapter receives message requests from OpenClaw and sends them to the Mattermost API; account startup separately launches inbound monitoring. A Discord test registers a capture provider and checks its identity as the Gateway publishes and reroutes transcript work.

flowchart LR
A[Message request] --> B[Mattermost outbound adapter]
B --> C[Mattermost API]
D[Gateway account startup] --> E[Mattermost inbound monitor]
F[Discord provider fixture] --> G[Gateway capture owner]
G --> H[Transcript store]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -1, Tests +47. Total +46 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 1 2 -1
Tests 2 55 8 +47
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 56 10 +46

Review metrics

None.

Technical review

Best possible solution:

Keep outbound sends free of the inbound monitor dependency while account startup remains the sole monitoring entry point, with the Discord capture test checking the selected owner through rerouting.

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

Yes. Current main loads the monitor through the outbound runtime barrel, and the added import regression directly tests that boundary; this read-only review did not execute the test.

Is this the best way to solve the issue?

Yes. The production change moves monitoring to its existing startup owner, and the Discord fixture uses the loader’s artifact selection to test provider identity without adding a second registry handoff.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 632b150d462f.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The PR addresses a first-send stall in an established channel workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The bot-authored PR is exempt from the contributor proof gate. Its body reports after-fix cold-import, Mattermost HTTP boundary, and Discord Gateway capture runs; it does not claim measured live Mattermost send latency. No stored-data contract changes.

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)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • shakkernerd: 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 (4 earlier review cycles)
  • reviewed 2026-09-17T13:40:13.042Z sha 583c475 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T14:56:28.261Z sha 583c475 :: blocked before merge. :: none
  • reviewed 2026-09-24T23:55:09.129Z sha 583c475 :: blocked before merge. :: none
  • reviewed 2026-09-28T23:28:52.744Z sha 2fbfb55 :: needs maintainer review before merge. :: none

@steipete
steipete changed the base branch from release/2026.9.5 to main September 17, 2026 14:47
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: line Channel integration: line channel: matrix Channel integration: matrix channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web channel: zalo Channel integration: zalo channel: zalouser Channel integration: zalouser app: android App: android labels Sep 17, 2026
@steipete

steipete commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Retargeted this PR to main after the release branch was re-cut. The temporary filesystem wait cleared, and the actual fix was rebased locally without the obsolete release-preparation ancestry. No revised head has been pushed and this PR remains unmerged.

The local candidate preserves main's Discord shared-state repair in 6bed2ab97f2cb2a9bcf8d77e4fd2e3f4bfc3770b and its E2E coverage across separate provider generations. It keeps the Mattermost import repair, generic prepared-registry reuse, and fixture cleanup ownership. Production is +3/-5; tests/support are +74/-4 across seven files.

Stopped at validation: the standalone extensions/mattermost/src/channel.runtime.test.ts hits its unchanged 120-second timeout on both the pre-fix and repaired source. The repaired run spent 92.5 seconds preparing native test-worker artifacts within the timed import. The combined run passed 133 cases (48 registry/runtime and 85 Mattermost), and fresh autoreview was scoped-clean, but those results do not make the standalone gate green. The first-inbound registry regression did fail on the old owner and pass after repair.

No timeout, assertion, mock, baseline, or build requirement was relaxed to get green. The cold-import/test-artifact preparation interaction needs resolution and fresh boundary proof before this candidate can be published and landed. Original-head CI run 35227489914 is historical evidence only; no exact-head CI exists for the unpublished rebased candidate.

The remaining production fix is absent from the 2026.9.5 cut at 4b38266964828d528ecb7823a1dde833b8b25d75. Release inclusion is recommended after qualification and main landing, alongside main's complementary Discord shared-state repair. No release branch was modified.

Keep Mattermost inbound monitoring behind account startup rather than the
outbound runtime. Bind the Discord E2E fixture to its selected runtime
artifact and assert exact provider/instance identity through model selection
and rerouting, preserving late-STT, history, and cleanup fences.

The prepared-registry handoff is already on main via #160658; do not
duplicate it or retain the obsolete release-preparation ancestry.

Co-authored-by: steipete <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: mattermost Channel integration: mattermost extensions: webhooks maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

3 participants