Repository navigation
Conversation
Acquire independent provider catalogs with bounded concurrency within each discovery phase. Preserve label-ordered model and outcome precedence, settle admitted hooks on failure, and reuse the shared concurrency runner.
|
🦞👀 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 maintainer review before merge. Reviewed October 8, 2026, 5:50 AM ET / 09:50 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch runs up to four provider catalog hooks concurrently within each discovery phase while preserving ordered model and outcome merging. Review scores
ProductKind: Performance · Worth it: Yes Merge readiness✅ Ready for maintainer review This PR remains useful: current main still performs serial provider discovery. The bounded concurrency change has credible runtime evidence, preserves deterministic publication, and has no actionable review findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherProvider catalog discovery collects available models from configured provider plugins for OpenClaw’s model inventory. It combines discovered rows with authored settings and publishes provider outcomes to the existing catalog owner. flowchart TD
A[Configured providers and credentials] --> B[Provider scope and endpoint eligibility]
B --> C[Ordered discovery phases]
C --> D[Up to four concurrent catalog hooks]
D --> E[Wait for phase settlement]
E --> F[Merge rows and outcomes in label order]
F --> G[Published model inventory]
Technical reviewBest possible solution: Keep bounded acquisition in the existing discovery owner and retain the existing scope, credential, phase, and publication contracts. Do we have a high-confidence way to reproduce the issue? Not applicable as a correctness bug; serial discovery is source-verifiable, and the supplied real-worker comparison provides a concrete way to measure its performance cost. Is this the best way to solve the issue? Yes. Reusing the shared concurrency runner at the existing acquisition owner is a focused solution that removes serial orchestration without adding another cache or publication owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d3309e576011. Provenance checked
TestingProof path: shipped entry point. Added test files: 1. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -13, Tests +102, Docs +5. Total +94 across 3 files. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
|
Acquire independent provider catalogs with bounded concurrency within each discovery phase. Preserve label-ordered model and outcome precedence, settle admitted hooks on failure, and reuse the shared concurrency runner.
What Problem This Solves
Refreshing several provider catalogs waits for independent network discovery hooks in sequence, extending model-picker refresh time.
User Impact
Multi-provider catalog refreshes finish sooner while preserving provider selection, per-provider deadlines, authentication ownership, model precedence, and failure handling. No configuration or schema changes.
Why This Change Was Made
Run up to four catalog hooks concurrently within each discovery phase, then merge rows and outcomes in their original label order. Each phase settles before the next starts, and admitted tasks settle before a failure propagates. The existing concurrency runner owns scheduling.
Prepare discovery groups and provider-owner counts once per acquisition instead of four times. Remove the old serial orchestration, duplicate phase-order constant, and one-use merge wrapper; reuse the existing provider-reference matcher for synthetic auth. Production delta: −13 lines (157 added, 170 removed; tests/docs excluded).
This complements #167008, which owns refresh frequency and shared normalization. The existing worker retains registrations, scopes provider refreshes, and retains unchanged catalog publications; this change adds no cache.
Evidence
Same-host Linux source-worker comparison on main
54bd6ecee1897f51b2963b6ea4c165a356e2d805, including #167008. Eight synthetic provider plugins serve 500 models each over loopback HTTP with 150 ms response latency. Both variants return 4,000 models; full builds make eight requests and selected-provider refreshes make one.Warm full builds are 2.03× faster, with 3.75× faster discovery. Warm registry preparation remains below 1 ms and auth preparation about 3.5 ms. The single-provider target of 300 ms is met in both variants; this patch does not claim a single-provider speedup. The 1.5 s cold-build target is missed: source-worker startup dominates. Warm process-wide RSS was approximately 846 → 878 MiB across separate processes; this is not an allocation profile or a claimed memory improvement.
The fake-time regression fails on original code (peak concurrency 1 rather than 4), and passes on the candidate. It covers slot reuse, out-of-order completion, deterministic row/outcome precedence, and phase separation. Its single-worker command took 47.78 s including shared worker compilation, with 1.05 s test time; the new case took 566 ms.
node scripts/check-changed.mjs --stagedon isolated Linux rig, original basec531ab224174d94e78e803de46355915298ab477Published head
ca511b4f4ef551d2f28c49256c53f8298d72e396is based on main739182bca6b56c723179f0a4947fa38eb2e623ae. The final rebase adds only disjoint upstream changes. The rebase preserved patch ID5dd974e64b2dfabea58faee9a4d2528cbad62c86. The completed broad gate is prior-base evidence; the changed catalog-owner context was checked by the rebased tests and repeated measurement above.A separate existing
models-list.discovery-lifecycle.integration.test.tsfailed before issuing its expectedlifecycle-bHTTP request on both original base and candidate. A minimal-Gateway-mode probe did not repair it and was discarded; no test assertion was relaxed. Gateway membership, worker recovery, and remote-catalog siblings passed five tests in three files. The native-lifecycle sibling reported two 120 s timeouts and one missing-model assertion; all three failures reproduced in the same four-file order on clean main739182bca6b56c723179f0a4947fa38eb2e623ae(357.95 s including its runtime build). The discovery-lifecycle failure also reproduced on that exact clean main (56.70 s). These tests are unchanged by this PR; their root causes remain unresolved. Final-head CI passed; the inherited local failures remain recorded separately. The ad hoc 4,000-row Gateway probe also did not establish admission and is not presented as successful end-to-end timing. No production Gateway latency or allocation improvement is claimed.Remote execution: Blacksmith Testbox
tbx_01m4d046d3tfwnt2krz2cdn1x0supplied initial baseline/negative-control evidence before a sync failure; replacementtbx_01m4d29ck84s3rhg0vqqktxy5zremained queued. AWScbx_37412f4fa4c5was quota-downsized and released unused. Hetznercbx_35aeba87e13everified source hashes and checks, then lost command transport after 21 passing type graphs. All leases were stopped. Final proof ran on the authorized isolated Linux rig with task-local state andTMPDIR, undernice -n 10 ionice -c3; no heavy validation ran on the development Mac.Merged as
de2b8ae04af1623cbb5b72e84bb80976008b784f; verified on main with the same patch ID as the reviewed candidate.