Repository navigation
Conversation
Keep ready command and neutral model projections for unchanged agents during agent-local metadata refresh. Preserve global and per-agent freshness fences, explicit invalidation, personal-account isolation, and shutdown ownership. Bind reusable reads outside generation settlement scopes so retired owners and session projections remain collectible.
|
🦞👀 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 October 5, 2026, 1:54 PM ET / 17:54 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch reuses unchanged agents’ prepared commands and model metadata across refreshes and adds regression and memory-retention coverage. Merge readiness⛔ Blocked before merge - 2 items remain Keep open: cross-refresh reuse remains distinct from the merged startup and session-list improvements, and no verified merged PR supersedes this contribution. Priority: P2 Review scores
Verification
How this fits togetherGateway chat metadata combines published model-owner facts, commands, and session account selections for chat clients. Refresh and invalidation determine which prepared results those clients can reuse. flowchart TD
A[Published agent facts] --> B[Chat metadata refresh]
C[Config and plugin versions] --> B
B --> D{Unchanged agent facts?}
D -->|Yes| E[Reuse settled preparation]
D -->|No| F[Prepare commands and models]
E --> G[Current chat metadata response]
F --> G
H[Request account selection] --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +52, Tests +181, Other +4. Total +237 across 9 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep reuse inside main’s existing demand-driven metadata owner, carrying forward only settled unchanged preparation within its cache bounds and freshness fences. Do we have a high-confidence way to reproduce the issue? Yes, at source level: prepare two agents, replace one owner, refresh, then read the unchanged agent; main creates empty preparation caches and rebuilds that agent on demand. No runtime reproduction was executed. Is this the best way to solve the issue? Unclear for the final landing patch: guarded reuse is sensible, but it must be adapted to main’s lazy bounded caches rather than preserving the older eager generation model. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d511ab92b63a. 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 (3 earlier review cycles)
|
|
The eager whole-roster refresh this benchmark targeted has been replaced by demand-driven per-agent preparation (#149716), with further startup command reuse in #175674. Closing the stale implementation; additional cross-generation reuse would need evidence against the current path. Closed in a sweep of stale maintainer PRs (no activity for 7+ days). Reopen with a current reproduction if this still matters. |
Related: #147137
What Problem This Solves
Chat metadata refresh for one agent repeated command and model-catalog preparation for every unchanged agent, adding avoidable latency to chat reads on multi-agent Gateways.
User Impact
Agent-local metadata refresh does less work before waiting chat reads can complete. Global refresh, authority changes, and shutdown retain their existing publication fences.
Why This Change Was Made
Carry forward settled neutral projections and command lists only when their config, plugin generation, agent owner, auth revisions, catalog identity/status, and skill version still match. Explicit invalidation or failure discards this reuse opportunity. Personal-account projections remain request-local. The reusable read wrapper captures its required facts separately so it does not retain older generations.
Evidence
The real published-owner regression fails on the original code: replacing one owner in a 64-agent fixture produces 128 builds instead of 65. The repaired test covers 1/64-agent entries/list layouts, explicit invalidation, unavailable owners, and roster changes. All 66 focused checks pass, including metadata refresh, auth deadlines, shutdown, personal accounts, and a bounded GC child that verifies retired owners and session projections are collectible while current reads still work.
A local Node 26.8.2 synthetic workload used 32 models and 64 small sessions per agent with unmodified command/model projection implementations. At 16 agents, median one-owner refresh fell from 166.9 ms to 20.6 ms across four observations per condition; preparation fell from 16 command/catalog pairs to one. Full-roster refresh still rebuilds all 16. Native worker ownership and shutdown passed.
These local measurements establish redundant preparation cost. They do not establish the cause of production multi-second stalls or remove the global refresh wait. Isolated Gateway client proof and exact-head CI are still pending.