Repository navigation
fix(mattermost): deny instead of pairing when the pending queue is full - #178581
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
The existing slash-http.test.ts carries pre-existing synthetic credential-shaped error fixtures unrelated to this fix; review input scanners refuse that file's base blob, so this PR no longer modifies it. The new pairing-queue coverage drives the same createSlashCommandHttpHandler boundary that the old placement did.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesMattermost pairing replies explain queue exhaustion instead of displaying an empty pairing code and unusable approval command. Example: Alice, Bob, and Carol have pending Mattermost pairing requests; Dave runs /oc_status.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR: it fixes a concrete Mattermost reply bug still present on current main, preserves valid pairing reminders, and introduces no identified correctness defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherMattermost HTTP callbacks authorize incoming commands, request account-scoped pairing codes, and format ephemeral responses using the shared pairing runtime. flowchart TD
A[Mattermost callback] --> B[Command authorization]
B --> C[Pairing store]
C --> D[Nonempty code]
C --> E[Queue capacity rejection]
D --> F[Pairing instructions]
E --> G[Recovery denial]
Technical reviewBest possible solution: Retain the two response-owner guards and shared recovery message while preserving existing pending-request codes. Do we have a high-confidence way to reproduce the issue? Current-main callers, the worker's capacity result, and existing store tests establish the failure path; supplied HTTP output corroborates it, and this read-only review ran no target code. Is this the best way to solve the issue? The guards are the smallest complete repair using existing response owners because created=false also represents valid pending requests whose codes must remain visible. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against efaf5e706187. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +21, Tests +248, Other -1. Total +268 across 6 files. Added test files: 1. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed October 25, 2026, 4:24 PM ET / 20:24 UTC (Revision 4). |
A full pending pairing queue returns an empty code and stores no request. Both Mattermost denied replies now explain that no request was saved and tell the requester to ask the bot owner to approve or dismiss pending requests in Settings -> Channels -> DM access requests before retrying, instead of showing a bare Unauthorized.
The monitor-auth mock now spreads the real module so tests can assert the shared queue-full denial text, so its closed-factory baseline entry is gone.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
# Conflicts: # extensions/mattermost/src/mattermost/monitor-model-picker.ts # extensions/mattermost/src/mattermost/slash-http.ts
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…ll (openclaw#178581) Return a clear capacity denial when the Mattermost pairing store returns an empty code. Preserve valid codes for existing pending requests and share the denial text between slash-command and model-picker response owners. Consolidate the slash regression into the existing HTTP suite. Closes openclaw#178507 Validation: both capacity regressions fail on the baseline and pass with the fix; auth tests also pass. The new slash-test typing issue was corrected. The remaining exact-head failure in CI run 40381491504 is the unrelated ReplyOperation fixture error reproduced by scheduled main run 40380874869 and subsequently fixed by openclaw#184907. The PR records the alternate-loopback environment limitation and live-proof scope. Co-authored-by: HeZzz <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…ll (#178581) Return a clear capacity denial when the Mattermost pairing store returns an empty code. Preserve valid codes for existing pending requests and share the denial text between slash-command and model-picker response owners. Consolidate the slash regression into the existing HTTP suite. Closes #178507 Validation: both capacity regressions fail on the baseline and pass with the fix; auth tests also pass. The new slash-test typing issue was corrected. The remaining exact-head failure in CI run 40381491504 is the unrelated ReplyOperation fixture error reproduced by scheduled main run 40380874869 and subsequently fixed by #184907. The PR records the alternate-loopback environment limitation and live-proof scope. Co-authored-by: HeZzz <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit b418e2b) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit ef604f312da5b496d394fa013983c168f903b59b)
Closes #178507
What Problem This Solves
When the Mattermost pairing queue is full, slash commands and the model-picker response owner display an empty pairing code and an approval command for a request that was never stored.
User Impact
Capacity-denied users receive a clear explanation and the owner's recovery path. Existing pending requests still return their valid code, including when the queue is full. Queue limits and authorization are unchanged.
Why This Change Was Made
An empty code identifies capacity rejection;
created: falsealso identifies existing requests, so it cannot select the denial on its own. Both response owners now select the shared capacity message only for an empty code.Thanks to @HeZ2z for the repair and original real-runtime proof. This revision simplifies the response branches and consolidates the new slash regression into the existing HTTP suite, deleting the duplicate fixture file. Relative to integrated main: production +11 lines, tests +102, documentation +1, mock baseline -1. This reduces the original +21 production / +248 test lines while retaining both response contracts.
Evidence
Independent diff review found no actionable P0–P2 issues.
b33227f35cceff9294df688ef29e35c4c269585c, with the new tests but without the production fix: both empty-code cases fail because the response is the ordinary pairing template; the other 18 tests pass.slash-http.test.tsandmonitor-model-picker.test.tspass, as do the fourmonitor-auth.test.tscases. The combined run including the HTTP boundary suite had 30 passes and one environmental failure, taking 105.23 seconds runner wall time (80.65 seconds reported by Vitest, mostly compilation/imports).reserves authenticated capacity and bounds each pre-authentication pool at eightcannot connect its alternate source addresses on this Mac. Its first admission count stays zero; a separate native socket probe bound to127.0.0.2returnsEADDRNOTAVAILbefore any product handler runs. No test was weakened or skipped.git diff --checkpass. Full local type-aware lint preparation and targeted typecheck refuse the linked dependency installation (Declaration input escapes checkout); PR CI supplies that proof.a6f38897b150f065ad4f69e644b2949c9126d39bused the production slash HTTP handler, real runtime, and isolated real pairing store: the fourth user received a capacity denial, an existing user retained their code, and the three stored requests remained unchanged. Only Mattermost REST was simulated. The registered picker callback rejects unapproved users before reaching the picker response owner; that owner was exercised directly against the same real store.CI found a missing nonempty-body assertion in the new slash test; that test-only typing issue is corrected. All 12 slash tests pass again (35.82 seconds runner wall), targeted lint/format pass, and a fresh review of the repair found no actionable P0–P2 findings. The first CI run also failed in unchanged
reply-agent-turn-preparation.test.ts:646(incompleteReplyOperationfixture), introduced by main commitbd6807a336d6; scheduled main run 40380874869 atd704d3b10632reproduces the identical signature (job 121776725394).The corrected head
40782da2a2aehas the same inherited failure in run 40381491504, job 121780092401. The PR-caused slash-test type error is gone.ClawSweeper's final-head re-review request did not produce a new review: its input scanner refused the reviewed source (run 40381453109). Its last completed review covers the contributor's earlier head and has no findings; the independent local reviews above cover the final changes.