Skip to content

fix(test): prepare remaining approval fixtures before requests - #155589

Merged
vincentkoc merged 1 commit into
mainfrom
fix/ci-approval-fixture-readiness-20260922
Sep 22, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/ci-approval-fixture-readiness-20260922

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

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 a1c409c303a9828a832b61738dd9c335d09c306b reconciles the actual conflict with #155574 on frozen main 1adb39eebaad2c81882470b0e2b39fdad28da104. Both changed files are byte-identical to reviewed head 6bf70cb1217d3d012b1603f2bb2b5c782a9f2af4; 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 (base 38d22b4b56add402bbdaf56958de94618b0f5f3f plus 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.

  • The unmodified reported case passed spontaneously. A call-through control delaying only the first real SQLite worker open by 2,100 ms failed exactly at the original final denial; the real resolver observed durable expired / timeout state and the unchanged 2,000 ms budget.
  • The prepared fixture passed with the same delay. Worker readiness preceded request creation; reviewer checks and request completion passed, and the real resolver recorded denied / user.
  • Removing only preparation made the new unresolved-record assertion fail. Both negative controls retained the real storage path.
  • Pristine whole file: 210/210 passed, 42.606 s command wall time (40.24 s Vitest). This existing broad server-methods file includes real SQLite, expiry, forwarding, and broadcast cases; its scope accounts for the run exceeding 30 seconds.
  • Signed-runtime siblings: 2 files, 11/11 passed, 18.128 s command wall time. Approval-lifetime sibling: 6/6 passed, 11.119 s.

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 for src/gateway/approval-fixture.test.ts, and test/vitest/vitest.gateway-methods.config.ts for the exec/plugin agent-runtime.test.ts siblings. 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.

@vincentkoc vincentkoc self-assigned this Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review September 22, 2026 08:22
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Sep 22, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Current head: 6bf70cb1217d3d012b1603f2bb2b5c782a9f2af4. The rejection helper now lives in fixture support; the targeted line-count check and all 210 cases pass. Updated evidence distinguishes current-head proof from the preceding causal controls.

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 5:20 AM ET / 09:20 UTC (Revision 3).

ClawSweeper review

What this changes

The 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
Reviewed head: a1c409c303a9828a832b61738dd9c335d09c306b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable fixture repair with preserved assertions, useful historical validation, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This MEMBER-authored PR changes fixture preparation only, so the external-contributor runtime-proof gate does not apply. Recorded real-SQLite controls and hosted tests support the changed path; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR changes fixture preparation only, so the external-contributor runtime-proof gate does not apply. Recorded real-SQLite controls and hosted tests support the changed path; no stored-data contract changes.
Evidence reviewed 7 items Verified introduced scope: The pinned introduction changes only test support and its callers. Both factories await the existing prepared manager; all located callers await the factories. Production deadlines, authorization, storage formats, and dependencies remain unchanged.
Existing readiness owner: The prepared helper awaits a real pending-approval query through the SQLite worker before returning the fixture. Existing request tracking, manager draining, and asynchronous database cleanup remain in the shared fixture owner.
Main contains only the sibling repair: Current main prepares accepted-request fixtures but still constructs ordinary request and forwarding fixtures synchronously. GitHub confirms #155574 merged; its narrower accepted-request change does not supersede the remaining work.
Findings None None.
Security None None.

How this fits together

Gateway 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -4. Total -4 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 58 62 -4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 58 62 -4

Review metrics

Metric Value Why it matters
Recorded test cost 210 cases; 40.906 s local wall time; 65.87 s hosted Vitest time The body attributes these measurements to the preceding head with identical final test files and explains the real SQLite coverage.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded repair to approval-test reliability with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR changes fixture preparation only, so the external-contributor runtime-proof gate does not apply. Recorded real-SQLite controls and hosted tests support the changed path; no stored-data contract changes.

Evidence

What I checked:

  • Verified introduced scope: The pinned introduction changes only test support and its callers. Both factories await the existing prepared manager; all located callers await the factories. Production deadlines, authorization, storage formats, and dependencies remain unchanged. (src/gateway/server-methods/exec-approval.test-support.ts:242, a1c409c303a9)
  • Existing readiness owner: The prepared helper awaits a real pending-approval query through the SQLite worker before returning the fixture. Existing request tracking, manager draining, and asynchronous database cleanup remain in the shared fixture owner. (src/gateway/exec-approval-manager.test-support.ts:43, a1c409c303a9)
  • Main contains only the sibling repair: Current main prepares accepted-request fixtures but still constructs ordinary request and forwarding fixtures synchronously. GitHub confirms fix(tests): prepare approval worker before request deadlines #155574 merged; its narrower accepted-request change does not supersede the remaining work. (src/gateway/server-methods/exec-approval.test-support.ts:246, 4cbde45ab1c3)
  • Prior review continuity: GitHub reports the preceding reviewed head's file blobs as 9171ba0a2cff5b01b8ff96424daf49ea1697cd90 and 4d4ec948ff79b75c2b590dad7c851cf9b437398d; both match the current checkout. The unavailable local historical-head comparison was resolved through this read-only API comparison. (6bf70cb1217d)
  • Conflict resolution verified: The raw test-merge record has the pinned base followed by the exact PR head as parents. Its comparison with that base contains only the two intended test files, resolving the preceding review's conflict concern. (6791a3df7554)
  • Validation with preserved revision identity: The captured body reports 210 passing cases on the preceding reviewed head and separately attributes delayed-worker negative controls to an earlier head. The hosted Linux job independently reports success at 6bf70cb1217d3d012b1603f2bb2b5c782a9f2af4. These results remain historical validation, not a newly executed current-head test run; this review ran no tests. (src/gateway/server-methods/server-methods.test.ts:2797, 6bf70cb1217d)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-22T08:48:29.217Z sha 6bf70cb1217d3d012b1603f2bb2b5c782a9f2af4 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-22T09:01:02.781Z sha 6bf70cb1217d3d012b1603f2bb2b5c782a9f2af4 :: needs changes before merge. :: none

@vincentkoc
vincentkoc force-pushed the fix/ci-approval-fixture-readiness-20260922 branch from 6bf70cb to a1c409c Compare September 22, 2026 09:08
@vincentkoc vincentkoc changed the title fix(test): keep worker startup outside approval fixture deadlines fix(test): prepare remaining approval fixtures before requests Sep 22, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@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.

@clawsweeper

clawsweeper Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc
vincentkoc merged commit 4cf81a5 into main Sep 22, 2026
108 of 111 checks passed
@vincentkoc
vincentkoc deleted the fix/ci-approval-fixture-readiness-20260922 branch September 22, 2026 09:26
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

vincentkoc added a commit that referenced this pull request Sep 22, 2026
* 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
steipete added a commit that referenced this pull request Sep 22, 2026
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.
steipete added a commit that referenced this pull request Sep 22, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…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.
roboclaw-bot added a commit to jjjhenriksen/openclaw that referenced this pull request Sep 24, 2026
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]>
roboclaw-bot added a commit to jjjhenriksen/openclaw that referenced this pull request Sep 24, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant