Repository navigation
fix(test): ACPX, Anthropic CLI, ONNX, voice, WhatsApp, and SQLite flip-proof tests fail on loaded hosts when fixtures outlast polling deadlines - #163013
Conversation
Replace 1-60 second file/PID readiness and cleanup polling deadlines with owned fixture receipts, child IPC/stdout, launch exit callbacks, playback queues, and publication completion. Check durable records when unordered receipt delivery races operation settlement. Bind waits to the test signal so timeout unwinds existing cleanup; retain one deadline-free observation where no descendant or logger completion is exposed. Preserve escalation deadlines and defer fixture controls that need missing release/close capabilities. Reuse E2E-prepared runtime in the Prometheus installer so a child rebuild cannot delete a sibling Gateway's dist chunks.
|
🦞👀 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. |
|
Codex review: needs changes before merge. Reviewed October 1, 2026, 6:55 PM ET / 22:55 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR replaces short polling deadlines in plugin tests and the SQLite lifecycle proof with fixture receipts, owned completion signals, and cancellation-bound observations. Merge readiness⛔ Needs changes before merge - 1 item remains The previous false-pass finding is resolved, and current main still lacks these useful test reliability changes. No new blocking correctness defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s test fixtures exercise plugin transports, worker processes, logging, and Gateway storage lifecycle behavior. Their readiness and cleanup signals determine when tests can safely assert results. flowchart TD
A[Test scenario] --> B[Plugin or Gateway operation]
B --> C[Fixture child or worker]
C --> D[Receipt or owned completion]
C --> E[Recorded fixture evidence]
D --> F[Cancellation-aware wait]
E --> F
F --> G[Assertions and cleanup]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +287. Total +287 across 18 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep test synchronization with existing readiness and completion owners while preserving independent failure assertions and termination-owned fixture lifetimes. Do we have a high-confidence way to reproduce the issue? Yes, source establishes short polling deadlines racing child and worker readiness on loaded hosts. This review did not execute a current-main reproduction; the submitted negative control separately demonstrates the repaired descendant assertion’s failure sensitivity. Is this the best way to solve the issue? Yes, reusing existing receipt and completion owners avoids increasing timeouts or adding production test seams, and the repaired descendant remains alive until cleanup terminates it. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2e022fc146b6. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Keep the inherited-stderr descendant alive until explicitly terminated. Its previous ten-second lifetime could satisfy the cancellation-bound extinction wait even when transport process-tree cleanup was missing. Preserve the test signal and rescue cleanup after the observation. A temporary no-kill control reproduces the reviewed false pass and makes the repaired fixture fail with rescue cleanup verified. Final bytes passed 20 standalone runs and one complete provider owner replay; two requested replays remain unrun after a proof-output parser stopped the payload.
|
Owning-bundle replays on 9501ce9 now total 3/3 clean (coordinator, Blacksmith Testbox): replay 2 exit 0, 44.9 s, 76 files / 1,039 tests passed; replay 3 exit 0, 35.7 s, 76 files / 1,039 tests passed; |
…p-proof tests fail on loaded hosts when fixtures outlast polling deadlines (openclaw#163013) Extension and fixture tests for ACPX (plugin entry and advertised-model runtime), the Anthropic CLI process/runtime, Diagnostics Prometheus install, Discord voice runtime, iMessage native handoff, memory-core dreaming narrative, the ONNX worker client, the voice-call tunnel, WhatsApp auto-reply/inbound media/send, OpenShell, and the shared SQLite sessions/transcripts flip proof polled files, PIDs, and process groups against 1-60 s wall-clock waits, so a fixture child or worker that outlasted the bound on a loaded host failed the test. Extensions import withinTest, awaitGateBeforeSettlement, and the fixture-receipt channel only through the local-only openclaw/plugin-sdk/test-fixtures facade (plus public extension-shared / error-runtime subpaths), never test/helpers. Waits now await held-classification receipts with durable event logs, owned close/exit promises, and existing callbacks; exact process-group extinction that no owner exposes keeps one deadline-free check bound to the test signal. Twelve sites that need a host-to-child release, an acknowledged socket flush, a worker BroadcastChannel receipt outside the facade, or Gateway managed-tree joins with TERM-to-KILL escalation stay unchanged. The Anthropic CLI stderr descendant now lives until terminated, so a missing transport tree kill cannot pass by natural expiry (negative control proven). No product source, test timeout, product timeout, or assertion meaning changed. Part of the polling audit from openclaw#162274. Proof on Blacksmith Testbox: 320/320 standalone runs (cli-process.test.ts re-proven 20/20 after the descendant fix), 51/51 unit owner replays plus 3/3 owning-bundle replays on the final head, the changed Gateway E2E files passing in every Gateway shard replay (unrelated untouched-test failures there are tracked separately), extension and root tsgo, extension test boundary, plugin SDK import lints, deadcode, OpenGrep, type-aware lint, base-aware timeout-race ratchet; Codex autoreview clean.
…p-proof tests fail on loaded hosts when fixtures outlast polling deadlines (#163013) Extension and fixture tests for ACPX (plugin entry and advertised-model runtime), the Anthropic CLI process/runtime, Diagnostics Prometheus install, Discord voice runtime, iMessage native handoff, memory-core dreaming narrative, the ONNX worker client, the voice-call tunnel, WhatsApp auto-reply/inbound media/send, OpenShell, and the shared SQLite sessions/transcripts flip proof polled files, PIDs, and process groups against 1-60 s wall-clock waits, so a fixture child or worker that outlasted the bound on a loaded host failed the test. Extensions import withinTest, awaitGateBeforeSettlement, and the fixture-receipt channel only through the local-only openclaw/plugin-sdk/test-fixtures facade (plus public extension-shared / error-runtime subpaths), never test/helpers. Waits now await held-classification receipts with durable event logs, owned close/exit promises, and existing callbacks; exact process-group extinction that no owner exposes keeps one deadline-free check bound to the test signal. Twelve sites that need a host-to-child release, an acknowledged socket flush, a worker BroadcastChannel receipt outside the facade, or Gateway managed-tree joins with TERM-to-KILL escalation stay unchanged. The Anthropic CLI stderr descendant now lives until terminated, so a missing transport tree kill cannot pass by natural expiry (negative control proven). No product source, test timeout, product timeout, or assertion meaning changed. Part of the polling audit from #162274. Proof on Blacksmith Testbox: 320/320 standalone runs (cli-process.test.ts re-proven 20/20 after the descendant fix), 51/51 unit owner replays plus 3/3 owning-bundle replays on the final head, the changed Gateway E2E files passing in every Gateway shard replay (unrelated untouched-test failures there are tracked separately), extension and root tsgo, extension test boundary, plugin SDK import lints, deadcode, OpenGrep, type-aware lint, base-aware timeout-race ratchet; Codex autoreview clean. (cherry picked from commit 8f9b234)
What Problem This Solves
Fixes: extension and fixture tests for ACPX (plugin entry and advertised-model runtime), the Anthropic CLI process/runtime, Diagnostics Prometheus install, Discord voice runtime, iMessage native handoff, memory-core dreaming narrative, the ONNX worker client, the voice-call tunnel, WhatsApp auto-reply/inbound media/send, OpenShell, and the shared SQLite sessions/transcripts flip proof fail on a loaded host when a fixture child or worker outlasts a wall-clock wait (1–60 s), because they poll files, PIDs, and process groups.
User Impact
No user-visible change. These suites stop failing spuriously on slow machines; a missing readiness or exit now fails at its owning step or the Vitest test timeout.
Why This Change Was Made
Part of the polling audit from #162274, following #162674 and its local-only
openclaw/plugin-sdk/test-fixturesfacade. Extensions importwithinTest,awaitGateBeforeSettlement, and the fixture-receipt channel only through that facade (plus publicextension-shared/error-runtimesubpaths), nevertest/helpers/**. Waits now await held-classification receipts with durable event logs, owned close/exit promises, and existing callbacks; exact process-group extinction that no owner exposes keeps one deadline-free check bound to the test signal.Deliberately unchanged (12 sites): iMessage and OpenShell waits that need a host-to-child release, ONNX blocking-thread cases needing an acknowledged socket flush, the memory worker's BroadcastChannel receipt (not in the extension facade), and the Gateway managed-tree/pipe joins whose deadlines drive TERM-to-KILL escalation. No product source, test timeout, product timeout, or assertion meaning changed.
Release-note context: test-only change, no user-visible behavior change.
Per-site conversions
Old line numbers are the work-order anchors. Categories: 1 existing owned completion; 2 test-owned child readiness; 3 product-child fixture receipt; 4 ordered direct assertion; 5 deadline-free cancellation-bound residual.
extensions/acpx/index.test.ts:383extensions/acpx/src/runtime-advertised-model.process.test.ts:176extensions/anthropic/cli-process.test.ts:204extensions/anthropic/cli-runtime.test.ts:329extensions/anthropic/cli-runtime.test.ts:421extensions/anthropic/cli-runtime.test.ts:668extensions/anthropic/cli-runtime.test.ts:150extensions/anthropic/cli-runtime.test.ts:494extensions/diagnostics-prometheus/src/install-runtime.e2e.test.ts:237extensions/discord/src/voice/voice-runtime.e2e.test.ts:296extensions/imessage/src/send.handoff-native.test.ts:156extensions/imessage/src/send.handoff-native.test.ts:200extensions/imessage/src/send.handoff-native.test.ts:259extensions/imessage/src/send.handoff-native.test.ts:51extensions/imessage/src/send.handoff-native.test.ts:62extensions/imessage/src/send.handoff-native.test.ts:74extensions/memory-core/src/dreaming-narrative.test.ts:196extensions/memory-core/src/memory/manager-publication-settlement.test.ts:139extensions/onnx/src/worker-client.test.ts:144extensions/onnx/src/worker-client.test.ts:172extensions/onnx/src/worker-client.test.ts:202extensions/openshell/src/backend.e2e.test-support.ts:262extensions/openshell/src/backend.e2e.test-support.ts:270extensions/voice-call/src/tunnel.process.test.ts:158extensions/voice-call/src/tunnel.process.test.ts:78extensions/voice-call/src/tunnel.process.test.ts:128extensions/voice-call/src/tunnel.process.test.ts:182extensions/voice-call/src/tunnel.process.test.ts:130extensions/voice-call/src/tunnel.process.test.ts:171extensions/voice-call/src/tunnel.process.test.ts:110extensions/whatsapp/src/auto-reply.web-auto-reply.connection-and-logging.e2e.test.ts:957extensions/whatsapp/src/auto-reply.web-auto-reply.connection-and-logging.e2e.test.ts:995extensions/whatsapp/src/inbound.media.test.ts:659extensions/whatsapp/src/inbound.media.test.ts:726extensions/whatsapp/src/send.test.ts:968test/helpers/openclaw-test-instance.ts:558test/helpers/sqlite-sessions-transcripts-flip-proof.ts:648test/helpers/sqlite-sessions-transcripts-flip-proof.ts:640test/helpers/sqlite-sessions-transcripts-flip-proof.ts:1311test/helpers/sqlite-sessions-transcripts-flip-proof.ts:1330test/helpers/sqlite-sessions-transcripts-flip-proof.ts:1448test/helpers/sqlite-sessions-transcripts-flip-proof.ts:1432Category-4 ordering references:
extensions/voice-call/src/tunnel.process.test.ts:79writes PID before fixture stdout; its auth evidence is written before the ready line at:120-124;extensions/voice-call/src/tunnel.ts:153-180resolves startup from that line. The synthetic SIGTERM handler at test:159writes synchronously before the termination completion observed after startup rejection; termination istunnel.ts:23-50. Exact process extinction is still checked separately. Registry listen/port IPC is owned byscripts/e2e/lib/plugins/npm-registry-server.mjs:439-446. Discord queue installation and release are documented with owner citations ininprocess-probes.md; publication logs follow diary writes inextensions/memory-core/src/dreaming-narrative.ts:99-110,258-278.Stops, residuals, and deliberately unconverted sites
Evidence
All proof ran on Blacksmith Testbox through
node scripts/crabbox-wrapper.mjsone-shot runs; no local Vitest.Coordinator notes on the Gateway E2E replays
The lane's changed E2E files passed in every Gateway replay. The replays' failures were all in untouched tests:
src/agents/model-fallback.reply-entry.e2e.test.ts(six non-OpenAI cases record zero provider attempts; reproduced on a fresh replay and isolated, likely a latent main regression not exercised by per-PR CI — tracked as a separate follow-up),test/e2e/gateway-transcripts-discord-capture.e2e.test.tsteardown,test/system-agent-managed-auth.e2e.test.ts,test/e2e/qa-lab/runtime/agent-sandboxed-exec-behavior.e2e.test.ts,src/agents/bash-tools.exec-gateway-approval.e2e.test.ts, and the managed-worktrees Workboard product proof. None of their files or support modules are touched here.scoped-clean.Follow-up: ClawSweeper descendant finding and measured cost (coordinator)
ClawSweeper found that the Anthropic CLI test's stderr descendant exited on its own after 10 s (
setTimeout(..., 10000)), so the new deadline-free extinction wait could pass a regression that omits the transport's tree kill. 9501ce9 makes the descendant live until terminated. A negative control reproduced the false pass on the old fixture; the repaired fixture fails with termination disabled, and the rescue cleanup still removes the PID. An audit of every other converted extinction wait in this branch found no other self-expiring fixture. Re-proof:cli-process.test.ts20/20 standalone, owning bundle 1 clean replay (76 files / 1,039 tests), extension boundary and plugin SDK import lints, type-aware lint, base-aware ratchet.Negative-control probes (Testbox):
Measured
CI=1 pnpm test <file> --maxWorkers=1wall on final bytes, 20 runs each (seconds):extensions/acpx/index.test.tsextensions/acpx/src/runtime-advertised-model.process.test.tsextensions/anthropic/cli-process.test.tsextensions/anthropic/cli-runtime.test.tsextensions/diagnostics-prometheus/src/install-runtime.e2e.test.tsextensions/discord/src/voice/voice-runtime.e2e.test.tsextensions/imessage/src/send.handoff-native.test.tsextensions/memory-core/src/dreaming-narrative.test.tsextensions/onnx/src/worker-client.test.tsextensions/voice-call/src/tunnel.process.test.tsextensions/whatsapp/src/auto-reply.web-auto-reply.connection-and-logging.e2e.test.tsextensions/whatsapp/src/inbound.media.test.tsextensions/whatsapp/src/send.test.tstest/scripts/e2e-mock-config-limits.test.tstest/scripts/sqlite-sessions-transcripts-flip-proof.built-cli.e2e.test.tstest/scripts/sqlite-sessions-transcripts-flip-proof.e2e.test.ts