Skip to content

test: align matrix preview and Codex hook-order tests with current contracts - #173108

Merged
steipete merged 1 commit into
mainfrom
test/main-reds-matrix-codex-hooks
Oct 15, 2026
Merged

steipete merged 1 commit into
mainfrom
test/main-reds-matrix-codex-hooks

Conversation

@steipete

@steipete steipete commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes two inherited test failures exposed by broad CI run 38729325262 for the package.json-only dependency PR #172381.

User Impact

No production behavior changes. Matrix diagnostics retain character counts without message previews, and Codex retains stable system policy before changing hook context.

Why This Change Was Made

Both are test-oracle repairs. No test is skipped or deleted, and no runtime, configuration, SDK, or persisted-data contract changes.

Evidence

  • Original failures: Matrix job 116403883836 and Codex job 116403883934.
  • Reproduced on fresh main 8b15f79f4f44: extensions/matrix/src/matrix/monitor/handler.test.ts had 1 failure / 60 passes; extensions/codex/src/app-server/run-attempt.bounded-continuity.test.ts had 1 failure / 1 pass, with the same assertions as CI.
  • After repair, node scripts/run-vitest.mjs extensions/matrix/src/matrix/monitor/handler.test.ts extensions/codex/src/app-server/run-attempt.bounded-continuity.test.ts --maxWorkers=1 passed all 63 tests. Matrix: 61/61, 18.83 seconds; Codex: 2/2, 38.21 seconds; combined wrapper wall time 62.65 seconds. These are existing production-boundary suites, with most file duration in transformation/imports.
  • After rebasing onto main 3493a6f08917, both files passed again at PR head ec26410dfc08b0bf2a48c696dc9d330b73af8543: Matrix 61/61 (55.18 seconds) and Codex 2/2 (117.91 seconds), with 209.14 seconds combined wrapper wall time.
  • Only these two test files changed; repository reference search found no test importing either file.
  • Targeted oxfmt, oxlint with extensions/tsconfig.json, line-cap ratchet, and git diff --check passed. Independent isolated Codex autoreview completed one P0–P2 pass: scoped-clean, no accepted/actionable findings.
  • Exact-head CI run 38731790258 succeeded at ec26410dfc08b0bf2a48c696dc9d330b73af8543: 23 jobs passed, including openclaw/ci-gate, and 31 jobs were scope-skipped. Hosted lint, test types, architecture, baseline ratchets, and smoke checks passed.
  • The target test bundle explicitly passed Matrix 61/61 and Codex 2/2, including both formerly failing cases. Matrix file duration: 22.57 seconds (24.08-second wrapper); Codex file duration: 74.10 seconds (75.78-second wrapper). No CI retries were requested.

Commit 912a3e0 intentionally replaced Matrix message previews with
character counts. Require the 205-code-unit diagnostic and reject the
former content preview.

Commit 8da316f intentionally placed changing Codex hook context after
stable system policy. Preserve exact context order, hook-call counts,
continuity projection, and turn input assertions in the fallback fixture.

Both stale assertions failed in broad CI run 38729325262 and reproduced
on main 8b15f79. The repaired files pass locally: Matrix 61/61 and
Codex 2/2. Targeted lint, formatting, whitespace, and P0-P2 autoreview pass.
@clawsweeper

clawsweeper Bot commented Oct 15, 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.

@steipete
steipete marked this pull request as ready for review October 15, 2026 12:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T12:06:21.473989Z ec26410 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR updates Matrix diagnostic and Codex hook-order assertions to match intentional production changes.

Example: A Matrix fixture receives 199 ASCII characters followed by 🚀tail.

  • Before: The test incorrectly requires a message-content preview.
  • After: The test requires chars=205 and rejects the former preview.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused harness and CI evidence supports a correct, useful test-only repair; shipped-entry-point proof is unnecessary for this scope.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only repair changes no shipped behavior; source inspection verifies the expected contracts and exact-head CI confirms successful validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Obsolete expectations fail CI despite production following intentional diagnostic and prompt-order contracts.
Reason: Both expectation repairs are source-verified, preserve meaningful coverage, and add no product behavior or approval requirement.

Merge readiness

✅ Ready for maintainer review

Keep this PR open for landing: both test-oracle repairs match current production contracts, exact-head CI passed, and no actionable defect was found.

Priority: P3
Reviewed head: ec26410dfc08b0bf2a48c696dc9d330b73af8543

Before merge

None.

Findings

None.

Agent review details

How this fits together

These suites exercise the Matrix inbound handler and Codex attempt pipeline using synthetic events and hook results, then inspect diagnostics and outgoing protocol requests.

flowchart LR
A[Matrix event fixture] --> B[Matrix inbound handler]
B --> C[Diagnostic assertions]
D[Prompt hook fixture] --> E[Codex attempt pipeline]
E --> F[Thread request assertions]
Loading

Technical review

Best possible solution:

Land these focused expectation repairs while retaining the existing production contracts and surrounding regression assertions.

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

Current-main production code contradicts both original expectations, and the PR records matching pre-repair failures; no tests were executed during this read-only review.

Is this the best way to solve the issue?

The narrow assertion changes follow independently verified production intent and preserve hook counts, continuity projection, exact turn input, and llm_input coverage.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8bc4915e29bc.

Provenance checked

  • Matrix diagnostic expectation changes intended behavior with a stated reason (18e8076: The original regression protected UTF-16-safe previews; the later merged privacy change intentionally eliminated previews altogether.)
  • Codex hook-order expectation changes intended behavior with a stated reason (fb55609: The retained fixture checked hook application and continuity without duplication; the later merged policy/context split intentionally changed native instruction ordering.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 912a3e0 adds extensions/matrix/src/matrix/monitor/handler-context.ts:288 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 912a3e0df69d; files: extensions/matrix/src/matrix/monitor/handler-context.ts)
  • Matuno: Raw commit 8da316f adds extensions/codex/src/app-server/run-attempt-start.ts:47 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8da316f85d87; files: extensions/codex/src/app-server/run-attempt-start.ts)

PR surface

Tests -2. Total -2 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 5 7 -2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 5 7 -2

Labels

Label changes:

  • add P3: Focused test maintenance restores valid coverage without changing user-facing behavior.
  • 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.

Label justifications:

  • P3: Focused test maintenance restores valid coverage without changing user-facing behavior.
  • 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.

Reviewed October 15, 2026, 8:31 AM ET / 12:31 UTC.

@steipete
steipete merged commit 45863d4 into main Oct 15, 2026
185 of 188 checks passed
@steipete
steipete deleted the test/main-reds-matrix-codex-hooks branch October 15, 2026 12:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…w#173108)

Commit 42b2fff intentionally replaced Matrix message previews with
character counts. Require the 205-code-unit diagnostic and reject the
former content preview.

Commit 729743d intentionally placed changing Codex hook context after
stable system policy. Preserve exact context order, hook-call counts,
continuity projection, and turn input assertions in the fallback fixture.

Both stale assertions failed in broad CI run 38729325262 and reproduced
on main 4590c4a. The repaired files pass locally: Matrix 61/61 and
Codex 2/2. Targeted lint, formatting, whitespace, and P0-P2 autoreview pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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