Repository navigation
refactor(async): deslop bounded waits and retry ownership - #165340
Merged
Merged
Conversation
Contributor
|
🦞👀 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. |
Contributor
Author
Retry/timeout coverage log — part 1/7Full READ inventory
|
Contributor
Author
Retry/timeout coverage log — part 2/7Full READ inventory
|
Contributor
Author
Retry/timeout coverage log — part 3/7Full READ inventory
|
steipete
added a commit
that referenced
this pull request
Oct 5, 2026
…5536) The catch refactor in 2faa6a0 (#165340) added an unlisted preserve-caught-error suppression, failing the suppression inventory in hourly job 111705914349. Both errors were already preserved: the command failure was primary and the reporting failure was an aggregate member. Capture the reporting failure before composing the final error so the command stays the primary cause and both original errors remain available. Keep the existing suppression inventory and every assertion unchanged. Validation: suppression inventory before/after, 76 passing focused cases, core types and all 27 test type graphs, lint and remaining static guards, and P2 review. Unrelated Knip failures reproduced identically without the patch. Testbox timed out after 15 minutes queued; use the authorized ready PR fallback for remaining Linux proof.
steipete
added a commit
that referenced
this pull request
Oct 5, 2026
The shared abort helper introduced in #165340 adds cleanup promise turns. The observer still cancels and publishes correctly, but the fixture checked terminal health after a fixed twelve-microtask drain. Await the actual broadcast, retain the terminal health and model call-count assertions, and explicitly verify cancellation of the in-flight request. Proof: original fixture failed 3/3 on main; the immediate parent of 2faa6a0 passed and that commit failed. The final 15-test file passed 3/3 on Linux Testbox (26s, 8s, 9s wall with --maxWorkers=1). Related plugin, updater, and observer tests passed. Touched lint, formatting, all production typechecks, Gateway test types, and the runtime cycle check passed against 2d3a5c7 plus this patch. The broader checks still report unrelated pre-existing failures: Knip's X_STREAM_HEADROOM_MICRO_USD export and the startup-migration Madge cycle.
This was referenced Oct 5, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 6, 2026
…65340) * refactor(async): deslop bounded waits and retry ownership Consolidate matching retry, timeout, sleep, and abort plumbing onto existing owners without changing retry counts, delay schedules, cancellation errors, or native cleanup barriers. Fix an unobserved WhatsApp QR deadline rejection during socket startup and clear reconnect timers when runtime refresh preparation fails. Keep the shared timeout observer safe when an already-aborted signal meets a synchronously throwing operation. * fix(async): preserve cancellation and fixture contracts * fix(matrix): remove redundant deferred type argument
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 6, 2026
…openclaw#165479) openclaw#165340 introduced Promise.withResolvers in the gateway-client package. The package declaration build compiles against the repository's ES2023 lib, so tsdown-packages fails with TS2550 and pnpm build (the Team deployer) aborts before cutover. Create the pending-stop promise explicitly again.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 6, 2026
…nclaw#165536) The catch refactor in e048d84 (openclaw#165340) added an unlisted preserve-caught-error suppression, failing the suppression inventory in hourly job 111705914349. Both errors were already preserved: the command failure was primary and the reporting failure was an aggregate member. Capture the reporting failure before composing the final error so the command stays the primary cause and both original errors remain available. Keep the existing suppression inventory and every assertion unchanged. Validation: suppression inventory before/after, 76 passing focused cases, core types and all 27 test type graphs, lint and remaining static guards, and P2 review. Unrelated Knip failures reproduced identically without the patch. Testbox timed out after 15 minutes queued; use the authorized ready PR fallback for remaining Linux proof.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 6, 2026
The shared abort helper introduced in openclaw#165340 adds cleanup promise turns. The observer still cancels and publishes correctly, but the fixture checked terminal health after a fixed twelve-microtask drain. Await the actual broadcast, retain the terminal health and model call-count assertions, and explicitly verify cancellation of the in-flight request. Proof: original fixture failed 3/3 on main; the immediate parent of e048d84 passed and that commit failed. The final 15-test file passed 3/3 on Linux Testbox (26s, 8s, 9s wall with --maxWorkers=1). Related plugin, updater, and observer tests passed. Touched lint, formatting, all production typechecks, Gateway test types, and the runtime cycle check passed against 5ecafc8 plus this patch. The broader checks still report unrelated pre-existing failures: Knip's X_STREAM_HEADROOM_MICRO_USD export and the startup-migration Madge cycle.
RomneyDa
pushed a commit
that referenced
this pull request
Oct 7, 2026
Share a monotonic 20-second catalog deadline and stop waiting when the request, connection, or captured operator authority is cancelled. Return retryable UNAVAILABLE before committing a session and skip unused thinking catalog hydration during creation. Bounded-wait approach informed by #161422 by @DonnieFi. Co-authored-by: Donnie Fiander <[email protected]> (cherry picked from commit 4b485e5) Backport note: also carries the raceWithTimeout signal/onAbort support from 2faa6a0 (#165340), which this fix relies on to stop catalog waits on disconnect and authority revocation.
This was referenced Oct 8, 2026
This was referenced Oct 16, 2026
This was referenced Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Modules repeatedly implement the same bounded wait, cancellation observation, and retry-delay plumbing. This second-round cleanup reuses the existing owners and removes 598 net production lines across 95 production files, following #164278. The final count excludes cleanup already landed by parallel work and retains the Anthropic read owner whose cancellation ordering is not interchangeable with a generic promise race.
User Impact
The refactor preserves retry counts, delay schedules, timeout budgets, cancellation/error surfaces, configuration, protocol shapes, and resource-settlement boundaries. It also fixes two cleanup defects described below. No migration or operator action is required.
Why This Change Was Made
The existing retry package now owns the optional cancellation listener together with the timeout timer. Matching callers use that owner instead of maintaining separate races and cleanup branches. Domain-specific loops remain where they own authority checks, physical cleanup, clock behavior, or different retry semantics.
Fixes found along the way
The shared helper also covers an already-aborted signal combined with a synchronously throwing operation factory, preserving synchronous cleanup and observing the deadline rejection.
Evidence
6b5d24135f8bbf13eb105dbe46b5679e3c69af3f. Fresh independent review of the correction found no actionable P0–P2 findings.27c9bc10): no added/removed entrypoints. Its 131 reachable-export notices deduplicate to optionalsignal/onAborton the existing timeout helper and deletion of privateGatewayClient.createPendingStop; there are no newly required public arguments.This is one explicitly approved below-1,000-line batch. The attached coverage comments contain 1,116 fully read production files over 200 lines, sorted by size with individual outcomes, and 282 separate protected/scan-only/partial exclusions. This is coverage of the retry/timeout/abort implementation scope, not a claim to have read every unrelated monorepo file or exhausted every possible cleanup.
Coverage log: part 1, part 2, part 3, part 4, part 5, part 6, part 7.
CI correction proof: targeted lint passes; update VM fixture 19/19 tests (7.74s); Windows liveness fixture 3/3 and Feishu async 5/5 (24.52s command); Anthropic accepted-work ownership case passes after restoring its original read implementation (123.11s command, 1 selected case). The first hosted run caught the type/lint/fixture issues and the unsafe Anthropic consolidation; all were corrected without weakening assertions or adding retries.
The next hosted run passed 103 jobs, including every test and type check; its only failure was Matrix repeating the deferred helper's default
voidtype argument. That argument is now removed, with fresh independent review and zero cycles. The focused local extension-lint wrapper timed out preparing SDK declarations before lint ran; no local lint pass is claimed for this final one-line fix.