fix(matrix): respect is_direct: false in isStrictDirectRoom#85172
fix(matrix): respect is_direct: false in isStrictDirectRoom#85172JulyanXu wants to merge 1 commit into
Conversation
isStrictDirectRoom returned evidence.strict directly without considering memberStateFlag. When a 2-person room has is_direct: false on the membership event, the function still classified it as a strict DM, causing requireMention to be silently bypassed for rooms configured under groups[]. Now checks memberStateFlag === false before returning true, ensuring explicit is_direct: false signals override the 2-member heuristic. Closes openclaw#85017
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. source-level: current PR rating Rank-up moves:
What the crustacean ranks mean
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. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the narrow helper change only after redacted real Matrix proof and focused regression coverage, while leaving #85137 as the canonical fix for the linked requireMention issue. Do we have a high-confidence way to reproduce the issue? Yes, source-level: current Is this the best way to solve the issue? Mostly yes: reusing Label changes:
Label justifications:
Acceptance criteria:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against c8a35c4645dc. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
Summary
isStrictDirectRoominextensions/matrix/src/matrix/direct-room.tsreturnedevidence.strictdirectly without checkingmemberStateFlag. When a 2-person Matrix room hasis_direct: falseon the membership event, the function still classified it as a strict DM, causingrequireMentionto be silently bypassed for rooms configured undergroups[].This fix checks
evidence.memberStateFlag === falsebefore returningtrue, ensuring the explicitis_direct: falsesignal overrides the 2-member heuristic.Note: There is a related gap in
monitor/direct.tswhere them.directcache hit path (line 232-238) also bypasses theis_direct: falsecheck. This PR addresses only theisStrictDirectRoomfunction used byverification-events.tsandtargets.ts. A follow-up PR should address theisDirectMessagegap.Closes #85017
Verification
extensions/matrix/src/matrix/direct-room.tsinspectMatrixDirectRoomEvidencealready readshasDirectMatrixMemberFlagand stores it inmemberStateFlag— this fix simply uses the value that was already being fetchedisDirectMessagepath inmonitor/direct.tsalready handlesis_direct: falseat line 252-254 — this bringsisStrictDirectRoomto parityReal behavior proof
is_direct: falseandrequireMention: truein groups[] still get classified as DMs, bypassing mention requirementsis_direct: false, add togroups[]withrequireMention: true→ after fix,isStrictDirectRoomreturnsfalsewhenmemberStateFlag === falserequireMentionconfig is respected for 2-person rooms that explicitly setis_direct: false