Skip to content

perf: load named dashboards without session-list searches - #138860

Merged
steipete merged 5 commits into
mainfrom
codex/dashboard-load-performance
Sep 5, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/dashboard-load-performance

Conversation

@steipete

@steipete steipete commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

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 reference selector is additive. Its exact-key lookup uses discovery visibility; the existing key selector 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.

Time to interactive widget Before After
Named dashboard link 18.52 s 6.38 s
Short-ID dashboard link 8.20 s 5.19 s

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.list searches are replaced by one small sessions.resolve reference 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:
Before: synthetic dashboard and working control

After:
After: same synthetic dashboard and working control

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 waitForMainActorWork uses also merit an owner-by-owner synchronization audit.

@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 gateway Gateway runtime size: L maintainer Maintainer-authored PR labels Sep 5, 2026
@steipete
steipete marked this pull request as ready for review September 5, 2026 04:44
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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, 2:43 AM ET / 06:43 UTC.

ClawSweeper review

What this changes

Speeds 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
Reviewed head: a601c2051c5924f59ba38983f07ed0be12afb106

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused optimization with credible production-path measurements, relevant regression coverage, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured measurements exercise production UI bundles, real resolver/list handlers, and SQLite, reporting faster named and short dashboard loads with working widget controls. The subsequent head changes only test synchronization; unavailable screenshot inspection does not invalidate the recorded runtime evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured measurements exercise production UI bundles, real resolver/list handlers, and SQLite, reporting faster named and short dashboard loads with working widget controls. The subsequent head changes only test synchronization; unavailable screenshot inspection does not invalidate the recorded runtime evidence.
Evidence reviewed 11 items Pinned re-review scope: The raw head parent is the previous reviewed revision. Their complete delta changes only Watch-test synchronization; the dashboard implementation is unchanged. The supplied stale test merge was not used to infer merge-result removals.
Watch callback ownership: The complete affected test retains both failure scenarios, the held first send, acceptance and terminal-state assertions, replay checks, and coordinator cleanup. Warning and receipt callbacks replace polling with the same two-second deadlines. The production coordinator persists terminal state before sending its receipt.
Canonical resolution boundary: The new reference branch uses OpenClaw’s existing combined-store reader, session-key normalization, display-name projection, and visibility filter. Exact keys precede UUID-backed slug matches; ambiguity is bounded to ten. These imports and contracts are OpenClaw-owned and establish no Codex runtime dependency.
Findings None None.
Security None None.

How this fits together

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

Before merge

None.

Agent review details

Security

None.

PR surface

Source -45, Tests +233, Docs 0, Other +21. Total +209 across 24 files.

View PR surface stats
Area Files Added Removed Net
Source 8 172 217 -45
Tests 13 531 298 +233
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 40 19 +21
Total 24 744 535 +209

Review metrics

Metric Value Why it matters
Production versus test delta Runtime/protocol −45 lines; tests/support +250; generated Swift +4 The optimization absorbs discovery into existing owners while removing more production code than it adds.
Public surface 1 optional RPC selector added; 0 configuration or database-schema changes Existing selectors remain available, and the updated UI ships with its matching Gateway.

Technical review

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

Labels

Label justifications:

  • P2: This improves existing dashboard-link latency on large session histories without an urgent availability or data-loss report.
  • 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): The captured measurements exercise production UI bundles, real resolver/list handlers, and SQLite, reporting faster named and short dashboard loads with working widget controls. The subsequent head changes only test synchronization; unavailable screenshot inspection does not invalidate the recorded runtime evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured measurements exercise production UI bundles, real resolver/list handlers, and SQLite, reporting faster named and short dashboard loads with working widget controls. The subsequent head changes only test synchronization; unavailable screenshot inspection does not invalidate the recorded runtime evidence.

Evidence

What I checked:

  • Pinned re-review scope: The raw head parent is the previous reviewed revision. Their complete delta changes only Watch-test synchronization; the dashboard implementation is unchanged. The supplied stale test merge was not used to infer merge-result removals. (apps/ios/Tests/NodeAppModelInvokeTests.swift:6460, a601c2051c59)
  • Watch callback ownership: The complete affected test retains both failure scenarios, the held first send, acceptance and terminal-state assertions, replay checks, and coordinator cleanup. Warning and receipt callbacks replace polling with the same two-second deadlines. The production coordinator persists terminal state before sending its receipt. (apps/ios/Tests/NodeAppModelInvokeTests.swift:6474, a601c2051c59)
  • Canonical resolution boundary: The new reference branch uses OpenClaw’s existing combined-store reader, session-key normalization, display-name projection, and visibility filter. Exact keys precede UUID-backed slug matches; ambiguity is bounded to ten. These imports and contracts are OpenClaw-owned and establish no Codex runtime dependency. (src/gateway/sessions-resolve.ts:213, a601c2051c59)
  • Fresh sharing reads: Session listing passes its prepared store discovery into the existing grouped exact reader, then reapplies visibility before returning rows. The retained page-refill regression changes a selected row to draft during projection and checks replacement-page and cursor behavior without full-store rematerialization. (src/gateway/server-methods/sessions-read.ts:315, a601c2051c59)
  • Discovery versus exact-read coverage: The handler regression verifies that another profile’s hidden draft is absent from reference discovery while the separate exact-key selector retains its existing read contract. Resolver coverage also checks archived sessions, label precedence, opaque casing, global ownership, and bounded ambiguity. (src/gateway/server.sessions.preview-resolve.test.ts:389, a601c2051c59)
  • Current-main necessity: Fetched main still implements browser-side exact/slug searches with pagination, and its resolver schema lacks the reference selector. No canonical replacement was established from the supplied context; the attempted GitHub search was unavailable. (ui/src/pages/chat/route-loader-session-reference.ts:24, bfbf880320bf)

Likely related people:

  • Peter Steinberger: 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 (3 earlier review cycles)
  • reviewed 2026-09-05T04:55:33.239Z sha ac871e4 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-05T05:42:52.356Z sha 783c115 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-05T05:52:59.616Z sha 4b16112 :: needs maintainer review before merge. :: none

@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

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

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added the app: ios App: ios label Sep 5, 2026
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

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

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Final landing proof for a601c2051c5924f59ba38983f07ed0be12afb106:

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.

@steipete
steipete merged commit 39f9d61 into main Sep 5, 2026
204 checks passed
@steipete
steipete deleted the codex/dashboard-load-performance branch September 5, 2026 07:20
@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
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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