Repository navigation
improve: reduce repeated work when listing sessions across agents - #149057
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 September 15, 2026, 9:01 AM ET / 13:01 UTC (Revision 2). ClawSweeper reviewWhat this changesBatch prepared model-catalog reads when listing sessions across agents, reducing repeated roster work while preserving per-agent results and the existing scalar reader. Merge readiness✅ Ready for maintainer review The optimization remains useful on current main, and no actionable introduced defect was found. The updated evidence addresses the earlier build/export follow-up; this maintainer-owned PR remains eligible for ordinary landing review. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway combines stored sessions with each agent’s published model information to answer session-list requests. This change batches the catalog reads before session projection and response-cache selection. flowchart TD
A[Session-list request] --> B[Select configured agents]
B --> C[Batch published catalog reads]
D[Current configuration and roster facts] --> C
C --> E[Per-agent catalog results]
E --> F[Session projection and cache]
F --> G[Session-list response]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +83, Tests +112. Total +195 across 11 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use the existing roster owner for synchronous batch reads while retaining scalar compatibility, per-agent isolation, and generation-aware response caching. Do we have a high-confidence way to reproduce the issue? Yes at the source level: current main repeatedly resolves roster facts through scalar catalog reads before cache selection. The PR supplies controlled work counts; this review did not execute the comparison. Is this the best way to solve the issue? Yes. Batching through the existing roster owner removes repeated work without adding persistent state, changing catalog ownership, or replacing the supported scalar interface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e00500a65429. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
What Problem This Solves
Opening or refreshing the session list repeats agent-roster work that grows quadratically with the number of configured agents, including on response-cache hits.
User Impact
Session-list requests do less repeated work as the configured agent count grows, while returning the same session and model information.
Why This Change Was Made
Read prepared catalogs as one synchronous batch after the existing lazy import. The existing roster owner shares derived facts within that batch and discards them before returning. Scalar and batch reads share the catalog projection, and the published scalar interface remains available.
Per-agent failures remain isolated. Reads use published catalogs without initiating provider discovery and continue to observe configuration, catalog, and registry replacement.
Evidence
sessions.listcomparison preserved all 20 complete response tuples, response-cache object reuse, and catalog/registry replacement behavior.399cc6929287; all observed processes settled, and the lease was stopped. This is proof for that recorded candidate, not a build of the later main integration.Hosted CI 34966814800 on
399cc6929287failed six thinking-route auth fixture cases before their route assertions (2,034 passed in that shard). The failing test and runtime/model owners are outside this 11-file diff. Merged #149049 supplies the missing runtime auth-store fixture reader. Current head9512b14690ecintegrates mainc0be265998d0, including that repair. Ten complete changed files remain identical; the session handler also incorporates main changes to its separate search path. The catalog patch and incoming main delta are preserved. Exact-head CI34970412573 passed under the maintained current-check selection with no pending checks; eight superseded check entries remain retained. Native landing gates still apply, and the earlier failure remains recorded.