Repository navigation
fix(ci): restore approval resource fixture coverage - #170772
Conversation
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesRoutes the approval resource test suite through the existing fork-based database-worker project. Example: Run the three approval resource cases: overlap, cancel-drain, and route-drift.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a concrete test-routing failure still present on main, preserves credential custody checks, and introduces no actionable defect. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherVitest routing assigns test files to execution projects; the database-worker registry selects forked processes for fixtures that require host-owned SQLite custody. flowchart LR
A[Test runner] --> B[Test routing registry]
B --> C[Infra fork project]
C --> D[Approval resource fixture]
D --> E[Credential custody owner]
E --> F[Existing resource assertions]
Technical reviewBest possible solution: Land the routing entry while retaining the existing fixture, assertions, and production custody enforcement. Do we have a high-confidence way to reproduce the issue? The fixture's synchronous credential write and the unadmitted-thread rejection establish the failure path; the author reports matching before-and-after runs, and this read-only review executed no tests. Is this the best way to solve the issue? Using the existing fork-project registry fixes execution ownership without weakening credential enforcement or changing test expectations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3f1a962d4488. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +1. Total +1 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 13, 2026, 4:07 AM ET / 08:07 UTC. |
|
Landed as 72e0482. |
## What Problem This Solves Fixes three approval-intent resource tests failing before inference because their credential fixture runs in an unhosted worker thread. ## User Impact No production behavior change, migration, or operator action. Approval overlap, cancellation-drain, and credential-rotation coverage runs again with its existing assertions. ## Why This Change Was Made Route the resource test through the existing database-worker project, alongside other native credential fixtures that require host-owned offline writer custody. The test, shared fixture, production custody checks, timeouts, and concurrency assertions are unchanged. The stale test routing was exposed by `c3b5d0c7bc15f2f497247c3127cfa844d34c6e74` (openclaw#170632), which introduced `src/agents/auth-profiles/credential-write-custody.ts:71-72`. The direct fixture write at `src/test-utils/openclaw-test-state.ts:355`, called from `src/system-agent/approval-intent.resources.test.ts:120`, cannot acquire that custody in an ordinary Vitest thread. This adds the missing routing entry rather than weakening the credential boundary. Memory background reload is intentionally not changed: openclaw#170612 already contains its maintainer-owned fixture repair. ## Evidence On main `116f0502239e7f1cd4a85f57331f986f616e8939`: - `node scripts/run-vitest.mjs src/system-agent/approval-intent.resources.test.ts src/plugins/memory-background-reload.test.ts` stopped in the first shard: all 3 approval resource cases failed with `Auth profile credential writes require an admitted worker` (23.86 s wrapper). After the routing repair and rebasing onto main `7f29537f79a`: - `node scripts/run-vitest.mjs src/system-agent/approval-intent.resources.test.ts src/system-agent/approval-intent.test.ts src/system-agent/verified-inference.test.ts test/vitest-scoped-config.test.ts test/vitest-cli-ownership.test.ts`: **68 passed across 5 files** (68.03 s wrapper). This includes all 3 resource cases, 31 approval/verified-inference sibling cases, and 34 routing cases. - `pnpm exec oxfmt --check test/vitest/vitest.database-worker-core-paths.mjs`: passed. - `node scripts/run-oxlint.mjs test/vitest/vitest.database-worker-core-paths.mjs`: passed. No assertions, retries, or timeouts changed. No production code changed. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes three approval-intent resource tests failing before inference because their credential fixture runs in an unhosted worker thread.
User Impact
No production behavior change, migration, or operator action. Approval overlap, cancellation-drain, and credential-rotation coverage runs again with its existing assertions.
Why This Change Was Made
Route the resource test through the existing database-worker project, alongside other native credential fixtures that require host-owned offline writer custody. The test, shared fixture, production custody checks, timeouts, and concurrency assertions are unchanged.
The stale test routing was exposed by
50414196f1912053abee1ddcab595fca3c7e7889(#170632), which introducedsrc/agents/auth-profiles/credential-write-custody.ts:71-72. The direct fixture write atsrc/test-utils/openclaw-test-state.ts:355, called fromsrc/system-agent/approval-intent.resources.test.ts:120, cannot acquire that custody in an ordinary Vitest thread. This adds the missing routing entry rather than weakening the credential boundary.Memory background reload is intentionally not changed: #170612 already contains its maintainer-owned fixture repair.
Evidence
On main
0348a2526c561d8ccce61bfd23931024a6b8f13e:node scripts/run-vitest.mjs src/system-agent/approval-intent.resources.test.ts src/plugins/memory-background-reload.test.tsstopped in the first shard: all 3 approval resource cases failed withAuth profile credential writes require an admitted worker(23.86 s wrapper).After the routing repair and rebasing onto main
c1f504ab456:node scripts/run-vitest.mjs src/system-agent/approval-intent.resources.test.ts src/system-agent/approval-intent.test.ts src/system-agent/verified-inference.test.ts test/vitest-scoped-config.test.ts test/vitest-cli-ownership.test.ts: 68 passed across 5 files (68.03 s wrapper). This includes all 3 resource cases, 31 approval/verified-inference sibling cases, and 34 routing cases.pnpm exec oxfmt --check test/vitest/vitest.database-worker-core-paths.mjs: passed.node scripts/run-oxlint.mjs test/vitest/vitest.database-worker-core-paths.mjs: passed.No assertions, retries, or timeouts changed. No production code changed.