Repository navigation
fix: speed up short session links in large stores - #146803
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 13, 2026, 4:24 AM ET / 08:24 UTC (Revision 6). ClawSweeper reviewWhat this changesThe PR filters short session-link candidates before display projection and sorting, adds archived child-selection coverage, rebalances test compiler ownership, and repairs two sidebar test imports. Merge readiness✅ Ready for maintainer review The optimization remains useful: current main and the latest release still process unrelated sessions before narrowing short-ID matches. No actionable introduced defect was found, and the shared CI prerequisites do not supersede the distinct resolver improvement. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway resolves short session links against stored session metadata and the caller’s visibility rules. It returns a matching conversation, a bounded list of ambiguous candidates, or a missing-session result to the client. flowchart LR
A[Short session link] --> B[Gateway resolver]
C[Stored session metadata] --> B
B --> D[Prefix and visibility filters]
D --> E[Project and sort candidates]
E --> F[Apply slug hint]
F --> G[Matching session or ambiguity]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +3, Tests +30, Docs 0. Total +33 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep candidate narrowing inside the shared selector while preserving the existing visibility, ordering, and URL-resolution contracts. Do we have a high-confidence way to reproduce the issue? Yes, from source: resolving one short-ID match in a large store currently projects and sorts unrelated eligible rows before narrowing. This review did not execute the benchmark. Is this the best way to solve the issue? Yes. The existing selector already supports early predicates, so moving candidate narrowing there avoids a second implementation or cache while retaining established behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2acbeee46147. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
Move the complete managed worktree test family into the existing agents-tools graph. Preserve all canonical roots, graph identities, stripe assignments, compiler concurrency, and the existing 700-root target and 720-root cap.
Use the canonical createDeferred helper in the two remaining sidebar scope tests after the shared helper export was retired. Preserve the existing scope-replacement assertions.
|
Merged via squash.
|
* perf(gateway): filter short session matches before projection * fix(ci): restore agent test graph headroom Move the complete managed worktree test family into the existing agents-tools graph. Preserve all canonical roots, graph identities, stripe assignments, compiler concurrency, and the existing 700-root target and 720-root cap. * fix(test): complete sidebar deferred helper migration Use the canonical createDeferred helper in the two remaining sidebar scope tests after the shared helper export was retired. Preserve the existing scope-replacement assertions.
What Problem This Solves
Short session links spend unnecessary CPU projecting and sorting unrelated sessions as the session inventory grows.
User Impact
Short session links resolve with less synchronous work in large stores while preserving visibility, archived-session access, agent scoping, child-owner filtering, and collision handling.
Why This Change Was Made
The existing selector now filters by UUID prefix and visibility before projecting owner display data and sorting candidates. Slug narrowing and the stable ambiguity order remain with their existing owners. This optimization covers selection after session metadata loading.
The CI prerequisite moves all 30 managed-worktree test roots from
agents-otherinto the existingagents-toolsgraph. This restores headroom at 672 and 416 roots while preserving all 18 graphs, the 700-root guard, the 720-root hard cap, stripe assignments, and compiler concurrency. The existing inventory regression still requires every canonical root exactly once. Two sidebar scope tests also switch directly to the canonical deferred helper after its former re-export was retired; their assertions are unchanged.Evidence
spawnedBywith a stale slug.Exact published-head CI run 34747326205 passed on
ae35a43d18b5bf8227788eec4a1633824cdb21c0. The browser and real-Gateway E2E lanes were skipped by this change scope. Current main independently landed the identical two sidebar import migrations in #146862.