Skip to content

fix(matrix): surface sustained E2EE decryption failures - #110176

Closed
shad0wca7 wants to merge 1 commit into
openclaw:mainfrom
shad0wca7:kit/matrix-e2ee-health-degraded
Closed

shad0wca7 wants to merge 1 commit into
openclaw:mainfrom
shad0wca7:kit/matrix-e2ee-health-degraded

Conversation

@shad0wca7

@shad0wca7 shad0wca7 commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

OpenClaw could report a healthy Matrix channel while fresh inbound encrypted messages were failing decryption before agent dispatch. The existing whoami probe and successful /sync lifecycle did not represent inbound E2EE health, so a user could send messages that the agent silently never received.

Summary

  • mark Matrix channel health degraded after a sustained wave of fresh inbound E2EE decryption failures
  • keep degradation across healthy syncs and recover only after newer inbound successes for every affected device-aware cohort
  • bound ordering and cohort state, fail closed on overflow, and make Matrix test runtime setup order-independent

Evidence

  • reproduced the false-green state from sustained inbound decryption failures while sync remained healthy
  • targeted Matrix E2EE health suite: 4 files, 121 tests passed
  • full Matrix extension suite: 119 files, 1,495 tests passed
  • exact CI lint shard node scripts/run-oxlint-shards.mjs --threads=8 passed
  • pnpm tsgo:test:extensions, formatting, and diff checks passed
  • two independent Codex reviewers approved the state-machine ordering, cohort, recovery, overflow, and self-event behavior

Test plan

  • pnpm test:extension matrix
  • targeted Matrix E2EE health suite
  • pnpm tsgo:test:extensions
  • node scripts/run-oxlint-shards.mjs --threads=8
  • formatter and git diff --check

@openclaw-barnacle openclaw-barnacle Bot added channel: matrix Channel integration: matrix size: XL triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 17, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the contribution. This PR has been inactive for a while and still is not in a landable state.

Close this draft: its only head commit is over 30 days old, the author explicitly declined to rebase the large state machine, and current Matrix ownership has since been substantially refactored. The underlying false-green concern remains worth a fresh, smaller current-main implementation if it still reproduces.

So I’m closing this as inactive for now. If you pick the work back up, push a rebased branch with green checks and reopen (or open a fresh PR) and it will be reviewed again.

Review details

Best possible solution:

If the behavior still reproduces, implement a new, small current-main change that records decryption-health facts at the SDK producer boundary and feeds the present status owner, with redacted degraded-to-recovered runtime proof.

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

No live current-main run was available, but source provides a high-confidence path: repeated failures create a diagnostic while current main has no callback that changes channel health.

Is this the best way to solve the issue?

No. The author correctly identified that this large monitor-side state machine is no longer the best ownership boundary after the Matrix refactor.

Security review:

Security review cleared: The diff changes Matrix monitor state and tests only; no dependency, credential, permission, or supply-chain change was found.

AGENTS.md: found and applied where relevant.

What I checked:

  • Draft branch scope: The branch adds a 279-line E2EE tracker plus 438 focused tracker-test lines, within an 11-file +1,268/-217 Matrix-monitor diff. (extensions/matrix/src/matrix/monitor/e2ee-health.ts:75, 8deb94d879a5)
  • Current main behavior: Current main still aggregates repeated fresh decryption failures into diagnostics, but its event handler only logs the warning and does not update the channel status controller. (extensions/matrix/src/matrix/monitor/events.ts:278, 04eae7cea17e)
  • Changed owner boundary: The Matrix monitor and SDK ownership were extensively refactored after this branch; current history identifies the later Matrix E2EE-client retirement refactor as a central follow-up change. (extensions/matrix/src/matrix/monitor/events.ts:171, a3419d4a4b4c)
  • Author disposition and inactivity: The head commit dates to 2026-07-17. The author’s 2026-08-04 comment says they returned the PR to draft, will not mechanically rebase the 1,268-line state machine, and expects any successor to use the producer boundary. (8deb94d879a5)
  • Proof gap: The PR body reports test results, but neither it nor the supplied discussion provides inspectable after-fix Matrix runtime evidence of a degraded status followed by recovery.

Likely related people:

  • shad0wca7: History attributes the earlier repeated-undecryptable-event behavior to this contributor, and the supplied discussion explains why this successor draft was parked. (role: introduced earlier decryption-diagnostic behavior and authored the draft; confidence: high; commits: 753bd39d52f1, 8deb94d879a5; files: extensions/matrix/src/matrix/monitor/events.ts, extensions/matrix/src/matrix/monitor/e2ee-health.ts)
  • Vincent Koc: Recent history identifies the Matrix E2EE-client retirement refactor as the post-branch ownership change relevant to a replacement. (role: recent Matrix E2EE ownership refactor contributor; confidence: medium; commits: a3419d4a4b4c; files: extensions/matrix/src/matrix/monitor/events.ts, extensions/matrix/src/matrix/sdk.ts)

Codex review notes: model internal, reasoning high; reviewed against 04eae7cea17e.

@shad0wca7
shad0wca7 force-pushed the kit/matrix-e2ee-health-degraded branch from 6977dc5 to 8deb94d Compare July 17, 2026 21:27
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 17, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 17, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. and removed P2 Normal backlog priority with limited blast radius. labels Jul 29, 2026
@shad0wca7
shad0wca7 marked this pull request as draft August 4, 2026 04:05
@shad0wca7

Copy link
Copy Markdown
Contributor Author

Portfolio refresh decision: I am not mechanically rebasing this 1,268-line monitor state machine. The false-green E2EE health problem remains worthwhile, but current Matrix monitor ownership has moved and this branch reconstructs health too far downstream. I have returned it to draft. The next defensible version should record decryption-health facts at the event/status producer boundary, keep the state surface substantially smaller, and include inspectable degraded→recovered runtime proof before publication.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: matrix Channel integration: matrix merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant