Skip to content

fix: avoid redundant work when opening dashboards - #139055

Merged
steipete merged 2 commits into
mainfrom
codex/dashboard-startup-followup
Sep 5, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/dashboard-startup-followup

Conversation

@steipete

@steipete steipete commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

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:

Measurement Before After
Named-link resolver requests 2 1
Dashboard-only background history requests 2 0
Selected-session startup requests 1 1
Named-link widget-ready median 1.60 s 1.68 s
Short-link widget-ready median 1.38 s 1.32 s

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.

  • 215 focused route, startup, prefetch, board, retained-pane, and transcript-loading unit cases passed. Regression expectations failed before the corresponding repair.
  • The first hosted run caught the lifecycle test’s old two-event expectation and the route test file’s line limit. The lifecycle assertion now verifies mount, visible conversation, and detach explicitly; handoff cases now share one fixture across focused suites while preserving all timing/identity assertions. The file-size failure appeared in the CI merge ref after main added qualified-global navigation coverage.
  • Two production-bundle browser cases preserve deferred history across named and decorative-short chat canonicalization, with exactly one startup and the correct session/transcript.
  • UI production and UI page/E2E test typechecks, changed-file formatting/lint, and independent Codex review through P2 passed.
  • Production delta: +89 lines, for the new per-pane visibility fact/admission boundary and connection-safe resolution transfer. Reuses the existing handoff, events, scheduler, and cache; no schema, configuration, dependency, or protocol changes. Tests/support net +354 lines; docs net zero.

Before (synthetic fixture):

Dashboard before

After (synthetic fixture, same content and interaction):

Dashboard after

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 8:15 AM ET / 12:15 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: a3f2a6a42aa2d7eb1e999dde2044fcbe075318e1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with relevant browser measurements and regression coverage, without blocking findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Reported production-bundle browser runs exercise route canonicalization and pane-driven warming with real resolver/list handlers, showing fewer requests and unchanged startup/widget interaction. This supports the request-issuance claim; it does not establish authenticated production latency.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Reported production-bundle browser runs exercise route canonicalization and pane-driven warming with real resolver/list handlers, showing fewer requests and unchanged startup/widget interaction. This supports the request-issuance claim; it does not establish authenticated production latency.
Evidence reviewed 10 items Introduced scope and review continuity: The merge-base-to-head comparison matches the 17 supplied introduced paths. The four central production modules have identical Git blobs at the previously reviewed head and current head; the follow-up changes tests and shared fixtures. The previous completed review contains no findings.
Canonical navigation owner: The route loader prepares the existing pathname-specific handoff only while its captured client and handshake remain current. The handoff consumer checks both identities and consumes the value once; ChatPage performs the canonical URL replacement.
Presentation and request admission: Pane-local presentation combines committed conversation layout with visual and route presentation. The scheduler requires a conversation in its owning page or explicit session intent, retains shell-wide transcript priority, and rechecks admission after stored reads and before cursor-reset requests.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +89, Tests +354, Docs 0. Total +443 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 6 95 6 +89
Tests 10 714 360 +354
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 810 367 +443

Review metrics

Metric Value Why it matters
Production versus test growth Production +89; tests/support +354; docs net 0 After accounting for moved fixtures, production growth adds pane-owned visibility and connection-safe admission to existing mechanisms.
Reported dashboard request reduction Resolver 2→1; background history 2→0; selected startup 1→1 The browser measurements support reduced work without claiming a reliable latency improvement.

Technical review

Best 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.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Reported production-bundle browser runs exercise route canonicalization and pane-driven warming with real resolver/list handlers, showing fewer requests and unchanged startup/widget interaction. This supports the request-issuance claim; it does not establish authenticated production latency.

Label justifications:

  • P2: This is a bounded dashboard efficiency repair with preserved selected-session behavior and no demonstrated urgent outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Reported production-bundle browser runs exercise route canonicalization and pane-driven warming with real resolver/list handlers, showing fewer requests and unchanged startup/widget interaction. This supports the request-issuance claim; it does not establish authenticated production latency.
  • proof: sufficient: Contributor real behavior proof is sufficient. Reported production-bundle browser runs exercise route canonicalization and pane-driven warming with real resolver/list handlers, showing fewer requests and unchanged startup/widget interaction. This supports the request-issuance claim; it does not establish authenticated production latency.

Evidence

What I checked:

  • Introduced scope and review continuity: The merge-base-to-head comparison matches the 17 supplied introduced paths. The four central production modules have identical Git blobs at the previously reviewed head and current head; the follow-up changes tests and shared fixtures. The previous completed review contains no findings. (a3f2a6a42aa2)
  • Canonical navigation owner: The route loader prepares the existing pathname-specific handoff only while its captured client and handshake remain current. The handoff consumer checks both identities and consumes the value once; ChatPage performs the canonical URL replacement. (ui/src/pages/chat/route-loader.ts:226, a3f2a6a42aa2)
  • Presentation and request admission: Pane-local presentation combines committed conversation layout with visual and route presentation. The scheduler requires a conversation in its owning page or explicit session intent, retains shell-wide transcript priority, and rechecks admission after stored reads and before cursor-reset requests. (ui/src/pages/chat/session-prefetch.ts:603, a3f2a6a42aa2)
  • Sibling and lifecycle coverage: Inspected coverage includes chat/dashboard canonicalization, client and handshake replacement, colliding navigation hints, Home transcript priority, split-pane visibility, pointer/focus intent, stored-read interruption, cursor resets, and bounded cache retention. (ui/src/pages/chat/session-prefetch-lifecycle.test.ts:57, a3f2a6a42aa2)
  • Browser regression coverage: The two added browser cases hold startup responses across named and decorative-short canonicalization, then assert the selected transcript, visible session identity, and exactly one startup request. These tests were inspected, not executed during this read-only review. (ui/src/e2e/chat-flow.history-issuance.e2e.test.ts:23, a3f2a6a42aa2)
  • Current-main necessity and release boundary: Pinned main still returns canonical route data without preparing this handoff and admits automatic prefetch using transcript readiness alone. The supplied latest release is v2026.9.1; its relevant historical blob could not be read because GitHub DNS was unavailable, so no shipped-version conclusion is claimed. (ui/src/pages/chat/route-loader.ts:221, 8deaa18a397f)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-05T11:52:31.941Z sha a83750c :: needs maintainer review before merge. :: none

@steipete
steipete merged commit d9bc112 into main Sep 5, 2026
134 checks passed
@steipete
steipete deleted the codex/dashboard-startup-followup branch September 5, 2026 12:24
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
* fix: avoid redundant work when opening dashboards

* test: align dashboard lifecycle and route coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant