Repository navigation
improve(mattermost): speed up inbound direct-message replies - #128431
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 9:25 PM ET / August 24, 2026, 01:25 UTC. ClawSweeper reviewWhat this changesThe PR sends Mattermost inbound replies to the channel ID already present in each inbound event, avoiding cold direct-message channel lookup requests. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessNo blocking correctness finding: the PR carries the inbound Mattermost channel ID to reply delivery while preserving user-based session routing. It remains open for protected maintainer handling and exact-head refresh because GitHub reports the branch behind current main. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherMattermost events are authorized and routed into an OpenClaw reply turn, then the plugin posts the resulting reply through Mattermost. Session routing retains the sender-based direct-message identity, while reply delivery uses the physical inbound channel ID. flowchart LR
A[Mattermost inbound event] --> B[Authorization and event plan]
B --> C[Session route from sender]
B --> D[Prepared channel ID]
C --> E[Reply turn]
D --> F[Reply delivery]
E --> F
F --> G[Mattermost post API]
Decision needed
Why: The change is technically coherent, but the maintainer label requires an explicit human merge decision after the current-main integration refresh. Before merge
Agent review detailsSecurityNone. PR surfaceSource -131, Tests -85. Total -216 across 17 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase or refresh against current main, then land the single prepared-channel reply path once exact-head checks confirm the current merge result. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: direct inbound events retain user:<sender> for routing, and a cold user send takes the bot-user/direct-channel-resolution branch before posting. Is this the best way to solve the issue? Yes: carrying the already-prepared inbound channel ID to the reply-delivery owner removes duplicate lookup without changing session identity or generic proactive user sends. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 19d44d3f38bf. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Exact-head land-ready disposition for
Review recommendation: Issue status: |
|
Merged via squash.
|
…w#128431) * perf(mattermost): reuse inbound channel for replies * fix(mattermost): reject interaction route replacement --------- Co-authored-by: Amp <[email protected]>
What Problem This Solves
Fixes an issue where inbound Mattermost direct-message replies would rediscover a channel already identified by the inbound event, adding
GET /users/meandPOST /channels/directbefore every cold reply.Why This Change Was Made
Inbound reply delivery now uses the authoritative provider channel ID carried by Mattermost post, interaction, model-picker, pairing, and slash-command events. Semantic DM routing remains user-based for sessions and last-route storage, while generic proactive
user:sends retain their existing DM resolution, cache, and retry behavior.The reply-only DM-resolution observer and extended admission barrier are removed because inbound delivery no longer performs that resolution.
User Impact
Mattermost DM replies avoid two unnecessary provider requests on a cold route, reducing latency and server work without changing reply text, media, threading, receipts, routing identity, or retry semantics.
Evidence
POST /api/v4/postswith the prepared channel ID and unchanged message payload.node scripts/check-changed.mjs: passed (extensions,extensionTests), including format, production/test typechecks, type-aware Oxlint (0 warnings/errors), dead exports, plugin boundaries, guards, and import cycles.gpt-5.6-sol/ high reported no findings andpatch is correct(0.98 confidence).git diff --check: clean.