Repository navigation
Conversation
Carry keyed registry publications into the resident session-list index. Skip unchanged compact facts, preserve full-read revision fences, and patch affected topology while retaining live-owner and source replacement semantics.
|
🦞👀 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, 6:25 AM ET / 10:25 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch updates the Gateway’s session-list projection to patch affected subagent run indexes and skip full rebuilds for progress-only registry updates. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 4 items remain Current main still rebuilds the subagent list index, so this performance work remains useful. The prior review’s source-replacement finding remains unresolved at the current head and blocks merge. Priority: P2 Review scores
Verification
How this fits togetherThe subagent registry publishes run changes to the Gateway’s resident session-list projection. That projection turns run facts into session status, activity, and parent links shown to clients. flowchart LR
A[Subagent run changes] --> B[Registry publication]
B --> C[Resident run index]
C --> D{List facts changed?}
D -->|Yes| E[Refresh affected sessions]
D -->|No| F[Reuse session facts]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +284, Tests +109. Total +393 across 13 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep the keyed publication index and make source replacement refresh both formerly and newly indexed children, with a row-level regression for removed ancestry. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows the repeated rebuild path, and the PR reports a baseline negative control; source inspection also gives a direct replacement scenario for the stale-parent defect. This review did not execute either scenario. Is this the best way to solve the issue? Yes, once the parent refresh is corrected. Keyed updates use the existing registry publication and projection owners, but source replacement must invalidate children that disappear. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cc75881752cf. LabelsLabel changes: No label 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
HistoryReview history (1 earlier review cycle)
|
…es (openclaw#158792) * perf(subagents): patch list indexes on registry publication Carry keyed registry publications into the resident session-list index. Skip unchanged compact facts, preserve full-read revision fences, and patch affected topology while retaining live-owner and source replacement semantics. * fix(subagents): keep read index construction read-only * fix(subagents): retain cloneable prepared run facts
What Problem This Solves
Session-list preparation rebuilt the complete subagent read index after every registry publication, including internal bookkeeping that did not change any list facts. Large retained registries paid repeated main-thread CPU and allocation costs during active subagent work.
User Impact
Subagent activity causes substantially less session-list indexing work while preserving status, descendant counts, parent links, swarm membership, and live ownership. Configuration, stored data, and update behavior are unchanged.
Why This Change Was Made
Carry exact changed run IDs through the existing publication owner. A projection-owned index compares the canonical compact facts and live-owner identity, patches affected memberships, and advances its list revision only when those facts change. Full-record readers retain the existing publication revision fence. Registry replacement/reload rebuilds the index; projection disposal releases its subscription. Full construction and keyed updates share the same topology implementation; construction never writes through its borrowed input map. Prepared memory winners remain plain, cloneable Set data, maintained with the affected child memberships.
The complete cutover adds 284 net production lines. The additional bookkeeping preserves old child/controller/requester/swarm memberships, retained generations, raw queued-owner identity, and source/disposal lifecycles; it replaces the old construction loop and adds no configuration or persistence surface.
Evidence
Synthetic workload: 5,000 retained runs (4,990 completed and ten initially running), with nine internal
requesterSettleWake.progressOperationIdpublications per active run followed by one completion. At an assumed six-second progress interval this models 100 registry publications/minute. Each publication goes through the live registry publication owner and the real session projection context. Ordinary streaming progress/heartbeat events do not all publish registry rows, so this is a fixture rate, not a measured production publication rate. Registry task/label, result payloads, and retry bookkeeping are absent from the compact list facts; session labels remain owned by session entries. Execution, topology, duration, cleanup/delivery status, and collector facts remain visible.Allocation was sampled with the Node heap sampler at 16 KiB, including objects collected by minor/major GC. CPU and wall values cover that same profiled interval and include instrumentation overhead. These are microbenchmark measurements, not a live Gateway heap or latency claim. The final CPU interval is shorter than the host counter can resolve; the wall measurement is reported separately rather than treating zero as exact CPU cost. The benchmark harness was temporary; the permanent regression enforces zero list-revision growth and no full rebuild for 100 progress-only publications, followed by completion and retirement.
All heavy validation used provider
blacksmith-testbox, profileopenclaw-check:Lease
tbx_01m3ed6zbx411vsy1hyajbf3yp(run): initial benchmark command found missing dependencies;pnpm install --frozen-lockfilepassed. Baseline benchmark passed.node scripts/run-vitest.mjson the benchmark, projection-context, subagent-index, and registry-queries files passed 51 tests in 50.57 s. The 2,048-session drain built one index while applying a completion and unrelated session writes. Two subsequent sync attempts timed out before executing tests; the lease was stopped and replaced.Lease
tbx_01m3ee3dn5rvntyj73g8tys9t7(run): one dependency install passed. The original production files at6c7544adc982failed the new regression as intended (100list revisions versus0); candidate restoration passed all 36 comparison/query tests. Paired captures confirmed the reduction. The initial changed-file gate found the query file's line cap, fixed by extracting the shared topology owner; test typechecking then caught the progress fixture field at the wrong nesting level, corrected to the actual requester-wake receipt. Its default remote base also included unrelated source changes; the final gate pins the actual task base. A further full-sync timeout prevented execution, so this lease was stopped and replaced.Lease
tbx_01m3ef8hbgse97ktvd12p2f1rj(run): one dependency install passed. A single synchronized invocation repeated the corrected original-code negative control, candidate benchmark/regression, changed-file gate, and per-file timings. Its paired measurement is the table above.Full implementation gate:
node scripts/check-changed.mjs --base 6c7544adc982— passed, including core plus all 25 test typecheck graphs, lint, dead exports, and guards.Final per-file cost runs:
/usr/bin/time -p pnpm test <file> --maxWorkers=1— all 52 tests passed: projection-context 22.02 s (5 tests), registry-queries 9.97 s (30), identity benchmark 8.91 s (1), subagent-index 31.38 s (16). Wrapper/compiler startup is included; the context file spent 16.2 s preparing compiler outputs. The existing subagent-index integration fixture spent about 17 s in database/recovery/drain tests; only its build-count expectation changed. The full final invocation took 29m16s. All leases were stopped.Read-only construction follow-up on lease
tbx_01m3ehcc34xfvcv0x6vnzq7g1a(run): the extended existing test failed on the earlier candidate with four writes through the input map, then all 54 query/memory/projection tests passed in 53.61 s.node scripts/run-tsgo.mjs -p tsconfig.core.json, theagents-othertest graph, and targetednode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.jsonpassed. This guard removes construction-time writes; the measured keyed publication behavior remains covered by the final regressions. The invocation passed in 3m43s and the lease was stopped.Hosted CI repair on lease
tbx_01m3ejyff8akybwa0pk93tq93e(run): CI run 36234016711 found that the function-valued iterator wrapper was dropped bystructuredClonein the existing materialization immutability test. Replaying its 40-file Node selection reproduced that exact failure; with the Set-backed facts, all 562 tests passed (118.31 s), without changing the wire goldens or materialization expectations. The 30 query tests passed (10.26 s pnpm wall), and 21 focused projection tests passed (35.53 s wrapper wall). Core and affected test-graph typechecks plus targeted lint passed; independent review was clean through P2. This invocation passed in 6m20s and the lease was stopped.Independent Codex autoreview: clean through P2 for the main implementation and both follow-ups.
git diff --checkpassed.Final hosted CI: run 36235445956 passed on
6b6d7c67fb1c6b42d0782b0b398408d516fe30a9, includingopenclaw/ci-gate. Hosted run elapsed approximately 14m25s; the repairedchecks-node-changed-compact-large-11job took 298 s, including setup and its grouped tests.No live Gateway was modified or restarted. Production heap-burst/stall reduction remains to be verified after deployment.