Repository navigation
fix(models): keep shared catalog requests alive for remaining callers - #157191
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. |
|
Codex review: blocked before merge. Reviewed September 26, 2026, 10:41 PM ET / September 27, 2026, 02:41 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch changes shared live model-catalog requests so callers can cancel independently, forwards the shared cancellation signal to provider requests, and adds cache, HTTP, and NVIDIA regression coverage. Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open. Current main still has the reported cancellation behavior, and the branch has meaningful boundary proof. The measured growth of unsettled work when loaders ignore abort still needs an SDK-owner decision before merge. Priority: P2 Review scores
Verification
How this fits togetherProvider plugins request live model lists through the Plugin SDK, which shares and caches guarded provider HTTP requests. The resulting catalogs determine which models OpenClaw can offer. flowchart LR
A[Model catalog callers] --> B[Provider catalog adapters]
B --> C[Shared cache and acquisition]
C --> D[Guarded provider request]
A --> E{Caller cancels?}
E -->|Others remain| C
E -->|Last caller| F[Abort acquisition]
D --> G[Available models]
Decision needed
Why: The PR measures the exposure, but choosing whether to accept it or require an availability-preserving bound is an SDK lifecycle tradeoff that source review cannot authorize. Before merge
Agent review detailsSecurityNone. PR surfaceSource +68, Tests +480. Total +548 across 6 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep cancellation owned by the shared cache, then give physical acquisitions a lifecycle-owned admission contract that preserves replacement and unrelated catalog availability. Do we have a high-confidence way to reproduce the issue? Yes. Current main shares a catalog promise while an upstream loader uses a caller's signal, giving a clear two-caller cancellation path; the PR reports baseline and after-fix HTTP observations, although this read-only review did not rerun them. Is this the best way to solve the issue? Yes for independent cancellation: the shared cache owns the controller and provider adapters forward its signal. Physical-settlement admission remains outside this scoped patch. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3a68ec05f929. 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 (4 earlier review cycles)
|
Source disposition, September 24The specific same-turn race below is addressed in 7b585253. I inspected the two-file successor delta and the shared-cache owner: abort dispatch now calls one synchronous, idempotent release before rejecting the observer, and finally uses that same release. The final consumer therefore aborts acquisition before a same-turn loader completion can retain it; one canceled consumer cannot decrement a survivor twice. The new Error/non-Error controls abort and resolve without yielding, preserve the exact reason and require a replacement load. The strengthened same-key case starts its replacement before the abandoned acquisition settles. The earlier global unsettled-load rejection is already removed; the retained-cache eviction and survivor controls remain. This is a source-level disposition of this finding, not whole-PR or runtime qualification. The author reports three intended predecessor failures and 33 shared-cache plus 31 strict-acquisition passes locally; I have not executed or independently receipt-bound those results. The historical Linux run is explicitly on the predecessor, not this head. The existing executor still owns current-head remote/static/SDK/type/build/HTTP qualification, required CI and applicable review. No competing repair or replay of unchanged completed proof is requested. Historical findingSource review at In consumeLiveCatalog, the abort listener only rejects the consumer promise. Consumer ownership is released later in the async
The cancelled caller rejects, but a subsequent same-key caller receives the abandoned cached result, contrary to the issue contract. The existing test awaits rejection before resolving the loader and therefore misses this ordering. Release consumer ownership synchronously on abort, with one idempotent release shared by the listener and finally. Extend the existing regression to abort and resolve without yielding, preserve the exact rejection reason, and assert that the next caller invokes a replacement loader. Prove the failure at this head and the repaired result on Testbox/Crabbox; preserve surviving-consumer and physical-settlement capacity coverage. This is distinct from the intentional rejection of a new same-key caller while an abandoned acquisition is still pending; that behavior is explicitly tested and is not this finding. The separate 100-acquisition availability/owner-decision finding from ClawSweeper and the pending runtime/SDK qualification remain unresolved. |
|
Merged via squash.
|
* commit '69809d7a94277d01be964bd1cbbb7aa0ebc58c9b': (219 commits) perf(agents): serialize large model requests once (#159574) refactor(cli): share capability agent-selection test cases (#159616) fix(workers): restore installation type checks (#159629) test(channels,qa,providers): remove low-value tests (batch d065) (#159627) test(doctor): run isolated migration cases concurrently (#159609) feat(apple): show agent identities in native chat (#159528) chore(i18n): refresh native locales (#159635) fix(gateway): keep node provisioning's installation contract after overlapped preparation fix(models): keep shared catalog requests alive for remaining callers (#157191) feat: let agents query online people and device activity (#159117) perf(gateway): first cloud dispatch prepares worker artifacts one after another (#159520) refactor(android): deslop Android app third pass (#159589) test(qa-lab,openshell,slack,reef,team-reports): remove low-value tests (batch d064) (#159607) fix: align process liveness checks (#151107) thanks @ekinnee fix: sessions model default does not clear the override (#159587) fix(ios): preserve typing during reentrant SwiftUI updates fix(ci): frozen 2026.8.33 validation fails on inherited test clock (#159594) perf(gateway): avoid duplicate recipient row lookup (#159595) refactor(gateway): deslop gateway fourth pass (#158786) test(agents): split subagent task-settlement test support under the line cap (#159584) ...
* commit '69809d7a94277d01be964bd1cbbb7aa0ebc58c9b': (219 commits) perf(agents): serialize large model requests once (#159574) refactor(cli): share capability agent-selection test cases (#159616) fix(workers): restore installation type checks (#159629) test(channels,qa,providers): remove low-value tests (batch d065) (#159627) test(doctor): run isolated migration cases concurrently (#159609) feat(apple): show agent identities in native chat (#159528) chore(i18n): refresh native locales (#159635) fix(gateway): keep node provisioning's installation contract after overlapped preparation fix(models): keep shared catalog requests alive for remaining callers (#157191) feat: let agents query online people and device activity (#159117) perf(gateway): first cloud dispatch prepares worker artifacts one after another (#159520) refactor(android): deslop Android app third pass (#159589) test(qa-lab,openshell,slack,reef,team-reports): remove low-value tests (batch d064) (#159607) fix: align process liveness checks (#151107) thanks @ekinnee fix: sessions model default does not clear the override (#159587) fix(ios): preserve typing during reentrant SwiftUI updates fix(ci): frozen 2026.8.33 validation fails on inherited test clock (#159594) perf(gateway): avoid duplicate recipient row lookup (#159595) refactor(gateway): deslop gateway fourth pass (#158786) test(agents): split subagent task-settlement test support under the line cap (#159584) ...
…openclaw#157191) * fix(models): isolate cancellation of shared catalog requests * fix(models): preserve catalog availability during cancellation * fix(models): release abandoned catalog loads synchronously * test(nvidia): expect shared acquisition cancellation signal
Related: #157189
This PR addresses the independent-cancellation portion of that issue. Its requirement that physically unsettled loads remain counted is not implemented here and remains open. This partial repair must not automatically close the issue; no acceptance criterion or resource-bound guarantee is waived by this scope clarification.
What Problem This Solves
Canceling one model-catalog caller can abort a shared request still needed by another caller. Conversely, abandoning the last caller can leave its request running or cache an abandoned result when cancellation and completion occur in the same turn.
User Impact
Callers cancel independently. A surviving caller keeps its shared request and healthy warm cache. The final caller leaving synchronously signals cancellation of the pending acquisition, and a new caller can replace abandoned work without waiting for a signal-ignoring loader to settle.
The existing 100-entry cache eviction behavior is preserved: evicted pending callers continue, and unrelated strict catalogs remain available. No configuration, schema or migration is introduced.
September 27, 2026 landing refresh: exact-head CI run 35996475309 and required CI/security statuses are successful. ClawSweeper revision 5 reviewed this same head at 02:41 UTC with no actionable code or security finding. Its remaining maintainer decision is resolved below; native preparation and merge qualification are in progress. No live-vendor, general speed, capacity or memory-reduction result is claimed.
Why This Change Was Made
The shared cache owns the acquisition controller and consumer count. Existing upstream-feed, raw-row and model-ID entry points forward consumer signals to that owner. The final consumer releases ownership during abort dispatch, before a same-turn completion can populate the cache. Release is idempotent because cleanup also runs in
finally; canceling one caller cannot decrement a surviving caller twice. Existing entry-identity checks protect replacements and prevent evicted work from rewarming the cache.The initial revision added a global limit on physically unsettled loads. Review identified an availability regression: an unrelated strict catalog became unavailable at 100 pending loads. That new admission policy is removed; the existing cache eviction policy remains.
Whole PR including the NVIDIA assertion correction: production +104/-36 (net +68), justified by independent consumer cancellation and acquisition ownership; tests +481/-1 (net +480). The NVIDIA correction changes only the existing expected signal to
expect.any(AbortSignal); ranking, DNS, audit, host policy, timeout and release assertions remain intact.Maintainer disposition of revision 5 and its Rank-up move: proceed with the compatible independent-cancellation repair. Immediate same-key replacement genuinely amplifies unsettled work for abort-ignoring loaders; this is accepted as the explicitly measured limitation of this scoped merge, not dismissed as a cache bound. The public optional-signal Promise loader has no force-stop or physical-settlement contract. Restoring the removed global cap would change admission behavior and reintroduce the demonstrated failure of unrelated strict catalogs. TTL expiry and eviction already permit overlapping old loads, so an availability-preserving physical bound needs its own lifecycle/admission design in #157189. That issue stays open. This is a maintainer disposition, not a claim of separate SDK-owner approval or bounded native DNS: the guarded resolver itself races cancellation against uncancelable
getaddrinfo.A 44-call probe on
7b585253used 22 calls per mode, including 20 abandoned loads and 20 abort notifications. Cooperative loaders peaked at one unsettled promise and had zero before drain; signal-ignoring loaders peaked at 20 and still had 20 before drain. Both reached zero after drain, and both preserved fresh replacement and the warm sentinel. This confirms abort-paced amplification for noncooperative loaders. It measures unsettled loader promises, not native DNS, heap or a hard resource bound. The three changed cancellation-aware SDK adapters forward the owned signal; arbitrary external loaders need not cooperate.Named follow-ups: noncooperative acquisition admission with a lifecycle owner and an availability contract; llama.cpp cached-discovery signal propagation; P12-R canceled-consumer Promise reaction retention behind noncooperative loaders. These remain separate work, not implied guarantees of this fix.
Evidence
Current candidate
1e7f06bca8ce9c5a7c6d464d2e489a9c96e5f69b, tree37f367309cfbc56e4108979120758f22abebaa0e; frozen comparison baseline2968ae94e4c1f40b1decbed3681872c2be99a838. Its only change from7b585253524a6c6538bca8cad1b20fbaad1c3590is the NVIDIA test assertion. All production/dependency blobs and HTTP evaluator inputs are unchanged; the7b585253build and HTTP receipts below support those unchanged inputs, not fresh-head CI clearance.1e7f06bcfound no P0–P2 issues, with confidence 0.91. Review JSON SHA-256:f5b2bf8e49538230c8c45d5b7eed50120d182ec5fbce06bb59b841cb69d98cf2.[tsgo:plugin-sdk] passedin 59.6s. These current-head results supersede the earlier in-progress status snapshot; the prior-revision runtime/build observations below retain their stated provenance.7b7c34faproduced three intended assertion failures and 30 filtered cases in 1.94s: Error/non-Error same-turn cancellation and immediate same-key replacement. All deferred work settled before assertions; no unhandled rejection or timeout.7b585253proof passed 33/33 shared-cache and 31/31 strict-acquisition cases; scoped formatting/lint and independent correction review were clean. CI attempt 1 also executed and passed those suites, production core/UI/plugin types and the SDK test-type graph. Its tested merge was3151739fd89fcae4c18ebc796a8c4698dcb3e536over basec7b57259f116a519de7e7ec08a7298a5f779a2ceand head7b585253.signal: undefined. On unchanged7b585253, local replay reproduced one intended failure with 14 filtered cases (54.12s wrapper time); both requests occurred, with the expected featured audit/DNS/policy and an owned signal. The exact correction committed in1e7f06bcpassed both complete NVIDIA catalog/index files: 30/30 tests (55.43s wrapper time, Node 26.7.0), with targeted formatting and whitespace checks clean. Normal commit hooks preserved the tested bytes.7b585253: all 15 phases passed, including 12 remaining guards and fullpnpm buildin 1316.685s. Source restoration, joined children and transport cleanup were verified.The synchronous-release review finding is addressed at the shared owner. The noncooperative-loader limitation and revision 5 maintainer decision are explicitly addressed above. Prior-revision observations retain their stated input bindings; current-head autoreview, required CI/security and fresh ClawSweeper source review are complete. Native preparation and squash admission remain the final landing steps.