Repository navigation
fix(test): prepare remaining approval fixtures before requests - #155589
Conversation
|
🦞👀 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 Current head: |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 5:20 AM ET / 09:20 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR prepares approval-test database workers before request deadlines begin, updates asynchronous fixture callers, and strengthens the pending-approval assertion without changing production behavior. Merge readiness✅ Ready for maintainer review The remaining fixture repair is still useful and has no actionable findings. The previous conflict concern is resolved, and the final files preserve the previously reviewed implementation. Priority: P2 Review scores
Verification
How this fits togetherGateway approval tests send command requests through real approval handlers and SQLite storage. Their fixtures control setup and cleanup so startup time does not consume the approval window being tested. flowchart LR
A[Test case] --> B[Prepare SQLite worker]
B --> C[Create approval request]
C --> D[Approval handlers and storage]
D --> E[Visibility and decision assertions]
E --> F[Drain requests and clean up]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -4. Total -4 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use the shared prepared fixture consistently while preserving real storage, unchanged approval deadlines, and request-lifetime cleanup. Do we have a high-confidence way to reproduce the issue? Yes, source establishes that an unprepared worker can consume the request's existing deadline, and the body records a delayed-worker control. This read-only review did not execute that reproduction. Is this the best way to solve the issue? Yes. Reusing the existing readiness owner removes startup cost from the tested approval window without weakening assertions, increasing deadlines, or adding a competing fixture implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4cbde45ab1c3. 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 (2 earlier review cycles)
|
6bf70cb to
a1c409c
Compare
|
@clawsweeper re-review Current head: a1c409c. The conflict with #155574 is resolved on frozen main while preserving both previously qualified final test blobs. The updated body credits the accepted-request repair and describes the remaining factories, pending-state assertion, and exact-head proof boundaries. Fresh independent P0–P2 review is clean; new required CI is pending. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
|
Merged via squash auto-merge.
|
* commit '80b9608a25e191a17e1466d750c2f76a38a38507': fix(tooling): declare tsx CLI shim exports test(gateway): reuse session PR access state fixtures (#155626) test(heartbeat): await wake registration before advancing coalescing time refactor(status): share plugin health section assembly (#155390) fix: CLI and MCP tool completions skip plugin hooks (#155206) fix(update): preserve failures and retain running worker code (#153764) fix(sqlite): drain idle coordinators at lifecycle teardown fix(test): prepare SQLite compile-cache probes before launch fix(test): preserve owned compiler caches in Vitest workers fix(ios): assistant files are not downloadable in chat (#155195) fix(heartbeat): avoid timeouts for busy scheduled polls (#148333) test(gateway): hold SSH approval until pending assertions finish test(update): cover launcher permission rollback on Linux (#155615) fix(edit): avoid duplicate replacements from legacy arguments (#155513) feat(browser): support Lightpanda connection-scoped CDP replies (#154342) improve(ci): speed up compatible Control UI tests with Bun (#154585) test(gateway): prepare remaining approval fixtures before requests (#155589) fix(doctor): exclude retained agents from automatic session import
Keep the prepared default from #155589 for valid approval requests, while six rejection-only fixture sites skip 17 otherwise unnecessary preparations. Preserve standard fixture cleanup, forwarding, assertions, and deadlines. All 210 existing cases passed in 182.13 seconds, along with selected changed checks, deslop, and fresh independent P2 review. The 17 rejection cases took 3.705 seconds combined; this is supporting timing, not a controlled speedup measurement. No production code or new tests are added.
…55655) Keep the prepared default from #155589 for valid approval requests, while six rejection-only fixture sites skip 17 otherwise unnecessary preparations. Preserve standard fixture cleanup, forwarding, assertions, and deadlines. All 210 existing cases passed in 182.13 seconds, along with selected changed checks, deslop, and fresh independent P2 review. The 17 rejection cases took 3.705 seconds combined; this is supporting timing, not a controlled speedup measurement. No production code or new tests are added.
…enclaw#155655) Keep the prepared default from openclaw#155589 for valid approval requests, while six rejection-only fixture sites skip 17 otherwise unnecessary preparations. Preserve standard fixture cleanup, forwarding, assertions, and deadlines. All 210 existing cases passed in 182.13 seconds, along with selected changed checks, deslop, and fresh independent P2 review. The 17 rejection cases took 3.705 seconds combined; this is supporting timing, not a controlled speedup measurement. No production code or new tests are added.
Include the owning approval-readiness repairs openclaw#155589 and openclaw#155553 and provisioning timeout synchronization6e2ac28079b. The sanitizer feature remains the same two-file24-line delta against current main; fresh P2 autoreview passed. Preserve contributor ancestry and all enforced landing gates. Co-authored-by: Patrick-Erichsen <[email protected]>
Reuse canonical approval readiness openclaw#155589/openclaw#155553 and provisioning timeout synchronization6e2ac28079b. Compose coalescing with the current progress presentation-lifetime owner, retaining acceptLifetime and pending-aware dirty state. Fresh P2 autoreview found no actionable defect. Preserve contributor ancestry and enforced gates. Co-authored-by: Patrick-Erichsen <[email protected]>
What Problem This Solves
Request and forwarding fixtures can consume their 2,000 ms approval lifetime while the first real SQLite worker opens. Related PR #155574 already prepared accepted-request fixtures; this completes the same readiness boundary for the remaining factories and broadcast-resolution sibling.
User Impact
No user-visible behavior changes. This changes tests and test support only; approval deadlines, authorization, persistence, and reviewer visibility retain their existing production behavior. Production +0/-0 lines; tests/support +58/-62.
Why This Change Was Made
Both approval fixture factories await the existing prepared manager before creating requests. Their callers and the broadcast-resolution sibling use that same readiness boundary, replacing the now-redundant private assembly wrapper introduced for synchronous callers. Three forwarding cases install their fake clocks after preparation. The reviewer case requires an unresolved, requester-bound record before testing visibility and final denial. The existing rejection assertion helper lives in fixture support, keeping the oversized test file below its baseline line count without removing checks.
Evidence
Current head
a1c409c303a9828a832b61738dd9c335d09c306breconciles the actual conflict with #155574 on frozen main1adb39eebaad2c81882470b0e2b39fdad28da104. Both changed files are byte-identical to reviewed head6bf70cb1217d3d012b1603f2bb2b5c782a9f2af4; accepted-request readiness is preserved through the single canonical prepared factory. Diff checks and normal commit hooks passed. Fresh exact-head P0–P2 review passed with no findings. The latest prior-head review requested conflict reconciliation and validation; this reconciliation preserves the remaining sibling fixes and addresses that request. One exact-head re-review is pending.Current-head hosted Linux proof passed the whole file, 210/210, on Node 24.19.0 at merge
6791a3df75549165722e5f48f83355533f195853(base38d22b4b56add402bbdaf56958de94618b0f5f3fplus this head): 85.28 s file / 88.38 s wrapper / 136 s job. The complete run passed all 27 jobs with 19 intentional skips; required static gates and commit-status gates are green.The following qualification is retained at preceding head
6bf70cb1217d3d012b1603f2bb2b5c782a9f2af4, rather than relabeled as a new-head run. Whole file 210/210 passed once, 40.906 s command wall time (38.76 s Vitest), Node 24.16.0 on macOS ARM64 with one worker. Its targeted line-cap ratchet passed. Hosted Linux proof at that head also passed all 210 cases on Node 24.19.0: 65.87 s Vitest / 67.77 s wrapper; the complete CI run passed 27 jobs with 19 intentional skips.The same preceding head's native Linux run passed the original two-config selection: 1 file / 10 tests, then 22 files / 472 tests (23 files / 482 total), in 176.067 s command wall time. The reported reviewer case passed once in 519 ms. Original input/config order and the two-worker memory policy were preserved. The host had 4 CPUs / 16.56 GB versus the original 2 CPUs / 8.22 GB; two concurrently scheduled sibling files exchanged their observed first-case order. Prior cache seeds and preceding job context were not reproduced. Test deadlines stayed unchanged, automatic no-output retries were disabled, all 48,266 source paths matched before and after, and the managed process tree joined before the owned VM was stopped.
The following mechanism and sibling proof is retained from preceding head
682ffcf2746a566ebd2a7f8d0c1e558da0f06c0d. The helper-only extraction does not change the reported case, preparation factories, or the control call path. The supported local fallback was used after remote source sync timed out before tests; those remote attempts receive no proof credit.expired/timeoutstate and the unchanged 2,000 ms budget.denied/user.Commands used
node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway-database-workers.config.ts src/gateway/server-methods/server-methods.test.ts --maxWorkers=1, the same config forsrc/gateway/approval-fixture.test.ts, andtest/vitest/vitest.gateway-methods.config.tsfor the exec/pluginagent-runtime.test.tssiblings. Focused controls added the reported test-name filter. All seven process trees joined before source restoration; all 21 bound source/input hashes and the clean final head were verified afterward.The original CI denial failure motivated the shared readiness investigation. The controlled reproduction establishes this fixture mechanism; it does not measure that runner's unobserved worker-open duration. Required new-head CI must pass before merge; historical controls and multi-file proof remain attributed to their exact heads.