Repository navigation
refactor(macos): consolidate node runtime test fixtures - #118521
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 2:06 AM ET / 06:06 UTC. ClawSweeper reviewWhat this changesThe PR replaces several duplicated macOS node-runtime service fixtures and repeated bridge-request construction with one configurable probe and typed helper methods, preserving the existing test cases and assertions. Merge readinessThis is a focused test-only refactor with no blocking correctness or security finding in the reviewed patch. It remains necessary because current main still contains the repeated fixtures; the protected Priority: P3 Review scores
Verification
How this fits togetherThe macOS node runtime accepts bridge invocation requests from paired nodes and delegates screen, recording, location, and computer-control work to main-actor services. This test suite injects those services to verify request translation, lifecycle invalidation, and response behavior without using the live desktop services. flowchart LR
A[Paired node request] --> B[macOS node runtime]
B --> C[Main-actor service contract]
C --> D[Screen, recording, and computer control]
D --> E[Bridge response]
F[Injected test probe] --> C
F --> G[Lifecycle and request assertions]
Decision needed
Why: The patch is mechanically sound from source review, but the Before merge
Agent review detailsSecurityNone. PR surfaceOther -205. Total -205 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one configurable test probe as the canonical fixture for this protocol, preserving the existing lifecycle and payload-bound assertions; merge after the macOS Swift validation confirms the exact head. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors test fixtures rather than reporting a user-facing defect. The contributor provides a focused 30-test Swift execution result, and the reviewed source retains the existing test inventory. Is this the best way to solve the issue? Yes. Consolidating identical protocol conformances behind one configurable test probe is the maintainable owner-boundary solution because the runtime protocol remains unchanged and the existing behavior-sensitive assertions stay covered. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6f6d501ccf9a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Maintainer land-ready review completed on exact head
The canonical fix stays in the test owner boundary: one complete configurable service probe plus two request helpers. It removes duplicate conformances without changing the production runtime or protocol and preserves catalog, canvas, screen, recording, computer action, concurrency, lifecycle, and payload-bound coverage. Ready for native prepare and merge. |
|
Merged via squash.
|
What Problem This Solves
The macOS node-runtime tests repeated the complete
MacNodeRuntimeMainActorServicesconformance across four fixtures and rebuilt the same invoke envelope throughout the suite. Protocol changes therefore required synchronized edits in unrelated test cases and made the runtime contract harder to audit.Why This Change Was Made
Use one configurable main-actor services probe for screen, recording, and computer-control behavior, plus typed and raw invoke helpers for request construction. The concurrency gates, lifecycle-generation tracking, callback observations, catalog-worker behavior, payload limits, and all assertions stay unchanged.
User Impact
No user-visible behavior changes. This removes 205 test lines and makes future macOS node-runtime contract changes less error-prone.
Evidence
swift test --package-path apps/macos --build-system native -j 4 --filter MacNodeRuntimeTests— 30/30 passed.git diff --check— clean.#expectlines are byte-identical and remain in source order.tbx_01kz334gm1wfgtpg8jsjg731qx— changed-path gate passed: https://github.com/openclaw/openclaw/actions/runs/30788599380019fc635-779b-7a80-bf01-1287208187a0— no findings, correctness 0.99.LOC: production +0/-0; tests +150/-355 (net -205).