Repository navigation
refactor(tasks): remove test runtime overrides - #155157
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 8:09 PM ET / September 22, 2026, 00:09 UTC (Revision 4). ClawSweeper reviewWhat this changesRemoves test-only task cancellation and delivery overrides and updates fixtures to use module mocks, scoped spies, and normal run admission. Merge readiness✅ Ready for maintainer review Keep open. This remains useful cleanup absent from the pinned main branch, and no actionable correctness or security defect was found. The related recovery campaign does not supersede this focused PR. Priority: P3 Review scores
Verification
How this fits togetherThe task registry tracks background work and routes cancellation and notifications to their existing runtime owners. This change removes alternate test wiring while preserving those production routes and their lazy loading. flowchart TD
A[Task commands and Gateway requests] --> B[Task registry]
B --> C[Lazy runtime loading]
C --> D[Cancellation owners]
C --> E[Notification delivery]
D --> F[Task outcome]
E --> G[Requester session or channel]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -78, Tests -119, Other -3. Total -200 across 36 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one lazy-loaded production path for task control and delivery, with test substitutions confined to fixtures. Do we have a high-confidence way to reproduce the issue? Not applicable: this refactor removes source-visible test-only wiring rather than repairing a reported user-facing defect. Is this the best way to solve the issue? Yes. Existing module mocks and scoped spies replace the alternate production wiring while preserving the real runtime owners and lazy-loading contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 73f058a4e653. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
8e34446 to
cdffb8b
Compare
cdffb8b to
0bc0c10
Compare
0bc0c10 to
4588359
Compare
|
Merged via squash.
|
Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
The task registry carries mutable runtime overrides used only by tests, creating an extra path for task control and delivery.
User Impact
No intended user-visible change. Task cancellation, progress, and delivery retain their existing owners and lazy loading; application and tooling shrink by 80 lines, and tests/support shrink by 119 lines.
Why This Change Was Made
Remove test override setters and duplicate reset plumbing. Tests use their existing module mocks or scoped spies, wait for observable completion, and exercise cancellation through real admission and the Gateway listener. The real runtime contract and lazy-loader cache reset remain intact. The current composition preserves the notification acknowledgment owner introduced in #151815, including both delivery-settlement joins and all 19 state-notification cases. Related: #150153.
Evidence
Original source-bound qualification: https://github.com/openclaw/openclaw/actions/runs/35655127100
The original qualification above is bound to tree
f6792422ef38c30c829ded776c98c8443a763b30and base6615891cc3650b2136fa25c136ac37c8dc111676.The current composition preserves both notification-settlement joins from the upstream maintenance fixture repair. Focused hosted proof passed all 48 cases in the complete maintenance, delivery-lifetime and notification suites in 40.63 seconds. Formatting, lint and the
agents-othertypecheck passed. The initial type selector was rejected before compilation; the corrected type-only continuation passed in 56.41 seconds, without repeating tests. That continuation verified all 47,918 source paths before and after. The original test invocation ended before its final raw-source witness; the later resync does not reconstruct that missing post-test observation. The single lease was stopped and independently confirmed complete.CI 35662022549 failed only the package-manager selection assertion and its derived gate. The branch now includes the canonical test correction, which distinguishes a standalone version pin from measured-version telemetry. All 36 changed-file postimages and normalized deltas are unchanged by this final rebase; new-head CI remains required.
Current head:
4588359d1245c8b75845ee7376b2df2d4a8020eb; tree:97c2d209b3da88e258399d46737eabdd6f2a0fd9; base:73f058a4e653471383c473a93571f043ddc05587.The original 700-case qualification and earlier provider interruption remain historical evidence for their original source. They are not added to the current-source case count. The first current wrapper attempt rejected the gate-base argument before source synchronization or test execution; the corrected canonical source binding passed without changing product code.
CI 35666501929 subsequently exposed three upstream upgrade-survivor fixture failures. The canonical fixture correction is now included: mocked baseline installation/startup invokes the existing normalization owner before the real companion-preparation flow. Production validation and ordering assertions remain unchanged. Its owner reproduced the failures and passed all 62 relevant cases. All 35 executable postimages and 36 normalized deltas remain unchanged in this refresh; fresh head CI is still required.