Skip to content

fix(test): prepared model-catalog worker tests time out on loaded hosts while polling hook markers - #162572

Merged
steipete merged 1 commit into
mainfrom
steipete/poll-agents-catalog-worker
Oct 1, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/poll-agents-catalog-worker

Conversation

@steipete

@steipete steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: the prepared model-catalog worker integration tests fail on a loaded host when the catalog worker thread takes longer than about 1 s to reach its augmentation hook, because they expect.poll marker files with the default 1 s deadline.

User Impact

No user-visible change. The prepared-model-catalog-worker*.integration suites stop failing spuriously on slow machines; a hook that is never reached now fails at the Vitest test timeout instead of racing a 1 s timer.

Why This Change Was Made

Part of the polling audit from #162274. These fixtures run inside a product-owned worker thread, and one of them (supersession) blocks its thread with a synchronous spin right after reporting entry, so a socket receipt could not leave the thread until the spin ended. test/helpers/fixture-receipts.ts therefore gains a worker-thread client: openFixtureReceiptChannel() also listens on a uniquely named BroadcastChannel, and fixtureReceiptWorkerClientSource() posts receipts synchronously (unref'd) so the test thread receives them even while the worker blocks. Socket and broadcast receipts share one record/waiter path and the same malformed-receipt failure. Fixtures keep writing their marker files before reporting, and waits raced against an operation the worker can settle consult that durable record (the #162274 rule). 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 lines are the work-order/original-byte locations. Category 3 includes the explicitly authorized worker-thread broadcast variant of fixture receipts.

File:old line Old helper / deadline New signal / category Class Ordering and justification
src/agents/prepared-model-catalog-worker.custody.integration.test.ts:123 expect.poll(existsSync) / 1,000 ms Observed capture release() promise; then direct removal assertion / 1 B Automatic supersession still initiates cleanup. The test observes the owner's promise; it does not invoke cleanup to manufacture proof. prepared-model-catalog-worker.ts:177 supplies capture.release; worker-task-pool-retirement.ts:189 joins termination before resource release; plugin-source-capture-directory.ts:723 awaits removal before release settles.
src/agents/prepared-model-catalog-worker.integration.test.ts:238 expect.poll(readFileSync) / 1,000 ms Counted augmentation-entry receipt / 3 A Fixture appends start before broadcast, held hook, and reply; original exact file-content assertion remains.
src/agents/prepared-model-catalog-worker.integration.test.ts:416 waitForMarker / 30,000 ms Parent callback entered deferred / 1 B Synchronous test diagnostics event follows the parent's durable owner append.
src/agents/prepared-model-catalog-worker.integration.test.ts:430 waitForMarker / 30,000 ms Parent callback aborted deferred / 1 B Event follows the real cancellation handler's durable abort append.
src/agents/prepared-model-catalog-worker.integration.test.ts:676 expect.poll(readFileSync) / 30,000 ms Counted augmentation-entry receipt / 3 B Next start count identifies refresh, with the unchanged marker-change assertion afterward.
src/agents/prepared-model-catalog-worker.integration.test.ts:864 waitForMarker / 30,000 ms Held augmentation-entry receipt / 3 B Receipt precedes issuing overload requests while the admitted task remains held.
src/agents/prepared-model-catalog-worker.integration.test.ts:918 waitForMarker / 30,000 ms Shared discovery entry receipt / 3 B Entry is observed before checking shared callers and releasing their barrier.
src/agents/prepared-model-catalog-worker.integration.test.ts:951 waitForMarker / 30,000 ms Broadcast entry receipt before synchronous spin / 3 B postMessage enqueues synchronously; the test thread receives while the worker spins. Existing start-only assertion proves interruption before completion.
src/agents/prepared-model-catalog-worker.pool.integration.test.ts:148 expect.poll(readFileSync) / 1,000 ms Counted stable-catalog entry receipt / 3 A Stable fixture writes custody and start before sending receipt and holding.
src/agents/prepared-model-catalog-worker.pool.integration.test.ts:276 expect.poll(readFileSync) / 1,000 ms Counted stable-catalog entry receipt / 3 A Observes actual acquisition, while preserving the foreground retained-result assertion.
src/agents/prepared-model-catalog-worker.pool.integration.test.ts:422 expect.poll(readFileSync) / 1,000 ms Counted stable-catalog entry receipt / 3 A Proves entry before warm shutdown/plugin retirement.
src/agents/prepared-model-catalog-worker.pool.integration.test.ts:477 expect.poll(readFileSync) / 1,000 ms Counted augmentation-entry receipt / 3 A Held first acquisition is admitted before retiring its queued sibling.
src/agents/prepared-model-catalog-worker.pool.integration.test.ts:589 expect.poll(readFileSync) / 1,000 ms Counted augmentation-entry receipt / 3 A Predecessor reaches the barrier before replacement preparation begins.
src/agents/prepared-model-catalog-worker.pool.integration.test.ts:746 expect.poll(readFileSync) / 1,000 ms Counted augmentation-entry receipt / 3 A Active sibling entry is observed before the queued caller's fake deadline advances.
src/agents/prepared-model-catalog-worker.retirement.integration.test.ts:84 waitForMarker / 30,000 ms Parent callback aborted deferred / 1 B The real held capture's abort handler owns the notification.
src/agents/prepared-model-catalog-worker.scope.integration.test.ts:307 vi.waitFor(readFileSync) / 1,000 ms Parent callback entered deferred / 1 A Callback follows owner append; the original parent\n content assertion remains.
src/agents/prepared-model-catalog-worker.scope.integration.test.ts:373 waitForMarker / 30,000 ms Parent callback aborted deferred / 1 B Exact replacement cancellation is observed before checking the request's unavailable outcome.

Worker races observe the actual loadCatalog() acquisition promise, not only the bounded foreground loadFullModelCatalog() result. prepared-model-runtime.catalog-access.ts:668 permits a foreground return while background acquisition continues. The fixture observer is opt-in for integration and pool suites, and catalogFixtureEventBeforeSettlement consults the durable start record if acquisition settles before delivery of its independent receipt. Parent event waits use awaitGateBeforeSettlement; all new waits use the Vitest test signal through withinTest. Parameterized parent tests use it.for.

The shared receipt helper adds only the approved transport: unique broadcastName, common schema/store/waiters/failure handling, receiver closure in close(), and a lazy unreferenced ESM worker client. Socket receipts remain available for product-spawned processes. Node v24.21.0's installed internal/worker/io source was inspected: postMessage directly invokes the handle at lines 421–429 and unref delegates to the handle at lines 454–458. The real supersession proof below verifies the cross-thread behavior.

Stops, residuals, and deliberately unconverted sites

No requested site remains unconverted, and no new residual filesystem/process poll was added. The now-unused waitForMarker was removed after a reference search across all consumers of the catalog fixture module. Existing in-memory catalog/publication/pool-state checks, shared waitForWorkers, and fixture input barrier watchers remain outside the 17 requested observation sites. The existing five-second bounded foreground behavior and its result/rejection assertions remain unchanged.

Evidence

All proof ran on Blacksmith Testbox through node scripts/crabbox-wrapper.mjs one-shot runs; no local Vitest.

Fault and forced-abort probes

Four healthy-path delay comparisons passed: original failed and fixed passed for integration augmentation entry, pool stable-catalog entry, pool generic augmentation entry, and scoped parent auth entry. The exact same 1,500 ms delay was applied to original and fixed fixture bytes, conditioned on the existing held barrier, and reverted byte-exactly. These cover all class-A sites through their shared fixture families.

Original failure evidence:

  • Integration old238: Matcher did not succeed in time, while expecting the additional start record.
  • Pool old148 and old477: Matcher did not succeed in time, while expecting the marker to differ.
  • Scope old307: AssertionError: expected '' to contain 'parent\n'.

Final fault comparisons: 4/4 original failures for the intended assertion; 4/4 fixed passes. See initial-proof-compact.log and final-proof.log.

Forced-abort proof: 3/3 validated. Parent deferred used a temporary 3,000 ms timeout; receipt and capture observation used temporary 10,000 ms timeouts. Each log shows the selected wait, the first-finally marker, and the no-live-worker check before fallback termination. Parent: created:0, threadIds:[]; capture and worker receipt: one worker, threadId:-1. Exact input bytes were restored. See final-proof-continuation.log.

Worker-thread spin proof passed with SPIN_RECEIPT_BEFORE_SUPERSESSION and SPIN_TERMINATED_BEFORE_END. The original start-only final assertion remained intact. This proves delivery while the 10,000 ms synchronous spin was active. See sweep-proof.log.

The earlier candidate also passed 100/100 standalone runs and the owning shard; it exposed the one type error described above. It is retained as evidence and is not substituted for the final frozen-byte proof.

Standalone repetitions (flake-triage bar)

Final candidate: 100/100 standalone file runs, one owning-shard replay, targeted core-test typecheck, core typecheck, and root-test/helper typecheck all passed. Four different files ran concurrently at most, each with a distinct cache, and no file overlapped itself. Candidate hashes in closure-proof.log match the committed files.

Commands:

CI=1 pnpm test <file> --maxWorkers=1  # 20 invocations for each of the five files
OPENCLAW_NODE_TEST_GROUPS_JSON='<planner group>' CI=1 node --import tsx scripts/ci-run-node-test-shard.mts
pnpm tsgo:core:test --changed-paths-json '<the ten changed paths>'
pnpm tsgo:core
pnpm tsgo:test:root
node_modules/.bin/oxfmt --check <the ten changed paths>
node_modules/.bin/oxlint --type-aware --tsconfig config/tsconfig/oxlint.core.json <the nine src paths>
node_modules/.bin/oxlint --type-aware --tsconfig test/tsconfig/tsconfig.test.root.json test/helpers/fixture-receipts.ts
git diff --check

All remote payloads used exactly the one-shot shape:

node scripts/crabbox-wrapper.mjs run --timing-json -- bash -c "$(cat <payload.sh>)" > <log> 2>&1

createNodeTestShardBundles({ includeReleaseOnlyToolingShards: true }) selected bundle-infra-small-runtime-15 for all five changed test files. Its exact {shard_name, configs, includePatterns} group is recorded under OWNING_SHARDS in the final log. No release-only owner was omitted.

Final gate Exit Wall seconds
tsgo-core-test 0 130.157
tsgo-core 0 47.590
tsgo-root 0 195.361
shard-bundle-infra-small-runtime-15 0 243.453

Owning CI shard replays

Log Provider / lease Run Outcome
initial-proof.log blacksmith-testbox / tbx_01m3v0yer2ydcqj0bbsqqb8j7f https://github.com/openclaw/openclaw/actions/runs/36822765028 Wrapper exit 1; inspect per-command results above
initial-proof-compact.log blacksmith-testbox / tbx_01m3v188c44yr8gg17bjqksc47 https://github.com/openclaw/openclaw/actions/runs/36823213820 Wrapper exit 0; inspect per-command results above
final-proof.log blacksmith-testbox / tbx_01m3v2a6wbcfdt40r8gak0mt89 https://github.com/openclaw/openclaw/actions/runs/36824830170 Wrapper exit 1; inspect per-command results above
final-proof-continuation.log blacksmith-testbox / tbx_01m3v2s7q9qqrabnx67yxwdwjq https://github.com/openclaw/openclaw/actions/runs/36825566333 Wrapper exit 1; inspect per-command results above
sweep-proof.log blacksmith-testbox / tbx_01m3v3ejds9ngnbwyb6qrmqzm7 https://github.com/openclaw/openclaw/actions/runs/36826617480 Wrapper exit 1; inspect per-command results above
closure-proof.log blacksmith-testbox / tbx_01m3v6a647jrd7h13k23kdx5d1 https://github.com/openclaw/openclaw/actions/runs/36831345743 Wrapper exit 0; inspect per-command results above

Each one-shot wrapper recorded its owned Testbox as stopped. No kept lease or manually reused ID was created. Some failed proof-tool runs emitted a portal-sync warning after cleanup; their wrapper exit and timing JSON remain the outcome evidence.

Coordinator shard replays (flake-triage bar: 3 total with the lane's replay above)

SHARD bundle-infra-small-runtime-15 replay=1 pass wall=277s   64 passed (64) |  541 passed (541)
SHARD bundle-infra-small-runtime-15 replay=2 pass wall=245s   64 passed (64) |  541 passed (541)
SHARDS overall=0

Catalog tests polled marker files and capture removal against 1,000 ms
expect.poll/vi.waitFor and 30,000 ms marker deadlines. Healthy credential
preparation, worker dispatch, and asynchronous capture release could
outlast those observation deadlines on loaded hosts.

Await broadcast worker-entry receipts, synchronous parent callback events,
and the capture owner's release promise instead. Observe actual catalog
acquisition settlement and consult durable marker records when replies
beat receipts. Bind waits to the Vitest test signal so abort reaches
cleanup, and keep catalog observation opt-in to avoid competing spies.

Remove the unused marker poll. Preserve product and test timeouts and the
existing lifecycle, custody, queueing, and catalog assertions.
@clawsweeper

clawsweeper Bot commented Oct 1, 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.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M labels Oct 1, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 5:15 AM ET / 09:15 UTC.

ClawSweeper review

What this changes

The PR replaces catalog-worker test polling with worker-entry receipts, parent callbacks, and observed cleanup promises while preserving existing assertions and timeouts.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused test-reliability fix that current main does not contain. No actionable correctness or security defect was found in the introduced changes.

Priority: P2
Reviewed head: b5789b3cd1da28fc64b5c54da60a7b9f4ea7b868

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, sound fixture repair with strong supplied fault evidence and no actionable review findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The matching captured body documents real catalog-worker Testbox runs: identical delayed fixture entry fails original polling and passes the new waits; worker-spin receipts arrive before supersession, and abort probes reach cleanup with no live worker. Repetition and typecheck results supplement that boundary evidence; 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 (logs): The matching captured body documents real catalog-worker Testbox runs: identical delayed fixture entry fails original polling and passes the new waits; worker-spin receipts arrive before supersession, and abort probes reach cleanup with no live worker. Repetition and typecheck results supplement that boundary evidence; no stored-data contract changes.
Evidence reviewed 7 items Pinned introduction and merge result: Reviewed the merge-base-to-head introduction. The verified test merge has the pinned main parent followed by the exact PR head, and its result changes only the same test and fixture paths.
Current main still needs the conversion: Current main still polls the augmentation marker with the default expect.poll deadline. Its receipt helper supports socket clients but lacks the worker broadcast transport added here.
Ordering and settlement remain observable: The observer captures actual loadCatalog acquisition settlement, checks the durable start count when settlement beats receipt delivery, and binds the wait to the test signal. Generated fixtures append their marker before broadcasting; the client is unreferenced.
Findings None None.
Security None None.

How this fits together

OpenClaw prepares model catalogs through parent-side credential preparation and background worker threads. These integration tests exercise catalog refresh, shared-worker queueing, cancellation, and captured-plugin cleanup.

flowchart TD
  A[Catalog test request] --> B[Parent credential preparation]
  B --> C[Catalog worker]
  C --> D[Fixture marker and entry receipt]
  D --> E[Test waits for owned signal]
  E --> F[Catalog and lifecycle assertions]
  G[Test cancellation] --> H[Release barriers and retire workers]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +272. Total +272 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 10 358 86 +272
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 358 86 +272

Review metrics

Metric Value Why it matters
Delay fault comparisons 4 original failures; 4 fixed passes The supplied identical-delay comparisons distinguish removal of the observation race from passing repetitions alone.

Technical review

Best possible solution:

Synchronize these integration tests on owner-produced events and cleanup completion while retaining their catalog, queueing, and retirement contracts.

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

Yes: a 1,500 ms fixture-entry delay exceeds current main's default 1 s polling window, and supplied Testbox comparisons report the intended original failures and fixed passes. This review inspected source without executing tests.

Is this the best way to solve the issue?

Yes: the patch extends the existing receipt owner and observes real callbacks and release promises, preserving assertions and avoiding longer observation deadlines or production-only test hooks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b3e5991d4a6d.

Labels

Label changes:

  • add P2: This repairs bounded integration-test reliability on loaded hosts without changing user-facing runtime behavior.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The matching captured body documents real catalog-worker Testbox runs: identical delayed fixture entry fails original polling and passes the new waits; worker-spin receipts arrive before supersession, and abort probes reach cleanup with no live worker. Repetition and typecheck results supplement that boundary evidence; no stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The matching captured body documents real catalog-worker Testbox runs: identical delayed fixture entry fails original polling and passes the new waits; worker-spin receipts arrive before supersession, and abort probes reach cleanup with no live worker. Repetition and typecheck results supplement that boundary evidence; no stored-data contract changes.

Label justifications:

  • P2: This repairs bounded integration-test reliability on loaded hosts without changing user-facing runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The matching captured body documents real catalog-worker Testbox runs: identical delayed fixture entry fails original polling and passes the new waits; worker-spin receipts arrive before supersession, and abort probes reach cleanup with no live worker. Repetition and typecheck results supplement that boundary evidence; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The matching captured body documents real catalog-worker Testbox runs: identical delayed fixture entry fails original polling and passes the new waits; worker-spin receipts arrive before supersession, and abort probes reach cleanup with no live worker. Repetition and typecheck results supplement that boundary evidence; no stored-data contract changes.

Evidence

What I checked:

  • Pinned introduction and merge result: Reviewed the merge-base-to-head introduction. The verified test merge has the pinned main parent followed by the exact PR head, and its result changes only the same test and fixture paths. (c179dd6545e0)
  • Current main still needs the conversion: Current main still polls the augmentation marker with the default expect.poll deadline. Its receipt helper supports socket clients but lacks the worker broadcast transport added here. (src/agents/prepared-model-catalog-worker.integration.test.ts:238, b3e5991d4a6d)
  • Ordering and settlement remain observable: The observer captures actual loadCatalog acquisition settlement, checks the durable start count when settlement beats receipt delivery, and binds the wait to the test signal. Generated fixtures append their marker before broadcasting; the client is unreferenced. (src/agents/test-helpers/prepared-model-catalog-worker-fixture.ts:114, b5789b3cd1da)
  • Cleanup observation follows the production owner: The custody test observes capture.release without initiating cleanup itself. The production retirement path stops the worker before releasing artifacts, and capture.release awaits directory removal. (src/agents/prepared-model-catalog-worker.custody.integration.test.ts:145, b5789b3cd1da)
  • Complete captured proof body inspected: The full GitHub body matches captured SHA-256 18ac3a823e6fc6661d4a9981f6858696f2fc9455e0ecc2146eb050c7ee049c60 and length 13,447 UTF-16 units. It reports four original-failure/fixed-pass comparisons using identical 1,500 ms delays, three abort-cleanup probes, broadcast delivery during a synchronous worker spin, 100 standalone passes, and three owning-shard passes. These are supplied Testbox observations; this reviewer did not execute tests. (b5789b3cd1da)
  • Related merged work supplies the existing helper: fix(test): MCP fixture tests fail on loaded hosts when child startup outlasts polling deadlines #162274 is GitHub-verified merged and introduced the shared socket receipt helper. Its discussion explicitly identifies catalog-worker polling as a later batch, so it does not supersede this conversion. (test/helpers/fixture-receipts.ts:1, 739f704f4d2b)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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.

@steipete
steipete merged commit af5ffd4 into main Oct 1, 2026
146 checks passed
@steipete
steipete deleted the steipete/poll-agents-catalog-worker branch October 1, 2026 09:26
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
…ts while polling hook markers (openclaw#162572)

The prepared model-catalog worker integration tests waited for the catalog worker thread to reach its augmentation hook by expect.poll-ing marker files with the default 1 s deadline. On a loaded host, worker dispatch and catalog preparation outlast it.

These fixtures run inside a product-owned worker thread, and the supersession fixture blocks its thread with a synchronous spin right after reporting entry, so a socket receipt could not leave the thread until the spin ended. test/helpers/fixture-receipts.ts therefore gains a worker-thread client: the channel also listens on a uniquely named BroadcastChannel, and fixtureReceiptWorkerClientSource() posts receipts synchronously (unref'd) so the test thread receives them while the worker blocks. Socket and broadcast receipts share one record/waiter path and malformed-receipt failure. Fixtures still write their markers before reporting, and waits raced against an operation consult that durable record. No product source, test timeout, product timeout, or assertion meaning changed.

Part of the polling audit from openclaw#162274. Proof on Blacksmith Testbox: delayed-dispatch fault probes fail the original bytes and pass these bytes, including a supersession probe that requires the receipt to arrive while the worker still spins; forced-abort probes reach cleanup; 100/100 standalone runs across the five files; 3/3 replays of bundle-infra-small-runtime-15; targeted tsgo; Codex autoreview and ClawSweeper clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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