Repository navigation
fix(ui): replace startup hourglasses with capacity-aware rings - #133470
Conversation
Show one activity ring from accepted startup through execution. Pause only for exact command-lane or Swarm capacity waits, resume on admission, and preserve terminal and hidden-run ownership. Fixes #133464.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:47 PM ET / 20:47 UTC. ClawSweeper reviewWhat this changesThe PR replaces Control UI startup hourglasses with an activity ring that pauses only for confirmed command-lane or Swarm capacity waits. Merge readinessKeep this maintainer-owned PR open. Current main still renders generic pre-execution work as queued, while this branch introduces scheduler-owned capacity evidence; the earlier two review findings are addressed, but required CI for the final documentation-only head is still in progress. Priority: P2 Review scores
Verification
How this fits togetherCommand and Swarm schedulers own whether a session is actually waiting for capacity, and the Gateway turns that fact into a session snapshot. The Control UI sidebar consumes the snapshot to show an active or paused ring. flowchart LR
A[Session accepted] --> B[Command or Swarm scheduler]
B --> C{Capacity wait confirmed?}
C -- No --> D[Gateway active snapshot]
C -- Yes --> E[Gateway queued snapshot]
D --> F[Control UI activity ring]
E --> F
Before merge
Agent review detailsSecurityNone. PR surfaceSource +266, Tests +423, Docs 0. Total +689 across 43 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Merge only after the final head’s required checks are green, retaining the scheduler-owned capacity fact and the unified paused/spinning ring presentation. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s active-session resolver explicitly classifies pre-execution tracked work as queued, and the focused branch tests exercise the startup, capacity-wait, admission, and cleanup transitions. Is this the best way to solve the issue? Yes. Recording capacity state at the scheduler/registry owner and projecting it through the existing Gateway snapshot avoids inferring slot exhaustion from generic startup state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 14d2cf0f5c07. LabelsLabel changes:
Label justifications:
EvidenceWhat 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
History |
Declare visible embedded and ACP command activity independently of chat RPC registration. Preserve internal-run suppression and capacity-only metadata semantics. Add producer-to-Gateway coverage for startup, capacity waiting, admission, and cleanup; addresses the registry-only projection review finding.
|
Addressed the registry-only command finding at its producer in bfb4eede9cd5, rather than promoting all capacity metadata to activity.
New regression: The broad local command harness twice exceeded its unchanged 180-second import hook under host load before assertions could run; this was not counted as a regression reproduction. The narrow producer test supplies the red/green proof, and hosted CI must validate the full command suite before landing. No timeout, assertion strength, or production environment override was relaxed. The second rank-up move remains enforced: no merge until the new exact-head hosted CI is green. Updated build/live recording and final CI links are maintained in the PR body. |
|
Land-ready for exact head
Local verification commands (all corresponding final checks passed): pnpm build
node scripts/run-vitest.mjs src/agents/subagents/swarm/swarm-scheduler.test.ts
node scripts/run-vitest.mjs src/gateway/server-methods/agent.test.ts
node scripts/run-vitest.mjs src/agents/command/session-preparation.test.ts src/gateway/server-methods/session-active-runs.test.ts
OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs src/gateway/server-methods/session-active-runs.test.ts src/gateway/session-utils.queued-collector.test.ts src/gateway/session-utils.queued-collector-admission.test.ts src/gateway/server-session-events.test.ts src/gateway/server-session-lifecycle-events.test.ts src/gateway/session-event-payload.test.ts src/gateway/server.sessions.list-changed.test.ts
node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/lane-controller.queue-liveness.test.ts
node scripts/run-vitest.mjs src/gateway/server-methods/session-active-runs.test.ts
OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/tmp/capacity-ring-ui-test-cache OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/session-management.queue.e2e.test.ts
node --import ./scripts/tsx.mjs .artifacts/control-ui-e2e/capacity-ring/live-proof.mtsThe initial node scripts/run-tsgo-core-test-shards.mjs
node scripts/run-tsgo.mjs -p tsconfig.ui.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/ui.tsbuildinfo
node scripts/check-native-state-schema-version.mjs
pnpm check:database-first-legacy-stores
pnpm check:media-download-helpers
pnpm check:runtime-sidecar-loaders
pnpm check:import-cycles
pnpm lint:webhook:no-low-level-body-read
pnpm lint:auth:no-pairing-store-group
pnpm lint:auth:pairing-account-scopeThe successful exact-head CI run is the hosted landing proof; native ClawSweeper rank-up findings addressed in producer-fix response: command producers now own visible activity even without a chat abort controller; capacity-only metadata is not blindly promoted. Actual producer regression failed before and passed after, including hidden execution. Fresh autoreview and scoped changed-file checks passed. The broad local command fixture could not finish its180s import hook under host load; exact-head hosted job 99315920876 passed all 130 command cases, including both ACP assertions (326 tests across the command group). Latest documentation rank-up addressed: replaced the obsolete Sidebar navigation hourglass statement with the verified spinning/paused ring semantics and removed the duplicate lower-page paragraph. Targeted oxfmt, MDX validation, and git diff --check passed. Runtime bytes and attached media are unchanged. |
|
Merged via squash.
|
…cked-delivery * origin/main: (261 commits) fix(clawdock): keep credentials out of diagnostic output (openclaw#133547) refactor(ui): avoid redundant presence work in avatar lists (openclaw#133548) fix(agents): recognize internal requester completion replies (openclaw#133543) fix: prevent duplicate queued user messages in chat clients (openclaw#133542) chore(ui): refresh control ui locales (openclaw#133544) fix(beam): restart delivery when the receiver changes (openclaw#133533) fix(models): recover /models browse from a replaced prepared catalog (openclaw#133221) perf(terminal): reuse control scans and remove repeated sanitization work (openclaw#133527) perf(agents): prepare only consumed tool and skill diagnostics (openclaw#133512) fix(line): offer the card command only on LINE (openclaw#132895) fix: keep Android publication independent of core release (openclaw#133471) refactor(agents): simplify compaction accounting (openclaw#133521) refactor(plugins): simplify registration lifecycle policy (openclaw#133364) perf(plugins): avoid eager loader imports for active registry reads (openclaw#133518) refactor(ui): consolidate chat rendering ownership (openclaw#133508) test(auto-reply): prepare memory flush model capabilities (openclaw#133532) fix(ui): replace startup hourglasses with capacity-aware rings (openclaw#133470) fix(talk): preserve provider conversation order in browser transcripts (openclaw#133493) fix(ui): deduplicate participant and viewer avatars (openclaw#133519) feat(ui): add CRT terminal theme (openclaw#133495) ...
…law#133470) * fix(ui): replace startup hourglasses with capacity-aware rings Show one activity ring from accepted startup through execution. Pause only for exact command-lane or Swarm capacity waits, resume on admission, and preserve terminal and hidden-run ownership. Fixes openclaw#133464. * test: align capacity fixture with placement admission contract * test: use current chat registration cleanup contract * test: expect active startup in agent RPC session events * fix(agents): project command startup at its lifecycle owner Declare visible embedded and ACP command activity independently of chat RPC registration. Preserve internal-run suppression and capacity-only metadata semantics. Add producer-to-Gateway coverage for startup, capacity waiting, admission, and cleanup; addresses the registry-only projection review finding. * docs: replace obsolete sidebar hourglass guidance
Closes #133464 — session startup hourglass does not distinguish actual slot waits.
Related: queued-label correction.
What Problem This Solves
Fixes an issue where users starting a session saw an hourglass before the normal activity ring, even when concurrency slots were available. The same generic queued state covered both normal preparation and real scheduler waits.
Why This Change Was Made
Reuse one ring from acceptance through execution. Pause it only on authoritative capacity evidence from the command-lane or Swarm scheduler, and resume it when capacity becomes available. Exact run-instance/generation ownership prevents cancellation, recycled IDs, or hidden maintenance from leaking wait state.
The canonical Gateway snapshot now publishes the current scheduler status directly; accepted terminal events still outrank retained cleanup activity. Existing Home and decorated child-session rings use the same rule. The hourglass SVG is removed; the existing attention icon identifier renders the existing circle without changing the protocol.
User Impact
No new configuration, schema, protocol enum, dependency, or scheduling policy. AI-assisted; maintainer-requested.
Evidence
Before: hourglass during generic pre-execution state
Original pre-fix Chromium reproduction against the mocked Gateway; the sidebar row shows the hourglass.
After: one ring, paused only during a real slot wait
Real isolated Gateway, one available concurrency slot, two sessions submitted through the browser composer. The first session occupies the slot; the second is stationary and has not made a model request.
After releasing the first slot, the second session uses the same ring with the same geometry/colors and animates before receiving model output.
Live recording
live-capacity-ring.mp4
Real isolated Gateway + Chromium composer + local held-response model. All 11 assertions passed: one model request while waiting, one unchanged transform over 90 paused frames, 90 changed transforms after admission, direct
queued→runningscheduler notifications, visible completion, and ring removal. No browser errors. The task-owned Gateway was stopped, its port closed, and temporary state removed.Recorded source:
bfb4eede9cd5ef21400b43ba52a9f5cb0a24fb1c, including the command-producer follow-up. Pre/post-build source hashes match; served/assets/index-M2802GN-.js. The full build and all 11 fresh live assertions passed. Swarm behavior has scheduler/Gateway boundary coverage, not a separate live collector recording.Validation
node scripts/run-vitest.mjs src/agents/subagents/swarm/swarm-scheduler.test.ts: 17 passed.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/session-management.queue.e2e.test.ts: 2 Chromium scenarios passed.pnpm build: passed, including the UI performance budget.runningstate without weakening other assertions; all 301 agent-RPC tests then passed locally.bfb4eede9cd5ef21400b43ba52a9f5cb0a24fb1c, including the required merge gate.Review follow-up: registry-only command activity
Addressed the registry-only finding at the producer: embedded and ACP commands declare activity using the existing internal-session-effects policy. This covers node/direct command ingress without a chat abort controller and keeps activity present both before and after a capacity wait. Capacity-only metadata remains non-authoritative, so hidden/internal work cannot become visible by waiting for a slot.
src/agents/command/session-preparation.test.tsinvokes the real producer and registry/Gateway projection without a chat controller: the old visible case failed, the internal case passed; both pass after the fix across startup, queued wait, admission and cleanup. The 18 Gateway active-run tests also pass. A fresh structured review of this follow-up was clean. ACP visible/internal assertions are added to the existing command suite.The broad local command suite twice timed out in its unchanged 180-second import hook before executing assertions under host load. That timeout is not regression proof; the narrow producer test supplies red/green evidence, and the exact-head hosted command job subsequently passed all 130 command-suite cases, including both ACP assertions (326 tests across the command group).
Owner-boundary evidence
The command queue records exact entry membership, the run-context owner retains/relinquishes the wait, and the Gateway projects it through the existing session events/list/history paths. Swarm reservation ownership remains separate from capacity exhaustion: preactivation, cancellation holds, and admitted launch preparation do not pause the ring. Independent active owners still dominate a sibling wait.
Direct upstream Codex inspection: Codex turn-start handler maps execution-start events to
turn/started; that event is not OpenClaw capacity evidence. No Codex protocol behavior changes.Production +324/-83 (net +241); tests/support +544/-96 (net +448); docs +1/-1 (net0). Production growth supplies the previously absent scheduler wait fact and exact-instance lifecycle publication for both schedulers; the old hourglass render branch and duplicate caller-side snapshot status projections are removed.
Follow-up:
ui/src/components/app-sidebar-session-projection.ts:isOperatorCriticalSubtitlestill has queued-subtitle holding logic from the earlier removed concurrency subtitle. Separate subtitle-throttling cleanup; not required for this ring change.Documentation review follow-up: the Sidebar navigation paragraph now describes the ring correctly; the redundant added paragraph was removed. No hourglass guidance remains under
docs/web. Targeted format/MDX/diff checks passed. Final commit9a0f288e2411af2874df5e778736cd0b8dce506achanges documentation only; final exact-head CI passed, including the required merge gate.