Fix Matrix configured two-person room routing#85137
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. The PR body gives a current-main Crabbox repro where an unmentioned configured two-person Matrix room replied, and current source shows DM classification runs before room config and mention gating. PR rating 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 configured-room veto with Matrix-owner approval, preserving wildcard and fresh-DM fallback behavior while documenting the intentional operator-visible routing change through the changelog. Do we have a high-confidence way to reproduce the issue? Yes. The PR body gives a current-main Crabbox repro where an unmentioned configured two-person Matrix room replied, and current source shows DM classification runs before room config and mention gating. Is this the best way to solve the issue? Yes. Moving an exact configured-room veto into the direct tracker is the narrow owner-boundary fix and the tests preserve wildcard/non-configured DM fallback behavior. Label changes:
Label justifications:
Acceptance criteria:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 777a113973e9. |
|
ClawSweeper PR egg ✨ Hatched: ✨ glimmer Sunspot Patch Peep Hatch commandComment Hatchability rules:
Rarity: ✨ glimmer. What is this egg doing here?
|
* Fix Matrix configured room DM routing * Add Matrix room routing changelog
* Fix Matrix configured room DM routing * Add Matrix room routing changelog
* Fix Matrix configured room DM routing * Add Matrix room routing changelog
* Fix Matrix configured room DM routing * Add Matrix room routing changelog
* Fix Matrix configured room DM routing * Add Matrix room routing changelog
* Fix Matrix configured room DM routing * Add Matrix room routing changelog
* Fix Matrix configured room DM routing * Add Matrix room routing changelog
* Fix Matrix configured room DM routing * Add Matrix room routing changelog
* Fix Matrix configured room DM routing * Add Matrix room routing changelog
* Fix Matrix configured room DM routing * Add Matrix room routing changelog
* Fix Matrix configured room DM routing * Add Matrix room routing changelog
Summary
channels.matrix.groupscould still be classified as DMs when the room had exactly two members.m.director the strict two-member fallback can route the event as a DM.m.directand pre-seed fallback paths.Motivation
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
Behavior addressed: Matrix two-person rooms explicitly configured as rooms no longer bypass mention gating via DM classification.
Real environment tested: AWS Crabbox
cbx_1098b2400fe1, runrun_d7af6f2a55c9; Linux Node 24.15.0; Docker Tuwunelghcr.io/matrix-construct/tuwunel:v1.5.1; OpenClaw gateway with Matrix QA live harness and mock OpenAI provider.Exact steps or command run after this patch:
node scripts/crabbox-wrapper.mjs run --provider aws --idle-timeout 90m --ttl 180m --timing-json --preflight --script-stdin, which installed dependencies, ranpnpm build, booted Tuwunel, provisioned two configured Matrix group rooms, started the gateway, sent mentioned and unmentioned messages, and observed Matrix sync replies.Evidence after fix:
OPENCLAW_85017_FIX_PROOF_SUMMARYreportedfixed: true; the two-person configured room had joined count2,sutMemberIsDirect: null; mentioned message replied with markerMATRIX_QA_85017_MENTION_46F1B779; unmentioned two-person room message hadmatched: false; unmentioned three-person control hadmatched: false.Observed result after fix: Mentioned room messages still trigger, while unmentioned messages in a configured two-person Matrix room stay silent instead of being routed as DMs.
What was not tested: A public Matrix homeserver outside the disposable Tuwunel QA harness.
Before evidence (optional but encouraged): AWS Crabbox repro on current main
cbx_a29749d91e7d, runrun_cec1acaaab88, showed the same two-person configured room replying to an unmentioned message while the three-person control stayed silent.Root Cause (if applicable)
m.director pre-seed strict fallback classification.Regression Test Plan (if applicable)
extensions/matrix/src/matrix/monitor/direct.test.ts,extensions/matrix/src/matrix/monitor/index.test.ts.m.directand strict two-member fallback before DM routing.User-visible / Behavior Changes
Configured Matrix rooms now follow room mention-gating even when the room has exactly two members.
Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation: N/ARepro + Verification
Environment
ghcr.io/matrix-construct/tuwunel:v1.5.1groupPolicy: "open", configuredgroupsfor a 2-member room and a 3-member control room, each withrequireMention: true; Matrix DM allowlist enabled for the driver.Steps
Expected
Actual
run_d7af6f2a55c9.Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
m.direct, strict two-member fallback before DM cache seed, exact room IDs, resolved alias config, wildcard config not overriding DM classification.Review Conversations
Compatibility / Migration
Risks and Mitigations