Repository navigation
perf: load named dashboards without session-list searches - #138860
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 5, 2026, 2:43 AM ET / 06:43 UTC. ClawSweeper reviewWhat this changesSpeeds dashboard links through metadata-only session resolution, batches sharing reads, and updates protocol models, browser fixtures, and Watch-test synchronization. Merge readiness✅ Ready for maintainer review The performance work remains useful on current main. Re-review found no actionable introduced defect, including in the Watch-test synchronization follow-up. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI resolves dashboard and chat links through the Gateway’s session catalog before opening the selected board. The Gateway reads session metadata from SQLite and applies the caller’s existing visibility rules. flowchart TD
A[Dashboard or chat link] --> B[Control UI route loader]
B --> C[Gateway session resolver]
D[SQLite session metadata] --> C
C --> E[Visibility and exact-key precedence]
E --> F[Matching session or bounded candidates]
F --> G[Board or missing-session view]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -45, Tests +233, Docs 0, Other +21. Total +209 across 24 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use one authoritative discovery path that preserves visibility, exact-key precedence, archived sessions, and board preferences without loading unrelated runtime data. Do we have a high-confidence way to reproduce the issue? Yes for the performance mechanism: current main performs paginated exact and slug searches when opening an uncached named dashboard. The supplied stress measurements demonstrate the cost; this review did not rerun the workload. Is this the best way to solve the issue? Yes. The patch removes duplicate browser search logic and reuses existing storage and presentation owners; the Watch follow-up observes existing callbacks without weakening durable-state assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bfbf880320bf. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
@clawsweeper re-review The CI corrections now preserve current RPC errors and ignore stale connection results. Shared browser fixtures resolve canonical exact/short identities, and the full-store-read regression now asserts zero rematerialization on the first request. Final local proof passes 81 UI tests, five affected browser scenarios, four backend cases, type-aware lint and formatting. The PR body includes the final production-bundle/SQLite measurements and synthetic screenshots. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The dashboard implementation and measurements are unchanged. Final iOS CI exposed a remaining busy-yield wait in the existing Watch journal test; this head completes that test's callback-owned synchronization for warnings and terminal receipts, preserving its two-second deadlines and every durable/replay assertion. Swift formatting/parsing, 25 compiled stream/timeout sequences, and focused independent review pass. The full original-order iOS lifecycle suite is rerunning in exact-head CI; the PR body records the evidence. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Final landing proof for Exact-head CI is green. Independent review is complete with all actionable findings addressed, and ClawSweeper reviewed this exact head with no findings or required pre-merge changes. The Gateway resolver now owns named-reference selection using its metadata projection, replacing two browser session-list searches. Fresh sharing reads reuse grouped exact lookups and the prepared store discovery. Production/protocol source is net -45 lines; tests/support +250; generated Swift +4. Existing key-read semantics, discovery visibility, archived sessions, ambiguity, cancellation, stale/current connection handling, and alternate-store sharing/refill have focused coverage. The final production-bundle/SQLite fixture measured named-widget readiness at 18.52 s before versus 6.38 s after, and short-ID readiness at 8.20 s versus 5.19 s. Every widget control worked. These are loaded local stress-fixture timings, with unrelated Gateway responses mocked. Local proof includes 142 initial focused tests plus the final 81-test UI suite, five browser scenarios, four backend cases, lint/format, and UI type checking. The last type-only fix emits byte-identical JavaScript. An existing Watch journal test synchronization flake was repaired after iOS CI exposed it: callback-owned warning/receipt events replace busy-yield polling under unchanged two-second deadlines and unchanged assertions. Swift parsing/formatting and25 compiled stream/timeout sequences pass; the final iOS lifecycle CI validates the original execution order. |
|
Merged via squash.
|
…38860) * perf: resolve dashboard links without session-list searches * style: format session reference coverage * fix: preserve dashboard route errors and canonical browser fixtures * test: preserve session fixture candidate literal types * test(ios): await Watch journal warning and receipt callbacks
What Problem This Solves
Fixes slow session-dashboard links on gateways with large session histories. A name-only link previously searched full session listings twice before requesting its board; short links also hydrated unrelated model/runtime metadata and saved prompt snapshots.
Why This Change Was Made
Resolve named references in the existing Gateway resolver with one metadata-only read: an exact visible key wins, otherwise match the display-name slug of UUID-backed sessions. This removes the browser's substring searches and pagination. Short-ID resolution uses the same small presentation projection. Session-list sharing refreshes use the existing grouped exact reader and retain the listing's prepared store discovery.
The optional
referenceselector is additive. Its exact-key lookup uses discovery visibility; the existingkeyselector keeps its separate read semantics. Archived sessions, opaque identifier casing, global ownership, ambiguity, fresh sharing checks, and page refills are preserved. Protocol docs and generated Swift models are updated; no configuration, database schema, or protocol-version change.User Impact
Named dashboard links reach their widgets sooner, with the same content and controls. Chat links and session listings also avoid unnecessary work.
Evidence
Production Control UI bundles, real resolver/list handlers, and real SQLite storage were measured locally with 2,000 synthetic sessions (8 KiB saved prompts on background sessions). Other Gateway responses were mocked; the sandboxed widget was loaded and its button clicked successfully in all eight runs per candidate. Medians below use three measured runs after one warm-up for each route.
The named-link reduction is 66%. The workstation was heavily loaded, so these are local stress-fixture timings, not a production latency promise. The route-specific two
sessions.listsearches are replaced by one smallsessions.resolvereference request.Independent owner measurements: short-ID lookup warm median 64.81 ms → 6.05 ms on 256 rows with 100 KiB saved prompts; sharing refresh for 50 rows in a 10,000-session store uses 30.52 ms → 14.43 ms CPU with identical output. Cold-store checks preserve the read-only lifecycle.
Regression proof: the original code fails the named-reference route case, the unrelated-model-projection case, and the bounded sharing-refresh assertion. A broader sibling run found registered alternate-store discovery loss during development; the final reader retains that discovery and the regression now passes. Final independent Codex review is complete with no unresolved actionable findings through P2. Runtime/protocol-source delta: -45 lines; generated Swift: +4; tests and test support: +250. No new configuration or database surface; one optional protocol selector.
All 142 initial local tests across seven Gateway, protocol-schema, and UI route files passed. Hosted CI then exposed obsolete browser fixtures, an outdated full-store-read assertion, and two lint violations. The repaired shared fixture now resolves canonical session identity, and current RPC failures remain visible in the route error view while stale connection results are ignored. The final candidate passes 81 UI unit tests, all five affected browser scenarios (desktop/mobile error view, HTTPS bootstrap, native catalog adoption, and missing links), four focused backend cases, targeted type-aware lint, and formatting. The final fixture return-type annotation also passes the UI type checker and emits byte-identical JavaScript; focused Codex review is clean through P2. The final iOS lifecycle run also exposed a remaining busy-yield wait in the existing Watch journal test: the successful send preceded the storage-warning callback by the polling deadline. That test now observes its existing warning and terminal-receipt callbacks with the same two-second timeout and unchanged claim/replay assertions, completing the earlier first-send synchronization repair. Swift parsing and formatting pass, and the exact-head iOS lifecycle and Apple Watch operation simulator suites now pass. Exact-head hosted CI is green, including both screenshot jobs. The final browser performance rerun above covers this repaired candidate; the earlier candidate measured 6.28 s for the named link.
ClawSweeper reviewed the final head at 06:43 UTC, including the Watch test synchronization fix, with no actionable findings or required pre-merge changes. Independent review covered the full candidate and CI repairs.
Before:

After:

Known separate follow-ups: remove the redundant stored-face lookup for synthetic native catalog threads and its stale fixture; move non-admin mutation authorization's remaining full-store reads to its scoped owner. Neither is needed for this dashboard's read path. The remaining iOS
waitForMainActorWorkuses also merit an owner-by-owner synchronization audit.