Skip to content

feat(gateway/ui): command-lane diagnostics with debug page table and global busyness overlay - #125591

Merged
steipete merged 8 commits into
mainfrom
steipete/concurrency-saturation-ux-e9152c
Aug 18, 2026
Merged

steipete merged 8 commits into
mainfrom
steipete/concurrency-saturation-ux-e9152c

Conversation

@steipete

@steipete steipete commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

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 typed blockedBy reason — but none of that reaches the protocol or the Control UI. When the main lane saturates (default 8–16 top-level turns) or the subagent lane 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 /debug page 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.

  • Gateway: new diagnostics.lanes method (operator.read, since 2026.8) returning name-sorted CommandLaneSnapshot[] via a new getAllCommandLaneSnapshots() — a serializer over the existing per-lane snapshot builder, no re-derived state.
  • /debug page: a real Lanes table (active/max, queued, group · active/budget, blocked reason) with saturated/queued rows emphasized via theme tokens, riding the existing 3s poll and failing soft when the method is unavailable.
  • Global overlay: Cmd/Ctrl+Shift+D toggles 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, tick broadcast 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

  • /debug shows 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.
  • No behavior change for normal operation: the overlay renders nothing until summoned; the new RPC is read-only diagnostics behind operator.read.
  • Production LOC is dominated by the new UI surface (overlay + sections + styles ≈ 580 lines, gateway +90); the feature is additive with no changes to scheduling behavior.

Evidence

Mocked dashboard (saturated fixture — main 16/16 · 3 queued · blocked: lane, hook-dispatch group-budget block):

debug page lanes table

overlay over chat

Live proof (isolated dev gateway --dev --auth none, own OPENCLAW_STATE_DIR, dist-served UI at build 3bbb068 — see footer): real lane data, real event-loop numbers, real event tail. Note hook-dispatch 0/0 blocked: lane — the true zero-width lane published when hooks are disabled:

live debug page

live overlay

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.
  • Focused suites green: 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.
  • Scripted browser checks (Playwright, both mocked and live): hotkey opens overlay, Escape closes, hotkey ignored while typing in the composer.
  • Autoreview (Codex/Sol, high, branch vs origin/main) — clean, no accepted findings.

Known unrelated flake: ui/src/pages/chat/chat-gateway.abort-diagnostic.test.ts can fail at import in broad local runs (window.addEventListener is not a function — an incomplete window stub 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.

account menu entry

ClawSweeper findings addressed (post-review)

All three findings from the initial ClawSweeper review are fixed:

  • P1 append-only descriptor table: diagnostics.lanes moved to the tail of CORE_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.
  • P2 fail-visible lanes loading: the .catch(() => null) fallback is removed — a failed diagnostics.lanes request 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.
  • P2 bounded lane inventory (adopting the review's recommended contract): the RPC now returns full snapshots only for the closed static lane set (STATIC_COMMAND_LANES in src/process/lanes.ts) plus one dynamic aggregate { 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.

@clawsweeper

clawsweeper Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 18, 2026 04:33
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Aug 18, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 18, 2026
@clawsweeper

clawsweeper Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed August 18, 2026, 3:47 AM ET / 07:47 UTC.

ClawSweeper review

What this changes

The 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 readiness

⚠️ Ready for maintainer review - 2 items remain

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

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The diagnostics design and coverage are substantive, but the new global Escape behavior has one concrete interaction regression.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; supplied UI screenshots are supplementary evidence.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; supplied UI screenshots are supplementary evidence.
Evidence reviewed 7 items Escape is captured by the new overlay first: The overlay registers a document keydown listener in capture phase, then prevents default and closes for Escape; this precedes bubble-phase modal handlers.
Existing command palette deliberately respects prior Escape ownership: The command palette only closes on Escape when default has not already been prevented, so the overlay's capture handler leaves it open.
Shell behavior assigns Escape to open dialogs and overlays: The existing shell policy explicitly yields Escape when the command palette, approval overlay, or an open dialog is present.
Findings 1 actionable finding [P2] Let active dialogs consume Escape before closing the overlay
Security None None.

Live Verification

Command: /debug

Result: FAIL (partial)

Skip to main content
Back to app
ESC
Settings
Ask OpenClaw
Profile
Appearance
Notifications
CONNECTIONS
Gateway
Channels
Communications
Talk
Devices
Cloud workers
AGENTS & TOOLS
Agents
Labs
Models
MCP
Memory
Automation
PRIVACY & SECURITY
Privacy & Security
Secrets
Approvals
SYSTEM
Infrastructure
Advanced
Debug
Logs
Updates
About
Server updated
Refresh for full capabilities
2026.7.10 · git@0123456
Debug
SNAPSHOTS
Refresh

Status, health, and heartbeat data.

Status
{
  "eventLoop": {
    "utilization": 0.42,
    "delayP99Ms": 12,
    "delayMaxMs": 87
  },
  "uptimeMs": 5412000
}
Health
{
  "agents": [],
  "defaultAgentId": "main",
  "durationMs": 0,
  "heartbeatSeconds": 0,
  "ok": true,
  "sessions": {
    "count": 1,
    "path": "",
    "recent": []
  },
  "ts": 1787039809633
}
Last heartbeat
{
  "ts": 1779440400000
}
LANES
Open overlay · Ctrl+Shift+D

Live command-lane capacity and queue pressure.

LANE	ACTIVE	QUEUED	GROUP	BLOCKED
cron	1/4	0		—
cron-nested	1/4	0	cron-hooks · 2/4	—
hook-dispatch	1/4	2	cron-hooks · 2/4	group-budget
main	16/16	3		lane
nested	0/1	0		—
subagent	8/8	5		lane
Session lanes · 23	9	4		—
MANUAL RPC

Send a raw gateway method with JSON params.

Method
Select a method…
browser.request
chat.abort
chat.metadata
chat.startup
openclaw.changes.list
openclaw.chat
openclaw.chat.history
progressCard.get
question.list
sessions.catalog.list
sessions.catalog.read
sessions.create
sessions.delete
sessions.diff
sessions.files.set
sessions.fork
sessions.groups.delete
sessions.groups.list
sessions.groups.put
sessions.groups.rename
sessions.patch
sessions.patchMany
system.info
terminal.open
Params (JSON)
Call
Call
MODELS

Catalog from models.list.

[
  {
    "id": "claude-opus-4-8",
    "name": "Claude Opus 4.8",
    "provider": "anthropic",
    "available": true
  },
  {
    "id": "claude-sonnet-4-6",
    "name": "Claude Sonnet 4.6",
    "provider": "anthropic",
    "available": true
  },
  {
    "id": "gpt-5.6-luna",
    "name": "GPT-5.6 Luna",
    "provider": "openai",
    "available": true
  },
  {
    "id": "gpt-5.6-sol",
    "name": "GPT-5.6 Sol",
    "provider": "openai",
    "available": true
  },
  {
    "id": "gemini-3-pro",
    "name": "Gemini 3 Pro",
    "provider": "google",
    "available": false
  },
  {
    "id": "openrouter/auto",
    "name": "OpenRouter Auto",
    "provider": "openrouter",
    "available": true
  }
]
EVENT LOG

Latest gateway events.

No events yet.

Assertions:

  • FAIL expect_text: System busyness

How this fits together

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

Before merge

  • Let active dialogs consume Escape before closing the overlay (P2) - The overlay installs its keydown listener in capture phase and calls preventDefault() for every Escape. That runs before the command palette’s document handler, which deliberately closes only when the event is not already prevented; with both surfaces open, Escape closes this overlay and leaves the active palette/dialog open. Yield to existing dialog/overlay ownership and add a regression covering first-Escape dialog close and second-Escape overlay close.
  • Resolve merge risk (P1) - The capture-phase Escape listener can preempt an already open dialog or command palette, so merging can make Escape close the new overlay while leaving the active modal open.

Findings

  • [P2] Let active dialogs consume Escape before closing the overlay — ui/src/pages/debug/debug-overlay.ts:64-79
Agent review details

Security

None.

PR surface

Source +901, Tests +264, Other +77. Total +1242 across 31 files.

View PR surface stats
Area Files Added Removed Net
Source 20 905 4 +901
Tests 9 273 9 +264
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 77 0 +77
Total 31 1255 13 +1242

Review metrics

Metric Value Why it matters
Production versus test LOC production +905/-4; tests +274/-9; test support +76/-0 The additive diagnostics RPC and Control UI surface account for the production growth; focused coverage accompanies the new protocol and UI behavior.

Merge-risk options

Maintainer options:

  1. Restore modal Escape precedence (recommended)
    Update the overlay to yield Escape to an active dialog or command palette and add a regression test for both close orderings.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Add a focused Escape-precedence regression test covering an open dialog or command palette, then verify the overlay closes only after that surface has handled Escape.

Technical review

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

  • [P2] Let active dialogs consume Escape before closing the overlay — ui/src/pages/debug/debug-overlay.ts:64-79
    The overlay installs its keydown listener in capture phase and calls preventDefault() for every Escape. That runs before the command palette’s document handler, which deliberately closes only when the event is not already prevented; with both surfaces open, Escape closes this overlay and leaves the active palette/dialog open. Yield to existing dialog/overlay ownership and add a regression covering first-Escape dialog close and second-Escape overlay close.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.92

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5db8368f35a5.

Labels

Label justifications:

  • P3: This is an optional operator-facing diagnostics feature, although its current Escape interaction needs correction before merge.
  • merge-risk: 🚨 other: The new global Escape handler can change established modal keyboard behavior when the overlay and another dialog are open.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; supplied UI screenshots are supplementary evidence.

Evidence

Acceptance criteria:

  • [P1] Run the focused Control UI overlay or app-host component tests that cover Escape precedence.
  • [P1] Run the relevant Control UI Debug-page smoke or E2E flow and confirm the overlay opens and closes without preempting an active dialog.

What I checked:

Likely related people:

  • steipete: Current-head work and the inspected current-main provenance for the affected shell keyboard and lane snapshot surfaces are attributed to Peter Steinberger. (role: recent Control UI and command-lane contributor; confidence: high; commits: 7fc3371eac71, bb392b0e6a84; files: ui/src/app/app-shell-chrome.ts, src/process/command-queue.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Yield Escape to an existing modal or command palette before closing the overlay.
  • Add the focused Escape-precedence regression test and perform the planned Control UI smoke.

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.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 18, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Aug 18, 2026
…-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.
@openclaw-barnacle openclaw-barnacle Bot added the app: android App: android label Aug 18, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 18, 2026
@steipete
steipete merged commit ad475ce into main Aug 18, 2026
234 checks passed
@steipete
steipete deleted the steipete/concurrency-saturation-ux-e9152c branch August 18, 2026 08:10
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 20, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant