Skip to content

fix(mattermost): normal replies silently drop buttons and presentation - #129579

Merged
steipete merged 1 commit into
mainfrom
codex/qa-mattermost-normal-reply-presentations-20260825
Aug 25, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-mattermost-normal-reply-presentations-20260825

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where ordinary Mattermost agent replies silently discarded presentation text, native buttons, action URLs, and selection menus. Presentation-only responses produced no message and no diagnostic; text replies lost their controls; the default streamed-preview path also discarded pending presentation content.

Why This Change Was Made

Mattermost's existing plugin-owned presentation renderer and native-button builder are now shared by normal inbound agent delivery, streamed draft finalization, outbound delivery, and message actions. The repair preserves authored fallback text, first-post-only controls, multi-media fallback, existing provider card receipts, and current callback/action security restrictions. Consolidation keeps production LOC exactly neutral across the four affected owners.

User Impact

Mattermost operators now reliably receive documented presentation content and interactive controls in ordinary and streamed agent replies, including actionable connection URLs and selection fallbacks, instead of seeing silent missing messages or stranded text without its controls.

Evidence

  • The shipped Mattermost documentation already explicitly promises presentation buttons in normal agent replies; the defect also reproduced against a stable release source snapshot.
  • Genuine pre-fix regressions: 9 real normal-reply-owner failures plus 3 default-streaming lifecycle failures; presentation-only messages sent nothing, authored replies lost controls, and partial previews silently finalized without their pending presentations.
  • Real plugin-owner wire proof now sends title/text/value-button/URL/select presentations, retains the actual provider card receipt, preserves authored fallback bytes, sends controls only with the first eligible post, and downgrades multi-media presentations safely.
  • Channel adapter, normal reply owner, streaming draft owner, provider sender, normalization, and delivery-trace siblings: 193 tests passed across six suites.
  • Existing callback authentication and typed-action restrictions are unchanged. Formatting, focused type-aware lint, and independent whole-change review passed.
  • Production LOC: net 0 across the plugin's four canonical owners; meaningful owner/lifecycle regression growth is test-only.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added channel: mattermost Channel integration: mattermost size: M maintainer Maintainer-authored PR labels Aug 25, 2026
@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 Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 3:46 PM ET / 19:46 UTC.

ClawSweeper review

What this changes

The PR makes normal and streamed Mattermost agent replies render presentation fallback text and supported native buttons instead of dropping them.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open: this maintainer-labeled PR repairs a current, source-proven Mattermost delivery gap with one plugin-owned presentation path; no blocking patch defect was found. Likely related person: Peter Steinberger (high confidence).

Priority: P1
Reviewed head: fd8f6bff2a392c2bd07b20095f60fa0ac37ec89d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-neutral owner-boundary repair with meaningful regression coverage and no blocking review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body describes owner-wire evidence, but no artifact was treated as proof sufficiency here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body describes owner-wire evidence, but no artifact was treated as proof sufficiency here.
Evidence reviewed 7 items Current-main behavior: Current main converts only payload text before normal reply delivery, so a presentation-only payload has neither fallback text nor buttons on this path.
Documented contract: Mattermost documentation promises presentation payloads in normal agent replies, rendering value buttons natively and URL/select controls as readable fallback text.
Owner-boundary repair: The proposed normal reply owner now uses the shared Mattermost presentation resolver before chunking and attaches native controls only to the first eligible post.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs run extensions/mattermost/src/mattermost/reply-delivery.test.ts extensions/mattermost/src/mattermost/monitor-draft-delivery.test.ts

Result: PASS (completed)

[test] starting test/vitest/vitest.extension-mattermost.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129579-Mh7e8A/target

[vitest] still running with no output for 30000ms.
stderr | extensions/mattermost/src/mattermost/monitor-draft-delivery.test.ts › deliverMattermostReplyWithDraftPreview › preserves a completed normal send when p
review cleanup fails
Live preview cleanup failed after delivery; a stale preview may remain

 ✓  extension-mattermost  extensions/mattermost/src/mattermost/reply-delivery.test.ts (21 tests) 59ms
 ✓  extension-mattermost  extensions/mattermost/src/mattermost/monitor-draft-delivery.test.ts (22 tests) 46ms

 Test Files  2 passed (2)
      Tests  43 passed (43)
   Start at  19:47:49
   Duration  30.59s (transform 50.55s, setup 2.29s, import 57.95s, tests 104ms, environment 0ms)

[test] passed 1 Vitest shard in 36.42s
[test] starting test/vitest/vitest.extension-mattermost.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129579-Mh7e8A/target

stderr | extensions/mattermost/src/mattermost/monitor-draft-delivery.test.ts › deliverMattermostReplyWithDraftPreview › preserves a completed normal send when p
review cleanup fails
Live preview cleanup failed after delivery; a stale preview may remain

 ✓  extension-mattermost  extensions/mattermost/src/mattermost/reply-delivery.test.ts (21 tests) 48ms
 ✓  extension-mattermost  extensions/mattermost/src/mattermost/monitor-draft-delivery.test.ts (22 tests) 42ms

 Test Files  2 passed (2)
      Tests  43 passed (43)
   Start at  19:48:26
   Duration  15.53s (transform 21.30s, setup 1.21s, import 29.14s, tests 90ms, environment 0ms)

[test] passed 1 Vitest shard in 21.28s

Assertions:

  • PASS expect_output: Test Files

How this fits together

Mattermost inbound turns produce agent reply payloads that the plugin converts into posts, optional native controls, and delivery receipts. Draft-preview streaming can either edit a post or delegate the final payload to the same delivery owner.

flowchart LR
  A[Agent reply payload] --> B[Presentation normalization]
  B --> C[Normal reply delivery]
  B --> D[Draft preview finalization]
  C --> E[Mattermost post and controls]
  D --> E
  E --> F[Delivery receipt]
Loading

Before merge

  • Complete next step (P2) - The protected maintainer label and lack of a repair finding leave ordinary exact-head CI and maintainer merge review as the next action.
Agent review details

Security

None.

PR surface

Source 0, Tests +241. Total +241 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 76 76 0
Tests 2 244 3 +241
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 320 79 +241

Review metrics

Metric Value Why it matters
Production versus test LOC production +76/-76 (net 0); tests +244/-3 (net +241) The bug fix absorbs the behavior into existing plugin owners without production growth while adding focused lifecycle regression coverage.

Technical review

Best possible solution:

Keep one Mattermost-owned presentation conversion path and land it once the exact-head checks complete successfully.

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

Yes—current main routes normal replies through a text-only conversion at extensions/mattermost/src/mattermost/reply-delivery.ts:78, while the documented presentation contract requires visible fallback content and controls; this read-only review did not execute the failing path.

Is this the best way to solve the issue?

Yes—the shared plugin-owned resolver is the narrowest maintainable solution because outbound delivery and normal replies then use the same presentation semantics, while draft finalization delegates presentation payloads to that owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 66bfdeffb9b4.

Labels

Label changes:

  • add P1: The current default Mattermost reply path can silently suppress promised presentation content and interactive controls.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body describes owner-wire evidence, but no artifact was treated as proof sufficiency here.

Label justifications:

  • P1: The current default Mattermost reply path can silently suppress promised presentation content and interactive controls.
  • 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: This maintainer-authored PR is exempt from the external-contributor proof gate; its body describes owner-wire evidence, but no artifact was treated as proof sufficiency here.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Current-main blame assigns the affected reply-delivery and channel presentation lines to his recent merged work, and he authored this focused repair. (role: recent Mattermost delivery contributor; confidence: high; commits: 6ad7915c056e, fd8f6bff2a39; files: extensions/mattermost/src/mattermost/reply-delivery.ts, extensions/mattermost/src/channel.ts, extensions/mattermost/src/normalize.ts)

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.

@steipete
steipete merged commit e1e2818 into main Aug 25, 2026
107 checks passed
@steipete
steipete deleted the codex/qa-mattermost-normal-reply-presentations-20260825 branch August 25, 2026 21:46
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: mattermost Channel integration: mattermost 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: M 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