Skip to content

fix(qa): Matrix replies disappear after final replacement - #117390

Merged
RomneyDa merged 4 commits into
mainfrom
fix/qa-matrix-replacement-observations
Aug 1, 2026
Merged

RomneyDa merged 4 commits into
mainfrom
fix/qa-matrix-replacement-observations

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Aug 1, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where Matrix live QA observed successful final edits but then timed out matching image-content and threaded-reply expectations because replacement metadata displaced the event's logical relation.

Why This Change Was Made

The Matrix observer records physical m.replace delivery separately from logical reply/thread relations. Replacement events inherit the original event's relation in both sync and E2EE paths. If an E2EE replacement decrypts before its target, the recorder now rehydrates and appends the enriched replacement when the target arrives, keeping cursor-based waiters observable without compatibility fallbacks.

User Impact

Matrix live evidence can recognize final edited replies in top-level, threaded, and late-decryption orderings without weakening content or relation assertions. Product runtime is unchanged.

Evidence

Private QA Lab delta: +87 net source lines and +51 net test lines. No compatibility shim or alternate record shape remains.

AI-assisted: yes. Agent transcript omitted unless requested.

@RomneyDa
RomneyDa marked this pull request as ready for review August 1, 2026 11:58
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 9:23 AM ET / 13:23 UTC.

ClawSweeper review

What this changes

The branch changes Matrix QA observation so an m.replace edit keeps its replaced-event ID separately, inherits the edited event’s logical reply or thread relation, and re-emits late-decrypted replacements for cursor-based waiters.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this maintainer-authored PR open for normal landing review. The prior late-decryption finding is addressed: the branch records replacement targets separately from logical relations and appends a rehydrated replacement after its target gains a relation; no new concrete patch defect was found in this review.

Priority: P2
Reviewed head: cd62135baa493cf9ded3930f87a4e40aafe9a606

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has a coherent owner-boundary repair and focused regression coverage; completion of the in-progress exact-head QA lanes is the remaining confidence step.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored QA repair, so the external-contributor proof gate does not apply; the PR body and successful proof check nevertheless provide focused after-fix validation context.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored QA repair, so the external-contributor proof gate does not apply; the PR body and successful proof check nevertheless provide focused after-fix validation context.
Evidence reviewed 6 items Current-main defect boundary: Current main stores every Matrix relation, including an outer m.replace, in relatesTo; that conflates edit delivery with the original message’s logical reply or thread relation.
Canonical branch repair: The branch records replacesEventId independently, suppresses the edit envelope as a logical relation, and inherits the target event’s relation only when available.
Late-decryption lifecycle repair: The E2EE recorder indexes replacements by target and appends a rehydrated record when a target later obtains a logical relation, which preserves append-only cursor semantics.
Findings None None.
Security None None.

How this fits together

QA Lab’s Matrix transport turns sync and encrypted-client events into an append-only observed-event stream used by live scenario matchers and timeout diagnostics. This change preserves both an edit’s physical target and the original message’s reply or thread metadata so final-response checks can identify the same event correctly.

flowchart LR
  A[Matrix room events] --> B[Sync and E2EE observers]
  B --> C[Observed event normalization]
  C --> D[Separate edit target from relation]
  D --> E[Append-only observed event stream]
  E --> F[Cursor-based scenario waiters]
  F --> G[QA evidence and diagnostics]
Loading

Before merge

  • Resolve merge risk (P1) - This modifies the Matrix QA evidence pipeline; exact-head QA smoke and broader check lanes are still running, so sync and E2EE ordering should remain unmerged until those checks finish successfully.
  • Complete next step (P2) - No concrete repair remains after the prior late-decryption finding; this PR needs ordinary exact-head validation and maintainer landing review, not an automated fix lane.
Agent review details

Security

None.

PR surface

Source +87, Tests +51. Total +138 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 8 146 59 +87
Tests 4 88 37 +51
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 234 96 +138

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/qa-lab/src/live-transports/matrix/substrate/e2ee-client-internals.ts, migration/backfill/repair: extensions/qa-lab/src/live-transports/matrix/substrate/e2ee-client.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Wait for Matrix QA validation (recommended)
    Keep the branch in normal review until its exact-head QA smoke and remaining check lanes validate both sync and E2EE observation paths.
  2. Accept limited QA risk
    Merge before the remaining checks only if maintainers explicitly accept that live QA evidence could regress for replacement ordering.

Technical review

Best possible solution:

Land the single canonical observed-event shape—separate edit target plus inherited logical relation—after the exact-head QA checks confirm sync and encrypted replacement ordering.

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

Yes—source establishes the failure shape: current main treats an edit’s outer m.replace as its logical relation, while the branch’s focused regression test models a replacement decrypted before its threaded target.

Is this the best way to solve the issue?

Yes—the separate replacesEventId fact plus owner-side relation inheritance is a narrower, more maintainable repair than teaching each scenario to reinterpret Matrix edit envelopes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2576d844c436.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored QA repair, so the external-contributor proof gate does not apply; the PR body and successful proof check nevertheless provide focused after-fix validation context.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The branch fixes a bounded Matrix QA observation regression without changing product runtime behavior.
  • merge-risk: 🚨 automation: The diff changes the event records and scenario predicates that determine whether Matrix QA automation recognizes replies and reports failures.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored QA repair, so the external-contributor proof gate does not apply; the PR body and successful proof check nevertheless provide focused after-fix validation context.

Evidence

What I checked:

Likely related people:

  • joshavant: Current-main blame and file history attribute the Matrix observed-event normalization that the branch corrects to this contributor. (role: feature owner; confidence: high; commits: 0ccae508fb8d; files: extensions/qa-lab/src/live-transports/matrix/substrate/events.ts, extensions/qa-lab/src/live-transports/matrix/substrate/e2ee-client.ts, extensions/qa-lab/src/live-transports/matrix/substrate/sync.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the exact-head QA smoke and remaining check lanes complete successfully before merging.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-01T12:29:42.385Z sha 555c459 :: found issues before merge. :: [P2] Backfill replacements after late-decrypted target updates
  • reviewed 2026-08-01T12:49:10.627Z sha 555c459 :: found issues before merge. :: [P2] Rehydrate replacements after late-decrypted target updates

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Aug 1, 2026
@RomneyDa RomneyDa self-assigned this Aug 1, 2026
@RomneyDa
RomneyDa force-pushed the fix/qa-matrix-replacement-observations branch from 555c459 to 7f591e2 Compare August 1, 2026 13:14
@RomneyDa

RomneyDa commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@RomneyDa

RomneyDa commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 1, 2026
@RomneyDa
RomneyDa enabled auto-merge (squash) August 1, 2026 13:27
@RomneyDa
RomneyDa merged commit 39cc0a3 into main Aug 1, 2026
132 of 138 checks passed
@RomneyDa
RomneyDa deleted the fix/qa-matrix-replacement-observations branch August 1, 2026 13:27
pull Bot pushed a commit to NickHood1984/openclaw that referenced this pull request Aug 1, 2026
* origin/main:
  docs: generate docs map at publish time (openclaw#117398)
  refactor(plugins): move plugin contributions into the registry bundle (openclaw#117372)
  fix(tui): keep PTY progress and lifecycle truthful (openclaw#117402)
  test(xai): type realtime sent item payloads
  fix(qa): preserve Slack fallback evidence (openclaw#117420)
  fix(qa): satisfy update lane execution contracts (openclaw#117388)
  fix(qa): Matrix replies disappear after final replacement (openclaw#117390)
  test(xai): prove rejected tool call continuation
  fix(xai): complete rejected realtime tool calls
  test(xai): add live tool argument probe
  test(xai): cover rejected realtime tool arguments
  fix(xai): validate realtime tool arguments before dispatch
  fix(xai): skip tool call when rawArgs JSON parse fails instead of silently falling back to empty args
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
…17390)

* fix(qa): preserve Matrix relations through replacements

* fix: honor Matrix replacement relation semantics

* fix(qa): reconcile late Matrix replacement targets

* test(qa): exercise Matrix recorder through public behavior
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* origin/main:
  docs: generate docs map at publish time (openclaw#117398)
  refactor(plugins): move plugin contributions into the registry bundle (openclaw#117372)
  fix(tui): keep PTY progress and lifecycle truthful (openclaw#117402)
  test(xai): type realtime sent item payloads
  fix(qa): preserve Slack fallback evidence (openclaw#117420)
  fix(qa): satisfy update lane execution contracts (openclaw#117388)
  fix(qa): Matrix replies disappear after final replacement (openclaw#117390)
  test(xai): prove rejected tool call continuation
  fix(xai): complete rejected realtime tool calls
  test(xai): add live tool argument probe
  test(xai): cover rejected realtime tool arguments
  fix(xai): validate realtime tool arguments before dispatch
  fix(xai): skip tool call when rawArgs JSON parse fails instead of silently falling back to empty args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant