Repository navigation
Conversation
Return completed catalogs within a one-second provider budget and retain marked stale pages for slow or unavailable providers. Keep late refreshes owned and cached adoption identities isolated through delivery. Related: #127743
|
🦞👀 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 27, 2026, 1:55 AM ET / 05:55 UTC. ClawSweeper reviewWhat this changesThe Gateway gives each session catalog provider a one-second response budget, retains scoped successful pages for pending or failed refreshes, and adds documentation and regression tests. Merge readiness⛔ Blocked before merge - 4 items remain Current main still waits for slow catalog providers, so this PR addresses a real problem. Keep it open: the proposed timeout can leave completed catalog rows absent from the sidebar and can replace healthy host updates with stale rows. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway gathers session catalogs from plugins for clients such as the Control UI sidebar. It filters provider results for the requesting caller before returning rows or sending host progress updates. flowchart LR
A[Control UI list request] --> B[Gateway catalog handler]
B --> C[Plugin providers]
C --> D[One-second response budget]
D --> E[Fresh or cached page]
E --> F[Visibility and identity filter]
F --> G[Sidebar rows and host updates]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +151, Tests +329, Docs +15. Total +495 across 6 files. View PR surface stats
Review metrics
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:
Copy recommended automerge instructionTechnical reviewBest possible solution: Return fast provider pages promptly, publish late completed hosts to active subscribers, and preserve fresh healthy hosts when another host fails. Do we have a high-confidence way to reproduce the issue? Yes. Current main awaits all providers, and the PR body reports a registered-handler fixture that took eight seconds before the patch and one second afterward; I did not execute it in this read-only checkout. Is this the best way to solve the issue? No. The provider budget is a useful repair, but completed list-only results need a late delivery path and partial host failures must not replace healthy updates. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 92b337d61552. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: perf(gateway): bound session catalog provider waits This is item 3/3 in the current shard. Shard 14/80. This temporary status tracks the active review worker. The completed review will appear in the durable ClawSweeper review comment. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Return completed catalogs within a one-second provider budget and retain marked stale pages for slow or unavailable providers. Keep late refreshes owned and cached adoption identities isolated through delivery. Related: openclaw#127743
Let in-flight catalog reads finish across registry reactivation while retaining current caller visibility, provider execution authority, disconnect handling, and shutdown settlement. Config and registration changes still invalidate subsequent requests. Remove map-identity checks around captured usage entries: displaced refreshes cannot overwrite their replacement. Keep all usage-cache behavior tests and remove only epoch/reactivation-only catalog cases. Best-effort tradeoffs accepted: rare mid-read registry/context replacement can return the original catalog, and epoch-only reactivation may retain a bounded stale page until refresh. Provenance: #138674 addressed slow-host delivery; #159457 added bounded stale catalog results.
Let in-flight catalog reads finish across registry reactivation while retaining current caller visibility, provider execution authority, disconnect handling, and shutdown settlement. Config and registration changes still invalidate subsequent requests. Remove map-identity checks around captured usage entries: displaced refreshes cannot overwrite their replacement. Keep all usage-cache behavior tests and remove only epoch/reactivation-only catalog cases. Best-effort tradeoffs accepted: rare mid-read registry/context replacement can return the original catalog, and epoch-only reactivation may retain a bounded stale page until refresh. Provenance: #138674 addressed slow-host delivery; #159457 added bounded stale catalog results.
Related: #127743
What Problem This Solves
A single slow or unreachable session-catalog provider holds the entire sidebar refresh open, even when other providers have already answered.
User Impact
Catalog listing waits at most one second for each provider, concurrently. Fast catalogs remain available; slow providers return
catalog_pendingand their last good page when available. Failed refreshes retain that page withcatalog_stale. Late results refresh the next request. These markers use the existing catalog error and host pending contracts, with no new configuration.The budget covers provider discovery and admission, not projection preparation or an event-loop stall. A cold provider can initially have no hosts; its late host publications remain supported.
Why This Change Was Made
The aggregate previously awaited every provider. The existing catalog operations owner now keeps at most 128 successful provider pages, scoped to the exact caller and query, with invalidation on config, registration/epoch, Gateway lifetime, and archive changes. Pending refreshes remain shared. Existing admission still limits each provider to one executing step, with 16 global slots and 32 queued calls per provider; a reply deadline does not release unfinished work.
Each cached provider retains its own original adoption identities through final delivery. Current visibility and session identity are rechecked before publishing. The Control UI already requests partial lists (
ui/src/components/app-sidebar-session-catalog-live.ts:444), preserves pending-host rows (:174), accepts late host events (:288), and displays catalog errors (ui/src/components/app-sidebar-session-catalogs.ts:123).Evidence
All heavy validation used
blacksmith-testbox, profileopenclaw-check, leasetbx_01m3ghjbcvm4pjq7dw58f6hvv8.Validation:
node scripts/run-vitest.mjs src/gateway/server-methods/session-catalog*.test.ts: 21 files, 213/214 tests passed. The one failure was a new fixture importing the registry accessor before the shared mock was installed; corrected to import after fixture setup. Final affected-file rerun: 13/13 passed. The other 20 files retain their passing proof.node scripts/check-changed.mjs --base e1b0d1fbdfe933a1e8463a3f26cf0b232eece15e: production and all 25 dependent test typecheck graphs, graph boundary, export audits, and prerequisite guards passed. It then stopped on six lint errors. Those were fixed; the exact targeted lint command, production typecheck, and all remaining native guards passed in a serial follow-up (exit 0). The final copy/style corrections do not change public types; the completed dependent typechecks were reused.pnpm test <file> --maxWorkers=1, timed with/usr/bin/time -p: budget regression 12.61 s wall / about 1.0 s test bodies / 12 passed; Session Share integration 11.77 s wall / 44 ms test body / 1 passed. Startup/transform time dominates these wall times; delay fixtures use fake timers. Exact-head CI run 36298247053 passed in 925 s wall time. All PR checks finished green (140 passed, 56 skipped); CI did not publish per-file timing artifacts.catalog.errorearly return inresolvePublishedSessionCatalogs(session-catalog-list-operations.ts:79); error-marked fallback pages cannot enter that reconciliation path.git diff --checkpassed. Testbox stopped after validation.Remote validation sequence and repaired failures
All runs used the same provider/profile/lease above; no local suites, builds, or typechecks ran.
warmup --keep --timing-jsonpnpm install --frozen-lockfileNo production Gateway was changed or restarted. Live deployment latency remains unmeasured.