Repository navigation
test(auto-reply): preserve plugin hook runner lifecycle exports - #117647
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 5:40 PM ET / 21:40 UTC. ClawSweeper reviewWhat this changesThe PR changes the shared reply-directive Vitest mock to spread the real plugin hook-runner exports before overriding the three hooks that these tests intentionally control. Merge readinessKeep this PR open for normal maintainer merge handling. The branch repairs a real test-order regression by retaining the hook-runner module’s newly required lifecycle export, and the Priority: P2 Review scores
Verification
How this fits togetherReply-directive tests install a shared module mock before exercising command behavior. In the same non-isolated Vitest process, bundled-plugin activation later reads the hook-runner registry export, so the mock must preserve unrelated lifecycle exports while retaining its test-specific overrides. flowchart LR
A[Reply directive test] --> B[Shared hook-runner mock]
B --> C[Real hook-runner lifecycle exports]
C --> D[Plugin activation]
D --> E[Bundled source-checkout test]
B --> F[Intentional test overrides]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +4. Total +4 across 1 file. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused partial-mock repair after exact-head CI completes, retaining the three explicit test overrides while preserving the hook-runner module’s public lifecycle exports. Do we have a high-confidence way to reproduce the issue? Yes. The source establishes the same non-isolated test order: the reply test installs the shared mock, then bundled-plugin activation calls the omitted export; the PR body provides a matching ordered RED/GREEN terminal transcript. Is this the best way to solve the issue? Yes. A typed partial mock is the narrowest maintainable repair because it retains the three intentional test controls while preserving the module’s real lifecycle surface for later tests. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 47bb0378eb1c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…claw#117647) Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
The non-isolated core unit-fast CI shard deterministically fails bundled-plugin source-checkout activation after a reply directive test leaks an incomplete global hook-runner module mock.
Why This Change Was Made
The registry-bundle refactor added
getGlobalPluginRegistry()to plugin activation, but the existing reply-test support owner replaced the entire hook-runner module with three exports. Reuse the adjacent typedimportOriginalpartial-mock pattern so every real current and future lifecycle export remains available while preserving the three intentional test overrides.User Impact
Unrelated OpenClaw pull requests no longer fail the shared core unit-fast CI shard because of this cross-file test mock. Production behavior is unchanged: exactly one existing test-support owner changes, with no production files or new test files.
Evidence
eefe009a5edc437850dfc57750c3e53cbbed7614; parent:c539192b5cdd8369c16c6be03258cc68deac17ef.src/auto-reply/reply.directive.directive-behavior.e2e-mocks.ts.node scripts/run-vitest.mjs run --config test/vitest/vitest.unit-fast.config.ts src/auto-reply/reply.directive.directive-behavior.shows-current-verbose-level-verbose-has-no.test.ts src/plugins/source-checkout-runtime.test.ts --no-isolate --maxWorkers=1 --fileParallelism=false --reporter=verbose; nine reply tests passed, then the bundled-plugin runtime test failed withNo "getGlobalPluginRegistry" export is defined, pointing tosrc/plugins/loader-shared.ts:349.node scripts/run-vitest.mjs run --config test/vitest/vitest.unit-fast.config.ts src/auto-reply/reply.directive.directive-behavior.shows-current-verbose-level-verbose-has-no.test.ts src/plugins/source-checkout-runtime.test.ts --no-isolate --maxWorkers=1 --fileParallelism=false --no-cache --reporter=verbose; the same nine reply tests run first and the bundled-plugin runtime test then passes: 2 files, 10 tests passed.--no-cacheprevents Vitest's failed-first result cache from reversing the regression order.gpt-5.6-solwith high reasoning and P3 coverage; native TruffleHog 3.96.0 was clean; exit 0, no findings, confidence 0.96.git diff --checkpassed. No production code changed; no full-suite or remote CI result is claimed.