Skip to content

refactor(matrix): simplify send and shutdown test fixtures - #156383

Merged
vincentkoc merged 8 commits into
mainfrom
test/matrix-suite-cleanup-20260923
Nov 6, 2026
Merged

vincentkoc merged 8 commits into
mainfrom
test/matrix-suite-cleanup-20260923

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Matrix send fixtures copied room-preparation policy, while a shutdown test asserted drain ordering manufactured by its own mock.

User Impact

No user-visible behavior changes. This updates test fixtures and assertions only.

Why This Change Was Made

Use configurable readiness outcomes at the send boundary and keep policy coverage with the real SDK owner. Preserve exact error propagation, side-effect suppression, and the final mixed-attachment check after thumbnail upload. Remove only synthetic shutdown evidence; meaningful shared-client retirement checks remain.

The final scope is four test/support files. The original broader real-runner migration is not included. Production delta is zero; tests are +88/−82 lines. The exact six-line allocation covers isolated clients and stronger boundary assertions; the shared scalar baseline is unchanged.

Evidence

  • Final head add3a344: send 46/46, affected Oxlint and plugin test types passed.
  • Reused from b96cb404: SDK 97/97, monitor 25/25, shared-client 25/25; these test files are unchanged. These are prior-head executions, not a new 193-case run.
  • Exact-head mock-export, dependency-deadcode and export-deadcode checks passed. Independent source review found no actionable issue.
  • The staged predecessor's full line counter passed with four lines of headroom. Final source and allocation both shrink by two lines, retaining that headroom by arithmetic; no final-head counter rerun is claimed.

Remaining local failure: the unused-file scan reports test/scripts/fixtures/mantis-telegram-failure.mts. Its existing test launches it as a subprocess; the fixture, caller and Knip inputs are unchanged from the frozen base. This is a source-attributed missing entry declaration, not proof of a failing baseline run. Follow-up: register Mantis subprocess fixture as Knip entry. The failed gate remains recorded.

Focused proof ran on macOS using the pinned Bun runtime after remote capacity was unavailable; no Linux or live Matrix result is claimed. Exact-head CI passed. The ClawSweeper review reports no findings, pre-merge actions or remaining rank-up moves. Merge awaits Vincent’s approval.

Measured focused case durations
Suite Cases Sum of case durations Execution head
send 46 0.962 s add3a344
SDK 97 4.132 s b96cb404
monitor 25 0.029 s b96cb404
shared client 25 0.673 s b96cb404

These are measured case durations, not end-to-end command times or a performance comparison.

@vincentkoc vincentkoc self-assigned this Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review September 23, 2026 09:00
@openclaw-barnacle openclaw-barnacle Bot added channel: matrix Channel integration: matrix size: S labels Sep 23, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces copied Matrix readiness policy with configurable test outcomes and removes mock-manufactured shutdown assertions.

Example: Sending file:///tmp/secret.png when room preparation fails after loading.

  • Before: The fixture recreated encryption policy to manufacture the rejection.
  • After: The fixture supplies a readiness error, and the test verifies that the same error escapes without upload, send, or dispatch notification.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused test cleanup with no identified defect; evidence is reported in-process execution, and broad exact-head CI remains pending.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only cleanup requires no new live Matrix demonstration; reported focused executions cover the changed fixture paths, with prior-head sibling proof explicitly identified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-approved scope removes misleading test evidence while preserving coverage at the responsible production boundaries.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR provides useful test cleanup, with no actionable defect found at the reviewed head; exact-head CI remains pending.

Priority: P3
Reviewed head: add3a344a403ecf59b0caa0ea8d9430fc7ffc2fc

Before merge

None.

Findings

None.

Agent review details

How this fits together

Matrix outbound tests exercise message preparation and media uploads through sendMessageMatrix; monitor tests exercise shutdown callbacks, while SDK and shared-client suites own encryption policy and client retirement.

flowchart TD
  A[Send fixtures] --> B[Matrix send owner]
  B --> C[SDK readiness boundary]
  C --> D[Upload and message effects]
  E[Monitor fixtures] --> F[Monitor retirement callbacks]
  F --> G[Shared client retirement owner]
Loading

Technical review

Best possible solution:

Merge the focused fixture cleanup once the existing exact-head CI gates permit it.

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

No runtime bug is claimed; source inspection confirms copied readiness policy and a shutdown assertion driven by its own mock.

Is this the best way to solve the issue?

The change uses existing owners, removes copied policy, and retains distinct rejection, payload, and lifecycle contracts without adding production machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 52da7f61d3aa.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Tests +6, Other +1. Total +7 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 88 82 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 5 89 82 +7

Review metrics

Metric Value Why it matters
Production versus test LOC Production +0/-0; tests +88/-82, net +6 Growth buys isolated fixture clients and explicit failure/payload assertions; the separate allocation exactly matches it.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove merge-risk: 🚨 automation: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is test maintenance with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (6 earlier review cycles)
  • reviewed 2026-09-23T10:14:33.312Z sha e74eebf :: needs maintainer review before merge. :: none
  • reviewed 2026-09-23T10:29:00.650Z sha e74eebf :: needs maintainer review before merge. :: none
  • reviewed 2026-09-23T10:50:34.943Z sha 0cd4262 :: blocked before merge. :: none
  • reviewed 2026-09-23T14:33:19.285Z sha a359e09 :: blocked before merge. :: none
  • reviewed September 27, 2026, 8:36 PM ET / September 28, 2026, 00:36 UTC (Revision 5) sha unknown :: blocked before merge. :: none
  • reviewed 2026-10-08T08:08:55.340Z sha a359e09 :: blocked before merge. :: none

Reviewed November 4, 2026, 12:24 AM ET / 05:24 UTC (Revision 7).

@vincentkoc
vincentkoc marked this pull request as draft September 23, 2026 10:41
@vincentkoc vincentkoc changed the title refactor(matrix): remove copied policy from send and monitor tests refactor(matrix): simplify fixtures and isolate steering retries Sep 23, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 23, 2026
@vincentkoc vincentkoc changed the title refactor(matrix): simplify fixtures and isolate steering retries refactor(matrix): exercise inbound fixtures through the real runner Sep 23, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Sep 28, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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. labels Oct 8, 2026
@vincentkoc vincentkoc changed the title refactor(matrix): exercise inbound fixtures through the real runner refactor(matrix): simplify send and shutdown test fixtures Nov 4, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 4, 2026 05:18
@clawsweeper

clawsweeper Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment @clawsweeper review. Please avoid repeated requests while a review is queued or running; agents should not request reviews automatically.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head add3a34. The reconciled scope is four Matrix test/support files plus the exact six-line allocation. The prior runner/trace migration and its trace-validation rank-up work are outside this scope; those paths remain at the frozen base. The PR body records fresh send proof, unchanged sibling proof, measured case durations, types/static results, and the investigated Knip subprocess-entry failure. Exact-head CI is now running.

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 4, 2026
@vincentkoc
vincentkoc merged commit 642fd21 into main Nov 6, 2026
204 checks passed
@vincentkoc
vincentkoc deleted the test/matrix-suite-cleanup-20260923 branch November 6, 2026 16:07
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 7, 2026
…156383)

* refactor(matrix): test send preparation at the SDK boundary

* refactor(matrix): remove simulated decrypt-drain assertions

* fix(matrix): preserve send fixture recovery contracts

* fix(matrix): isolate steering fixture retries

* refactor(matrix): exercise real inbound turn ownership

* test(matrix): simplify send and shutdown fixtures

* test(matrix): reference typed preparation mocks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: matrix Channel integration: matrix P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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