Repository navigation
fix: avoid redundant work when opening dashboards - #139055
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, 8:15 AM ET / 12:15 UTC. ClawSweeper reviewWhat this changesThe PR reuses resolved sessions during dashboard URL canonicalization, limits automatic history warming to visible conversations, and updates regression coverage and documentation. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful follow-up to the merged dashboard optimization, and current main still lacks both reductions. No blocking correctness or security findings were identified. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI resolves chat and dashboard links into sessions, then loads their panes and warms likely next conversations. These changes reduce background Gateway requests while preserving selected-session loading and explicit navigation intent. flowchart TD
A[Chat or dashboard link] --> B[Session resolution]
B --> C[Single-use navigation handoff]
C --> D[Selected session pane]
D --> E[Conversation visibility and loading]
F[Hover or keyboard focus] --> G[Background warming scheduler]
E --> G
G --> H[Bounded history requests]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +89, Tests +354, Docs 0. Total +443 across 17 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the existing handoff and scheduler, with presentation recorded by each pane; shared session state and route names cannot reliably replace that per-pane fact. Do we have a high-confidence way to reproduce the issue? Yes, from source: named dashboard canonicalization repeats resolution, and dashboard-only pages still qualify for automatic warming on pinned main; the supplied browser measurements corroborate both paths. Is this the best way to solve the issue? Yes. Reusing the existing handoff and recording visibility at the pane owner avoids a parallel cache or route-name heuristic, while preserving foreground loading and explicit navigation intent. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8deaa18a397f. LabelsLabel changes:
Label 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.
|
* fix: avoid redundant work when opening dashboards * test: align dashboard lifecycle and route coverage
Related: #138860
What Problem This Solves
Fixes an issue where opening a named dashboard repeats session resolution after replacing its URL with the canonical short link, then warms two unrelated conversation histories while only the dashboard is visible.
Why This Change Was Made
Carry the resolved session through the existing single-use navigation handoff. Capture the source connection before asynchronous resolution, so a stale reply cannot create a handoff for a replacement client or handshake.
The pane now reports whether its conversation is actually presented through the existing lifecycle event. Automatic prefetch belongs to visible conversations on the owning page; dashboard-only views warm only an explicitly hovered or keyboard-focused session. Shell-wide transcript-loading priority, including Home, remains in place, and request admission is checked again after storage reads and before cursor-reset retries. Selected-session startup, queued-message reconciliation, and dashboard metadata retain their existing owners.
User Impact
Named dashboard loads issue three fewer session RPCs: one duplicate resolver request and two unrelated history fetches. Canonical short links avoid the two history fetches. Opening the conversation resumes normal background warming; hover and keyboard navigation still prepare the intended session.
This is a request/work reduction, not a claimed wall-clock speedup. The local mock-history fixture did not establish a reliable latency improvement on the busy host.
Evidence
Production UI build with 2,000 synthetic sessions in local SQLite, real resolver/list handlers, real widget HTML and sandbox server; other Gateway methods mocked. Alternating before/after order, seven measured samples per variant and route after warm-up:
Every browser run rendered the widget and successfully clicked its Details button. A separate one-second post-interaction observation confirmed the missing history requests were not merely delayed. Resource count stayed 67; transferred bytes changed by 276 bytes. Timing samples vary substantially with host contention, and mocked history does not model the server cost saved by avoiding real transcript reads. Authenticated production measurement was unavailable while the target environment was in deployment recovery; no deployment was performed.
Before (synthetic fixture):
After (synthetic fixture, same content and interaction):