Repository navigation
fix(test): stop Doctor integrity teardown from breaking commands - #163777
Conversation
Await the scoped session-state cleanup owner before restoring fixture environment selectors and removing the temporary home. This joins session writers, native agent resources, and shared-state cleanup without changing assertions. Fixes red main introduced by d6929f8 (#163378). Its parent passes all 15 tests; the commit reproduces the missing import receipt and file-level custody error. The fix passes five consecutive Node 24 runs and five Bun runs, check-changed, and P2 autoreview.
|
🦞👀 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. |
|
@clawsweeper re-review Red-main fixture repair at 7d0bfbf. The introducing commit and its passing parent are verified, all original assertions remain unchanged, and five consecutive Node and Bun runs pass. Independent P2 autoreview and check-changed pass. The full shared-worker commands run remains in progress as linked in the body. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 5:20 PM ET / 21:20 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Doctor integrity tests await session and database cleanup before restoring their environment and deleting their temporary home. Merge readiness✅ Ready for maintainer review The repair remains necessary on current main. No actionable correctness or security findings remain, and exact-head CI passed. Priority: P2 Review scores
Verification
How this fits togetherDoctor checks and repairs OpenClaw state. Its integrity tests use temporary session databases whose background workers must finish before those fixtures are removed. flowchart TD
A[Doctor integrity tests] --> B[Temporary session databases]
B --> C[Background session workers]
C --> D[Await shared cleanup owner]
D --> E[Restore test environment]
E --> F[Remove temporary home]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -2. Total -2 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Use the existing awaited cleanup owner while preserving the integrity assertions and shared-worker execution. Do we have a high-confidence way to reproduce the issue? Yes, source establishes that the baseline deletes its fixture without awaiting background database retirement, and the PR reports before/after failures and passes. This review did not execute tests. Is this the best way to solve the issue? Yes, using the existing scoped cleanup owner fixes the fixture lifetime without weakening assertions, adding timeouts, or changing production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1fda703fb4d3. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
## What Problem This Solves Commands, Doctor, and infrastructure repeat option forwarding, migration traversal, result projection, and error handling that already have canonical owners. ## User Impact No intended user-visible change. CLI flags, messages, exit codes, JSON output, migration precedence, persisted data, and authorization checks stay unchanged. Supported July 2026-and-later migrations and the older-Gateway node-list fallback remain supported. ## Why This Change Was Made This combines the subsystem cleanup into one batch, removing 1,459 net production lines instead of paying for separate CI runs for each small simplification. - Consolidate onboarding installation, auth selection, migration item selection, and cleanup reporting; retain branch-specific consent and error behavior. - Reuse Doctor's model-slot traversal, parsing, package identification, report projection, and session-key collection instead of parallel implementations and forwarding helpers. - Let status reports consume their existing overview facts directly, and share archive/storage command registration. - Map device-pairing authority refusals at the mutation owner after admission and publication settle; preserve locks, revalidation, cleanup, and each caller's return shape. - Consolidate receipt-authoritative APNs/MCP source cleanup at the source-claim owner, keeping each migration's safe reader and receipt commit. - Remove redundant outbound target forwarding and reuse existing filesystem, normalization, and text helpers. Updater lifecycle, dependencies, schemas, and plugin SDK contracts are unchanged. The native assertion-baseline tool records five removed assertions; no allowance grows. No newly discovered product bugs or flaky-test fixes are included. ## Evidence - Both import-cycle checks passed again on the final rebased head: 0 Madge cycles and 0 runtime-value cycles. - AWS focused run: 3,324 passed, 2 skipped, and one inherited Doctor fixture failure across 174 files. The same failure reproduced on the clean base. The branch now includes the upstream repair from #163777; no duplicate fix is included. - The complete changed-file gate passed, including production/test types, lint, dead exports, boundaries, and ratchets. The final Gateway send rerun passed all 83 tests. Git range-diff confirms the rebase preserved the cleanup patch. - After the final Testbox exceeded the ten-minute queue limit, the local `nice -n 15` confirmation completed with 82 Gateway tests passing and one 120-second timeout in the Telegram live-owner test; Doctor did not run because the first group failed. Native worker compilation took 566 seconds under severe host load. The failure is recorded, not counted as passing proof. - Exact-head CI [37074925001](https://github.com/openclaw/openclaw/actions/runs/37074925001) passed types, lint, architecture, builds, Windows, and most test shards. Five test jobs failed; every failure has matching pre-existing evidence below. The tests and the relevant refusal, worker-admission, session mutation, and cache-validity owners are unchanged by this cleanup. Landing uses the maintainer-authorized inherited-failure exception, pinned to `714c365b1775c10760276a4dbc8bbf05141d4e5d`; no green-CI claim is made. - Independent autoreview is scoped-clean at P0/P1 after supplying unchanged owner context: the early ref-mode branch still enforces env-reference precedence; all migration command entrypoints retain the Codex-only flag guard; the cleanup serializer already normalizes local paths while delegated paths bypass it. Existing tests cover all three contracts. - Blacksmith admission expired before checkout ([run](https://github.com/openclaw/openclaw/actions/runs/37057668205)); validation moved to direct AWS Linux compute. Release-note context: internal cleanup only; no operator action or migration required. ### CI failure attribution | PR job | Failure | Baseline evidence | | --- | --- | --- | | `checks-node-changed-compact-small-18` | `session-reaper.test.ts`: shared exact store discovers `[main]` instead of `[main, ops]` | Same assertion on [main run 37072934260](https://github.com/openclaw/openclaw/actions/runs/37072934260/job/111056682704). | | `checks-node-changed-compact-large-1` | `session-sharing-groups.test.ts`: expected seeded host database to be defined | Same error on [main run 37072934260](https://github.com/openclaw/openclaw/actions/runs/37072934260/job/111056682541). Worker-backed seeding no longer promises an open host database. | | `checks-node-changed-compact-large-21` | `doctor-config-preflight.test.ts`: retired Discord channel `allow` fixture refused | Same test/error on [independent PR run 37071278542](https://github.com/openclaw/openclaw/actions/runs/37071278542/job/111051475776). Discord retirement predates this cleanup. | | `checks-node-changed-1` | `doctor.auth-profile-consumers.e2e.test.ts`: two maintenance-entry refusals | Same cases/error on [independent PR run 37071278542](https://github.com/openclaw/openclaw/actions/runs/37071278542/job/111051475801). The fixture starts asynchronous worker retirement through a synchronous close, then blocks the parent event loop with `spawnSync`. | | `checks-node-changed-compact-large-6` | `session-accessor.sqlite-data-version.test.ts`: identical values lose object identity after transcript append | Same test/identity assertion on [independent PR run 37071278542](https://github.com/openclaw/openclaw/actions/runs/37071278542/job/111051475748). The changed fingerprint parser is used by quarantine-receipt decoding, not this cache validity path. | The session-sharing job additionally failed `rechecks group members at transaction admission for a defaults update`: the mutation correctly rejected revoked authorization, but the broad worker-admission spy observed a commit (`true` instead of `false`). The exact test, error, and assertion at line 409 also failed on [main run 37067275144](https://github.com/openclaw/openclaw/actions/runs/37067275144/job/111038492452), before this PR. It passed in the next hourly main run, so that later pass is not presented as a repair. Its underlying race remains coordinator-owned. No tests, timeouts, assertions, or admission checks have been weakened.
…nclaw#163777) Fix red main introduced by 9d1cf78 (openclaw#163378): the Doctor fixture removed its state before native cleanup settled, breaking import receipt validation and subsequent shared-worker teardown. Await the existing scoped session-state cleanup owner before restoring the environment and deleting the fixture root. Preserve every assertion. Proof: five consecutive 15/15 runs on both Node 24 and Bun; full shared-worker commands config passes 543 files and 6,824 tests (four skipped); check-changed, independent P2 review, exact-head CI, and ClawSweeper pass. Co-authored-by: Peter Steinberger <[email protected]>
…w#163840) ## What Problem This Solves Commands, Doctor, and infrastructure repeat option forwarding, migration traversal, result projection, and error handling that already have canonical owners. ## User Impact No intended user-visible change. CLI flags, messages, exit codes, JSON output, migration precedence, persisted data, and authorization checks stay unchanged. Supported July 2026-and-later migrations and the older-Gateway node-list fallback remain supported. ## Why This Change Was Made This combines the subsystem cleanup into one batch, removing 1,459 net production lines instead of paying for separate CI runs for each small simplification. - Consolidate onboarding installation, auth selection, migration item selection, and cleanup reporting; retain branch-specific consent and error behavior. - Reuse Doctor's model-slot traversal, parsing, package identification, report projection, and session-key collection instead of parallel implementations and forwarding helpers. - Let status reports consume their existing overview facts directly, and share archive/storage command registration. - Map device-pairing authority refusals at the mutation owner after admission and publication settle; preserve locks, revalidation, cleanup, and each caller's return shape. - Consolidate receipt-authoritative APNs/MCP source cleanup at the source-claim owner, keeping each migration's safe reader and receipt commit. - Remove redundant outbound target forwarding and reuse existing filesystem, normalization, and text helpers. Updater lifecycle, dependencies, schemas, and plugin SDK contracts are unchanged. The native assertion-baseline tool records five removed assertions; no allowance grows. No newly discovered product bugs or flaky-test fixes are included. ## Evidence - Both import-cycle checks passed again on the final rebased head: 0 Madge cycles and 0 runtime-value cycles. - AWS focused run: 3,324 passed, 2 skipped, and one inherited Doctor fixture failure across 174 files. The same failure reproduced on the clean base. The branch now includes the upstream repair from openclaw#163777; no duplicate fix is included. - The complete changed-file gate passed, including production/test types, lint, dead exports, boundaries, and ratchets. The final Gateway send rerun passed all 83 tests. Git range-diff confirms the rebase preserved the cleanup patch. - After the final Testbox exceeded the ten-minute queue limit, the local `nice -n 15` confirmation completed with 82 Gateway tests passing and one 120-second timeout in the Telegram live-owner test; Doctor did not run because the first group failed. Native worker compilation took 566 seconds under severe host load. The failure is recorded, not counted as passing proof. - Exact-head CI [37074925001](https://github.com/openclaw/openclaw/actions/runs/37074925001) passed types, lint, architecture, builds, Windows, and most test shards. Five test jobs failed; every failure has matching pre-existing evidence below. The tests and the relevant refusal, worker-admission, session mutation, and cache-validity owners are unchanged by this cleanup. Landing uses the maintainer-authorized inherited-failure exception, pinned to `714c365b1775c10760276a4dbc8bbf05141d4e5d`; no green-CI claim is made. - Independent autoreview is scoped-clean at P0/P1 after supplying unchanged owner context: the early ref-mode branch still enforces env-reference precedence; all migration command entrypoints retain the Codex-only flag guard; the cleanup serializer already normalizes local paths while delegated paths bypass it. Existing tests cover all three contracts. - Blacksmith admission expired before checkout ([run](https://github.com/openclaw/openclaw/actions/runs/37057668205)); validation moved to direct AWS Linux compute. Release-note context: internal cleanup only; no operator action or migration required. ### CI failure attribution | PR job | Failure | Baseline evidence | | --- | --- | --- | | `checks-node-changed-compact-small-18` | `session-reaper.test.ts`: shared exact store discovers `[main]` instead of `[main, ops]` | Same assertion on [main run 37072934260](https://github.com/openclaw/openclaw/actions/runs/37072934260/job/111056682704). | | `checks-node-changed-compact-large-1` | `session-sharing-groups.test.ts`: expected seeded host database to be defined | Same error on [main run 37072934260](https://github.com/openclaw/openclaw/actions/runs/37072934260/job/111056682541). Worker-backed seeding no longer promises an open host database. | | `checks-node-changed-compact-large-21` | `doctor-config-preflight.test.ts`: retired Discord channel `allow` fixture refused | Same test/error on [independent PR run 37071278542](https://github.com/openclaw/openclaw/actions/runs/37071278542/job/111051475776). Discord retirement predates this cleanup. | | `checks-node-changed-1` | `doctor.auth-profile-consumers.e2e.test.ts`: two maintenance-entry refusals | Same cases/error on [independent PR run 37071278542](https://github.com/openclaw/openclaw/actions/runs/37071278542/job/111051475801). The fixture starts asynchronous worker retirement through a synchronous close, then blocks the parent event loop with `spawnSync`. | | `checks-node-changed-compact-large-6` | `session-accessor.sqlite-data-version.test.ts`: identical values lose object identity after transcript append | Same test/identity assertion on [independent PR run 37071278542](https://github.com/openclaw/openclaw/actions/runs/37071278542/job/111051475748). The changed fingerprint parser is used by quarantine-receipt decoding, not this cache validity path. | The session-sharing job additionally failed `rechecks group members at transaction admission for a defaults update`: the mutation correctly rejected revoked authorization, but the broad worker-admission spy observed a commit (`true` instead of `false`). The exact test, error, and assertion at line 409 also failed on [main run 37067275144](https://github.com/openclaw/openclaw/actions/runs/37067275144/job/111038492452), before this PR. It passed in the next hourly main run, so that later pass is not presented as a repair. Its underlying race remains coordinator-owned. No tests, timeouts, assertions, or admission checks have been weakened.
What Problem This Solves
Fixes red main:
doctor-state-integrity.test.tsfails a retained-session receipt assertion and file teardown, then contaminates later files in the shared commands worker.User Impact
No product or update behavior changes. The existing Doctor integrity tests now finish their database cleanup before retiring their temporary state.
Why This Change Was Made
Introduced by
d6929f854d2e9d58b1482aad072cc5da7f4bafcf(#163378), which moved the fixture's session upserts into native workers. The fixture still used synchronous close helpers and immediately deleted its home. A later import's maintenance drain encountered the retained cleanup failure, so compaction failed and the verified receipt was correctly withheld; final file drainage failed for the same reason.Await the existing scoped session-state cleanup owner before restoring the environment and deleting the fixture root. Every assertion is unchanged, including canonical repair, the continued absence of deleted rows, original source bytes, and the import receipt. The existing test guards the regression; no additional test or production path is needed.
Evidence
4e9dec17f323e8d4839d3668bf25c138cb87be4epasses 15/15; the introducing commit reproduces both failures (14/15 plus file-level ENOENT). Current-main baseline reproduces the same failures.node scripts/check-changed.mjscompleted with captured exit 0, including the affected Doctor test type graph and lint.7d0bfbfee01232bcdecbbc54dc4ea1c9b1467df5with no actionable findings.