Repository navigation
refactor(subagents): share ordered read membership - #163092
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: needs maintainer review before merge. Reviewed October 1, 2026, 7:38 PM ET / 23:38 UTC. ClawSweeper reviewWhat this changesThe PR combines subagent run-ID and session-relationship lookup membership while preserving ordered reads and lazy session indexing. Merge readiness✅ Ready for maintainer review Keep open: this is a coherent internal simplification that remains distinct from current main. Source review found no actionable correctness or security defect. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s subagent registry combines live run records with persisted snapshots for waits and session queries. Derived lookup indexes select relevant records before the read layer hydrates and consumes their current payloads. flowchart TD
A[Live run records] --> C[Shared ordered membership]
B[Persisted snapshot records] --> C
D[Owner publications] --> C
C --> E{Requested read scope}
E --> F[Exact run lookup]
E --> G[Lazy session relationships]
F --> H[Selected current run payloads]
G --> H
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -27. Total -27 across 5 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one publication-owned ordered membership index, with eager exact-run selection and lazily rebuilt session relationships. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR proposes behavior-preserving consolidation rather than reporting a failing user flow. Existing boundary tests were inspected, but execution was outside this read-only review. Is this the best way to solve the issue? Yes: extending the existing membership owner removes duplicate lifecycle plumbing while retaining exact lookup, session invalidation, and ordering contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bd058c2d9999. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Subagent snapshot reads maintain separate ordered membership owners for run IDs and session relationships, duplicating update and invalidation plumbing.
User Impact
No intended behavior change. Exact-run waits retain their eager lookup, session relationships remain lazy, and reads preserve insertion order and current owner publications. No migration or operator action is required.
Why This Change Was Made
Use the existing session-read lookup for both kinds of membership and remove the standalone run-ID class and duplicate cache lifecycle. The complete cutover removes 27 production lines without changing schema, dependencies, or tests.
Evidence
All 77 existing owner cases passed across four files (138.84-second wrapper). Selected checks and independent Codex P2 review passed; removed class/getter names have no remaining production references.
Synthetic 1,000/10,000/50,000-record probes retained constant-work first exact lookup and post-publication lookup. At 50,000 records, registration medians stayed about 152ms; 10,000 broad publications changed from 12.09ms to 22.48ms, approximately 1 microsecond more per publication, with no size-dependent scan. These are one bounded five-iteration comparison, not a sustained-throughput claim. No production Gateway was modified.