Repository navigation
fix: keep embedded-run tests inside owned state - #133209
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 5:11 AM ET / 09:11 UTC. ClawSweeper reviewWhat this changesThe PR replaces a fixed embedded-run test workspace with per-test owned state and ensures delayed queued test work settles before fixture cleanup. Merge readinessKeep open for routine maintainer handling. This is a coherent test-only isolation repair, no blocking defect was found in the introduced change, and current main does not already contain the branch’s changed test files; the maintainer-owned item and protected label rule out automated cleanup closure. Priority: P3 Review scores
Verification
How this fits togetherEmbedded-agent integration tests call the runner using fixture workspace, state, and session paths. The runner may invoke native metadata and repository discovery even when later attempt behavior is mocked, so the fixture must own those inputs until queued work settles. flowchart LR
Suites[Embedded-run test suites] --> Fixture[Owned test state]
Fixture --> Params[Runner parameters]
Params --> Runner[Embedded agent runner]
Runner --> Readers[Metadata and repository readers]
Runner --> Queue[Queued test work]
Queue --> Cleanup[Fixture cleanup]
Decision needed
Why: The patch is test-only and has no supported correctness blocker, but the current maintainer label and author association require explicit maintainer handling rather than automated closure. Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +275, Tests +74. Total +349 across 25 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Retain the single owned-state fixture flow and land it once the exact-head required checks complete successfully. Do we have a high-confidence way to reproduce the issue? Not applicable: the reported failure is test-fixture ownership, and the PR supplies source-level boundary coverage rather than a user-facing defect reproduction. Is this the best way to solve the issue? Yes. Binding the existing parameter factory and warmup to OpenClawTestState fixes ownership at the fixture producer, while the guard and queue join cover the native-reader and delayed-work paths without production seams. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8243cc8a361c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Maintainer review is complete for head The final parent run passed 104 tests across all seven entrypoints, zero failures or skips. Its 79-case aggregate executed all sixteen imported suites in their original order. Safe original auth and shared-warmup failures were captured before unowned filesystem delegation. Real SQLite reconciliation/reopen, scoped handle cleanup, pending-backend assertions and failure-safe deferred-work joins remain covered. Complete classified checks passed; after bounded cleanup, the parent reran all 104 cases and scoped lint. Canonical isolated Codex P0 review and the independent consumer-contract check found no actionable issue. ClawSweeper's requested maintainer handling and green-check conditions are satisfied. Its separate stored-data warning is a false positive: The 25-file fixture scope and nine critical owner/entrypoint paths were unchanged between tested base This remains synthetic fixture proof. No live provider, Codex, Gateway or channel behavior changed or was claimed verified. Proceeding through repository-native merge enforcement under the existing repair-and-land request. |
|
Merged via squash.
|
Recognize colocated test-support files at the shared persistence and SQLite classifier boundary while preserving production, rename, and incomplete-evidence warnings. Regress the exact 57-line fixture from openclaw/openclaw#133209; production LOC remains net zero.
Additional instructions
Keep Allow edits from maintainers enabled. This branch is in the upstream repository.
Related: #133131 (prepared-model fixture ownership).
What Problem This Solves
Resolves a problem where running the shared embedded-agent tests could inspect a fixed workspace outside the test's temporary state, despite downstream runtime work being mocked. Timeout cases also treated the caller's timeout rejection as completion even when an ignored-cancellation backend was still using the fixture.
This is a maintainer-requested test-isolation repair, not a change to shipped agent behavior.
Why This Change Was Made
Replace the path-bearing module constant with
createOverflowRunParams(state)and migrate the complete consumer family to canonicalOpenClawTestStatelifetimes. Keep config, agent-directory and session-file omissions, stable logical IDs, generation identity, real SQLite/reopen assertions and the original sixteen-module aggregate order. Warmup owns disposable state without resetting its environment, and the shared loader retains only the loaded runner.Cleanup now joins actual queued callbacks after an early timeout, releases held attempts in
finally, and settles deferred fast-mode work before removing state. Lexical guards reject unowned paths before native metadata/repository readers and retain violations even when discovery swallows an exception. No broader filesystem/auth mock, production drain API, new runtime flag, or larger timeout is introduced. Nearby cleanup removes an exact duplicate provider predicate and reuses canonical lexical containment.User Impact
No production behavior, configuration, database schema, protocol or dependency changes. Developers can run these tests without the shared fixture selecting an unrelated workspace or deleting state beneath still-running test work. Synthetic harness assertions remain synthetic; this PR makes no live provider, Codex, Gateway or channel verification claim.
Production LOC: +0/-0. All changed lines are tests or test support, including the
.harness.tsfile that the automated lane classifier treats as core production. The growth is fixture acquisition/cleanup, failure-safefinallyblocks and boundary regression evidence, not new runtime machinery.Evidence
beforeAll; its 79 cases were not executed in that RED run. A diagnostic run with an incorrect old-signature argument is retained separately and is not counted as intended regression evidence.Native test targets, all run with Node 24.15.0, pinned pnpm 12.1.0 and clean-whitelist private HOME/state/config/XDG/TMP roots outside Git. Reporter/output-path arguments are omitted here; separate native JSON reports and exact launch receipts are retained locally.
The parent's first formatter launch failed during package-manager version preflight because it inherited a different checkout's working directory. Binding the launcher to this task checkout fixed the preflight; no source formatter or test ran in that failed attempt. It is not a product failure or a dependency change.