Repository navigation
fix: keep reply tests inside owned state - #132937
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 3:51 AM ET / 07:51 UTC. ClawSweeper reviewWhat this changesThe branch replaces shared temporary-path and resolver mocks in five auto-reply test files with lifecycle-owned OpenClaw test state and containment assertions. Merge readinessKeep open for maintainer handling: the PR remains a distinct test-isolation repair on current main, has no introduced correctness or security defect found, and exact-head checks are still incomplete. Priority: P3 Review scores
Verification
How this fits togetherAuto-reply tests configure a workspace and session store before invoking reply setup, native command handling, and session access. The test-state helper owns those paths and cleans them up after each scenario. flowchart LR
A[Test configuration] --> B[Owned test state]
B --> C[Workspace and session paths]
C --> D[Auto-reply setup]
D --> E[Reply and session assertions]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -2, Tests -45. Total -47 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the shared owned-state helper and containment assertions, then complete exact-head CI and maintainer review before landing. Do we have a high-confidence way to reproduce the issue? Not applicable to a user-facing bug: this PR repairs test fixture ownership, and its body supplies focused test evidence rather than a product-runtime reproduction. Is this the best way to solve the issue? Yes. Reusing the lifecycle-owned test-state helper at the workspace and session-path boundary is preferable to maintaining local resolver overrides and parallel cleanup paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 93468cbbbdd9. LabelsLabel 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
HistoryReview history (2 earlier review cycles)
|
a898fb9 to
4acf1fe
Compare
4acf1fe to
9ba6eee
Compare
|
Maintainer verification is complete for The fixture producer was the problem: fast reply initialization bypassed the mocked full initializer, leaving shared absolute workspace/session paths reachable through real filesystem and SQLite owners. The five-file repair uses the existing lifecycle-owned test state, removes stale resolver/initializer mocks, and checks containment before reply execution. It preserves the earlier block-fixture isolation from #132960 without keeping competing temporary-root owners. Fresh current-head proof passed 119/119 tests across nine files, with no skipped cases: 91 reply tests, 15 existing Code Mode recovery tests, and 13 client-tool cases. Core typechecking, formatting and diff checks passed. The complete classified aggregate passed on the previous head, and all five changed file blobs plus the full reviewed patch remained identical through the mechanical rebase. The independent isolated Codex P0 review therefore still covers those exact bytes. The original failed merge-ref CI run is preserved, not hidden by a retry. It inherited a missing metadata import from main. The canonical import repair in #133155, contributed by @edenfunf, is now in this branch's base. The fresh exact-head CI run 33299918241, attempt 1 completed successfully. The latest ClawSweeper review found no introduced correctness or security defect. Its remaining check-completion and normal-maintainer-handling steps are now satisfied. Native review artifacts validated and Current local proof commands: node --import ./scripts/tsx.mjs scripts/test-projects-serial.mts src/auto-reply/reply.block-streaming.test.ts src/auto-reply/reply/get-reply.fast-path.test.ts src/auto-reply/reply/get-reply.turn-model-selection-differential.test.ts src/auto-reply/reply/get-reply.message-hooks.test.ts src/auto-reply/reply/get-reply.auto-fallback.test.ts src/auto-reply/reply/get-reply.reset-hooks-fallback.test.ts src/auto-reply/reply/get-reply.config-override.test.ts src/agents/embedded-agent-runner/run/code-mode-reconciliation.test.ts src/agents/embedded-agent-runner/run/attempt-client-tools.test.ts -- --passWithNoTests=false --reporter=default --reporter=jsonnode scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfoOPENCLAW_TESTBOX=1 scripts/pr prepare-run 132937Production +0/-0; tests/support +254/-301, net -47. This is test-isolation proof, not live provider, channel, UI, or deployment verification. Proceeding through the native pinned-head merge gate. |
|
Merged via squash.
|
Additional instructions
This is a same-repository branch so maintainers can update it directly.
What Problem This Solves
Resolves a problem where developers running auto-reply tests could read or create shared temporary session and workspace state instead of using the test's owned fixtures. This made the affected tests depend on other runs and could contaminate shared temporary directories.
Why This Change Was Made
Remove the hardcoded agent/workspace resolver overrides and let the tests exercise canonical path resolution. Real-I/O cases now use the existing owned-state fixture and its cleanup lifecycle, while keeping fast mode and real SQLite accessors intact.
Containment assertions check the actual resolved workspace and SQLite destination before reply execution. Obsolete full-initializer data and superseded direct-module mocks are removed rather than maintaining parallel mock paths. Production behavior, configuration, schemas, dependencies, timeouts, and cache policies are unchanged by this PR.
The earlier conflict repair incorporates #132960 (shared-temporary-state test isolation). Its block-streaming safety outcome is preserved through the canonical OpenClaw test-state helper instead of maintaining a second temporary-directory lifecycle. The shared resolver overrides and the remaining real-I/O fixtures still needed this repair.
User Impact
No user-facing runtime change from this PR. The affected reply tests use private, lifecycle-owned state while retaining their callback, final-payload, model-selection, native-status, and full/prepared-runtime expectations.
Evidence
Current head:
9ba6eee2c80ddd87974a7a63103815198ca03e98, mechanically rebased ontobe5e79ca4713c33a11ccd56b2d728c19f0779f3d. All five changed file blobs and the complete patch are byte-identical to the previously reviewed repair at4acf1fe5d37f32f45714040023376f8452bc23d4.Fresh current-head proof
git diff --checkpassed. Source identity remained unchanged throughout proof.get-reply.test-mocks.tsas runtime by filename, but it is test support; its actual consumer behavior is covered.Retained proof and CI recovery
coreandcoreTestsaggregate passed on4acf1fe5d37f32f45714040023376f8452bc23d4in 451.498 seconds. That full aggregate remains prior-head evidence; the current head has the fresh focused proof above and requires new exact-head CI for integration.35c56e886b43c4f19e0150f8dcf635b40c874b1a4fd439197cc5f02ea2b73d45. No semantic edits were made during this rebase.main. The upstream metadata extraction had movedgetPluginToolSideEffectOwnerKeybut missed the import incode-mode-reconciliation.ts; build, lint, type, and package-boundary jobs failed with the same missing export. All failed-job logs and original proof are retained.be5e79ca4713c33a11ccd56b2d728c19f0779f3d. This PR inherits that landed fix rather than duplicating it. The rebase was triggered by failed merge-ref CI, not merely movingmain; the old immutable failed run was not retried.Executed current-head behavior command:
Executed current-head typecheck:
This is test-only proof; no live provider, channel, or UI verification is claimed. AI-assisted implementation and review.