Repository navigation
refactor(async): deslop retry, timeout, and abort handling - #164278
Conversation
|
🦞👀 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. |
3a118d6 to
de85ebc
Compare
de85ebc to
3d5f935
Compare
|
Coordinator-requested baseline verification, using clean isolated Linux checkouts and the repository test runner: node scripts/run-vitest.mjs src/agents/embedded-agent-runner/server-endpoint-compaction.test.tsBefore the independently landed fixture repair, clean main commit Clean Both checkouts had empty Git status before the command and no source edits. Main had already landed The required conflict-only rebases retained main's native-session authority and MCP App lifecycle changes and dropped the now-duplicated iMessage fixture commit. Net production reduction remains 1,020 lines. An additional contract failure also reproduces on clean main node scripts/run-vitest.mjs src/plugins/contracts/extension-runtime-dependencies.contract.test.ts -t "extensions/codex declares every runtime package import"That fixture module, dependency scanner, and Codex package manifest are unchanged by this PR. Exact-head hosted CI completed for
Both reproductions used clean isolated main checkouts, without editing tests or producers. No failing check is being relabeled as passing. Under the coordinator's explicit instruction, proceeding with an admin squash pinned to the API head after posting this evidence. Maintainer compatibility confirmation for the automated review checklist: no user configuration keys/defaults, schemas, retained fields, migrations, or storage formats change. The Mattermost backfill and memory corpus/embedding hunks only consolidate existing timeout/abort plumbing; their data owners and timing policies remain intact. The private UI retry option has no production opt-in caller. The review itself found no correctness/security defect or stored-data contract change; the filename/truncated-inventory checklist flags do not identify a compatibility change. |
…164278) Consolidate matching retry, timeout, and abort plumbing through shared owners while preserving timing, retry counts, error identity, and cleanup barriers. Remove the unused metadata startup-retry mode. Focused behavior and cycle checks passed. Exact-head CI completed with independently reproduced main fixture/build-test failures; baseline commands, output, and maintainer-authorized admin landing evidence are recorded in the PR. Net production reduction: 1,020 lines.
What Problem This Solves
Retry, timeout, and cancellation flows had accumulated separate timer races, abort listeners, and one-use wait wrappers across core, plugins, packages, and the UI.
User Impact
No intended user-visible behavior change. Timeout values, retry counts and delays, error identities, cancellation ordering, and resource-settlement requirements stay with their existing owners. No configuration, persisted-data, protocol, or dependency changes are required.
Why This Change Was Made
This coherent batch removes 1,020 net production lines (+1,131 / −2,151), excluding tests, fixtures, docs, and generated files.
time-runtimeSDK entrypoint and document the wait semantics.Fixes Found Along the Way
Two IRC tests raced real cold SQLite admission against arbitrary three-second completion guards. They now await their existing durable-write events within Vitest's cancellation signal, preserving cold admission, real TCP, every assertion, and
finallycleanup. No timeout or retry limit was raised. A temporary mutation that silently accepted a sanitized-empty send still failed the original error assertion in about one second. The iMessage durable-delivery fixture now strictly expects the host media-access owner’s existingopenFilecapability while retaining all delivery, reader-identity, and no-replay assertions.Evidence
pnpm test <13 affected files> --maxWorkers=1passed 386 tests in 435.77 seconds across ten project shards; this includes the five edited test files. The standalone IRC shard took 38.03 seconds including cold transforms.--repeats 20), with no retries masking failures; the 42-run stability cell took 42.76 seconds.pnpm test extensions/imessage/src/test-plugin.test.ts --maxWorkers=1, 63.38 seconds wall time including cold worker transforms). Independent review of both repair commits found no actionable P0–P2 findings.Linux remote proof commands included
pnpm install --frozen-lockfile,node scripts/run-vitest.mjs <focused files>, both import-cycle checks,node scripts/check-changed.mjs,pnpm build,pnpm ui:check-performance:base <base>, and the canonical Plugin SDK API diff tool. Hosted CI must run on the exact pushed head.Coordinator Verification
The previous compaction failure was reproduced on a clean pre-fix main checkout (
d0ce76b7a3087a94b710110646b1a14b7e30665e): 1 failed, 11 passed, withCannot add property providerReplay, object is not extensible. Clean current main (6cae5628b09a2e3893a02dc018f182ba6442e854) passes all 12 tests because main independently landed60e849f1a4aa, which seeds replay metadata before appending the session message. No change or cherry-pick from #163471 is included.A conflict-only rebase retains main's complete native-session authority/settlement and MCP App lifecycle changes; the conflict resolutions add only the shared sleep import and the bounded teardown helper. Eight focused files (189 tests) and both cycle checks passed on the verified candidate source tree. The contract suite passed 1,131 tests and found one inherited Codex fixture classification failure; that exact case also reproduces on clean current main, with the fixture, scanner, and package manifest unchanged by this PR.
The fresh review's startup-retry concern was rejected after checking all production callers: neither passes
startupRetryWindowMs, and the last production opt-in caller was removed by #142165. The removed branch is test-only behavior; ordinary metadata requests retain the same path.