Skip to content

fix(test): observe ONNX worker boundaries without filesystem notifications - #157104

Merged
steipete merged 1 commit into
mainfrom
codex/test-onnx-event-waiter-main
Sep 24, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-onnx-event-waiter-main

Conversation

@steipete

@steipete steipete commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The ONNX worker-client fixture could time out waiting for a child boundary already recorded in its event log if a directory-change notification was missed.

User Impact

No production behavior changes. Tests observe actual child progress without requiring a filesystem notification to trigger the next read.

Why This Change Was Made

Use the existing vi.waitFor helper over the same append-only event log. Keep the 10-second deadline, real child processes, IPC messages, cancellation and queue assertions unchanged. The helper uses its default 50 ms polling interval. This removes six net test-support lines and the parent waiter's watcher/timer cleanup.

Evidence

  • The unchanged local file passed all 11 cases.

  • A narrow control suppressed only the original parent waiter's notification callback and retained its initial read. The selected case failed at its existing 10-second boundary. A follow-up control recorded both init and classify/block from the same real child at that timeout, confirming that the event was present but unobserved. Cleanup joined the child; the secondary early-exit async assertion diagnostic is retained.

  • After restoring original bytes and applying the correction, all 11 candidate cases passed. All case bodies and the generated child fixture remain unchanged.

  • Revalidated the unchanged patch on current main after a normal frozen dependency update: all 11 cases passed again. The complete command took 21.442 seconds; this is a single cost observation, not a speedup comparison. Current mapped checks and fresh independent Codex P2 review passed.

  • Exact-head CI passed, including all 11 worker-client cases in the changed-extension job. That Vitest invocation took 29.88 seconds, mostly transformation; it is not a matched speedup comparison.

Failures from a separate macOS full-suite run on Node 24.21 were not reproduced by the unchanged local Node 24.19 run. This demonstrates robustness against notification loss, not a proven cause or fix for those historical failures. No speedup is claimed. The generated child's separate release-file watcher is unchanged.

Related: #139428

@clawsweeper

clawsweeper Bot commented Sep 24, 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.

@steipete
steipete marked this pull request as ready for review September 24, 2026 06:55
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 3:27 AM ET / 07:27 UTC (Revision 2).

ClawSweeper review

What this changes

The ONNX worker-client test fixture repeatedly reads its child process event log until the expected boundary appears, while retaining its ten-second deadline.

Merge readiness

✅ Ready for maintainer review

Current main still has the notification-only waiter, and no merged fix was identified. The PR addresses a credible missed-event failure in the test fixture, with no actionable patch defect found.

Priority: P3
Reviewed head: 38582b7a584097ee98f04e0d3ebbbe8594089ca9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow fixture repair has a credible real-child failure control, passing focused cases, and exact-head CI.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed fixture waiter observes events from a real child spawned through the production ONNX worker client. The PR reports a missed-notification control with the boundary already logged, then 11 passing after-fix cases locally and success on the exact PR head; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed fixture waiter observes events from a real child spawned through the production ONNX worker client. The PR reports a missed-notification control with the boundary already logged, then 11 passing after-fix cases locally and success on the exact PR head; no stored-data contract changes.
Evidence reviewed 8 items Introduced change: The pinned merge-base-to-head diff replaces the parent fixture's directory watcher with a bounded read of the same append-only log; the test cases and generated child are unchanged.
Current-main behavior: Current main still reads once and then relies on a directory notification to reread the event log. The verified test merge changes only this test file.
Production boundary: The production client spawns a child with IPC and handles its replies and closure; the fixture exercises that client with a real generated child.
Findings None None.
Security None None.

How this fits together

The ONNX plugin runs local classification in a child process. Its worker-client tests send real IPC requests and read child-written events before checking queueing, cancellation, and process cleanup.

flowchart LR
  A[Test request] --> B[ONNX worker client]
  B --> C[Child process]
  C --> D[Event log]
  D --> E[Boundary waiter]
  E --> F[Lifecycle assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -6. Total -6 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 8 14 -6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 8 14 -6

Review metrics

Metric Value Why it matters
Focused suite cost 11 cases; 21.442 s local, 29.88 s CI The PR records the cost of this real-process suite without treating either observation as a speedup comparison.

Technical review

Best possible solution:

Keep the real-child integration cases as the owner of worker lifecycle assertions, with reliable boundary observation and measured test cost.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main's waiter can miss an event after its initial read, and the PR reports a controlled case where the real child wrote the event but the waiter timed out. I did not execute that control in this read-only review.

Is this the best way to solve the issue?

Yes. The bounded waiter uses the fixture's existing event log and preserves the real-process lifecycle assertions; the child-process boundary explains the narrow use of a real-time wait.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 23f5c6763362.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: The change improves test reliability without changing production behavior.
  • 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. Sufficient (terminal): The changed fixture waiter observes events from a real child spawned through the production ONNX worker client. The PR reports a missed-notification control with the boundary already logged, then 11 passing after-fix cases locally and success on the exact PR head; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed fixture waiter observes events from a real child spawned through the production ONNX worker client. The PR reports a missed-notification control with the boundary already logged, then 11 passing after-fix cases locally and success on the exact PR head; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 8f82ec8 adds extensions/onnx/src/worker-client.test.ts:68 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8f82ec8ad2c6; files: extensions/onnx/src/worker-client.test.ts)

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 (1 earlier review cycle)
  • reviewed 2026-09-24T07:02:50.069Z sha 38582b7 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 05c21b1 into main Sep 24, 2026
178 checks passed
@steipete
steipete deleted the codex/test-onnx-event-waiter-main branch September 24, 2026 09:28
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: onnx proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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