Repository navigation
feat(gateway/ui): command-lane diagnostics with debug page table and global busyness overlay - #125591
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 18, 2026, 3:47 AM ET / 07:47 UTC. ClawSweeper reviewWhat this changesThe PR adds a bounded Gateway RPC for command-lane load data, shows it on the Control UI Debug page, and adds a global System busyness overlay. Merge readinessThe bounded Gateway diagnostics work resolves the earlier protocol and payload concerns, but the new overlay preempts Escape from active dialogs and command palette, so this PR is not ready to merge. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) Assertions:
How this fits togetherThe Gateway scheduler tracks active and queued command lanes; the diagnostics RPC exposes bounded snapshots to the Control UI Debug page and an on-demand overlay. User shortcuts and account-menu actions open the overlay, which polls the Gateway and renders system load. flowchart LR
Scheduler[Command scheduler] --> Snapshot[Bounded lane snapshot]
Snapshot --> Gateway[Gateway diagnostics RPC]
Gateway --> DebugPage[Debug page table]
Gateway --> Overlay[System busyness overlay]
AccountMenu[Account menu and shortcut] --> Overlay
Overlay --> Operator[Operator views system load]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +901, Tests +264, Other +77. Total +1242 across 31 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Give existing dialogs and higher-priority overlays first claim on Escape, then close System busyness only when it is the active surface. Do we have a high-confidence way to reproduce the issue? Yes, from source: with the overlay and command palette open, the overlay’s capture-phase Escape handler deterministically prevents the palette’s default-aware Escape handler from receiving ownership; no local browser run was performed in this read-only review. Is this the best way to solve the issue? No: capture-phase Escape handling is not the best fit; defer to active modal or dialog ownership, then close the overlay when it is the active surface. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5db8368f35a5. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…-visible lanes load Addresses ClawSweeper review findings on #125591: diagnostics.lanes moves to the append-only tail of the descriptor table, the Control UI lanes request fails visibly instead of masking errors, and the RPC exports only static lane snapshots plus a bounded dynamic-session aggregate composed in the new command-lane-diagnostics module.
…mock it in the debug e2e
|
Merged via squash.
|
…global busyness overlay (openclaw#125591) * feat(gateway): expose command lane diagnostics * feat(ui): add live debug busyness overlay * fix(ui): show newest events in debug overlay and update diagnostics call-list tests * test(ui): add lane and status fixtures to the mocked dashboard * feat(ui): add System busyness entry to the account menu * fix(gateway/ui): bound lane diagnostics, append-only descriptor, fail-visible lanes load Addresses ClawSweeper review findings on openclaw#125591: diagnostics.lanes moves to the append-only tail of the descriptor table, the Control UI lanes request fails visibly instead of masking errors, and the RPC exports only static lane snapshots plus a bounded dynamic-session aggregate composed in the new command-lane-diagnostics module. * chore(protocol): regenerate Kotlin gateway methods for diagnostics.lanes * test(gateway/ui): register diagnostics.lanes in the 2026.8 train and mock it in the debug e2e
What Problem This Solves
The Gateway's command-lane scheduler knows exactly how busy the system is — per-lane
activeCount,queuedCount,maxConcurrent, group budgets, and a typedblockedByreason — but none of that reaches the protocol or the Control UI. When themainlane saturates (default 8–16 top-level turns) or thesubagentlane fills (default 8), queued work is indistinguishable from idle or running work. There was no way to see system busyness at a glance, and the/debugpage had no live capacity view.Why This Change Was Made
Operators and maintainers need a low-friction answer to "how busy is this Gateway right now?", available from anywhere in the UI, and a place that is trivially extensible with new diagnostic panels.
diagnostics.lanesmethod (operator.read, since2026.8) returning name-sortedCommandLaneSnapshot[]via a newgetAllCommandLaneSnapshots()— a serializer over the existing per-lane snapshot builder, no re-derived state.Cmd/Ctrl+Shift+Dtoggles a "System busyness" panel from any route (Escape closes; hotkey ignored in editable targets; polls every 2s only while open, generation-guarded aborts, no leaked timers/subscriptions). Sections are a registry (debug-overlay-sections.ts) of{ id, titleKey, load, render }— adding a future panel is one entry, no shell changes. Ships with: lanes (same row renderer as the page), event-loop/status, active runs, live event tail.Non-goals (explicitly out of scope): per-session queued phase in chat/sidebar, session status schema changes,
tickbroadcast changes. This PR only puts the lane facts on the wire and gives them maintainer-facing surfaces; product-level queued UX can build on the same method later.User Impact
/debugshows live command-lane capacity and queue pressure instead of nothing.⌘⇧D(Ctrl+Shift+D elsewhere) opens a live diagnostics overlay anywhere in the Control UI; the /debug page advertises the shortcut.operator.read.Evidence
Mocked dashboard (saturated fixture —
main 16/16 · 3 queued · blocked: lane,hook-dispatchgroup-budget block):Live proof (isolated dev gateway
--dev --auth none, ownOPENCLAW_STATE_DIR, dist-served UI at build3bbb068— see footer): real lane data, real event-loop numbers, real event tail. Notehook-dispatch 0/0 blocked: lane— the true zero-width lane published when hooks are disabled:There is no "before" screenshot pair: both surfaces are new (the /debug page previously had no lane view; the overlay did not exist).
Validation:
node scripts/check-changed.mjs— clean.src/gateway/server-methods/diagnostics.test.ts(throttled-lane active/queued coverage),server-methods-list.test.ts,method-scopes.test.ts,ui/src/pages/debug/view.test.ts,ui/src/app/app-host.test.ts(shortcut + editable-guard),ui/src/lib/gateway-diagnostics.test.ts,ui/src/pages/gateway-source-replacement.test.ts.pnpm ui:i18n:baseline+pnpm ui:i18n:verify— clean;pnpm lint:ui:styles— clean.pnpm ui:build— clean, largest CSS 43.7/45.0 KiB gzip budget.Known unrelated flake:
ui/src/pages/chat/chat-gateway.abort-diagnostic.test.tscan fail at import in broad local runs (window.addEventListener is not a function— an incompletewindowstub leaking from another test file). It passes alone and passes sharing a non-isolated worker with this PR's new test files, so this branch is not the polluter; tracked as a separate follow-up task.Account-menu entry (added after initial review)
The bottom-left account menu now has a "System busyness" entry (activity icon, platform shortcut hint) that toggles the same overlay via the shared
requestDebugOverlayToggle()contract — giving the overlay a discoverable entry point beyond the hotkey and the /debug page button. Script-verified: clicking the entry opens the overlay with the lanes table.ClawSweeper findings addressed (post-review)
All three findings from the initial ClawSweeper review are fixed:
diagnostics.lanesmoved to the tail ofCORE_GATEWAY_METHOD_SPECS; the legacy-order test's original prefix assertions are restored and extended by one appended entry instead of accepting an index shift..catch(() => null)fallback is removed — a faileddiagnostics.lanesrequest now rejects the debug page refresh through the existing diagnostics error path, per the Control UI same-version coupling policy. The overlay keeps per-section handling as transient poll resilience only.STATIC_COMMAND_LANESinsrc/process/lanes.ts) plus onedynamicaggregate{ laneCount, activeCount, queuedCount, queuedLaneCount }for per-session lanes — the payload is bounded regardless of session count. UI renders the aggregate as a single "Session lanes · N" row (visible in the refreshed screenshots above); server test coverage proves session-style lanes appear only in the aggregate, including the saturated/queued shape.