Skip to content

fix: show sessions waiting for concurrency slots - #125654

Merged
steipete merged 6 commits into
mainfrom
steipete/jesse-s-team-openclaw-ai-issue-4cb4ce
Aug 18, 2026
Merged

steipete merged 6 commits into
mainfrom
steipete/jesse-s-team-openclaw-ai-issue-4cb4ce

Conversation

@steipete

@steipete steipete commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where sessions admitted beyond agents.defaults.maxConcurrent looked running or idle even though execution had not started, leaving operators without a reason for the wait.

Why This Change Was Made

The execution lifecycle owners now record the exact transition from admitted to started, and session list/event projections expose the pre-execution state as queued. Web, Android, and Apple render the same protocol state distinctly. This does not change authentication, credentials, admission policy, or concurrency behavior.

User Impact

Queued sessions now show Queued, an hourglass, and Waiting for a concurrency slot. They transition to the normal running indicator when backend execution actually starts.

Evidence

  • Focused Vitest proof passed: gateway 82 tests, gateway-client 13 tests, and auto-reply 22 tests.
  • Full Control UI suite passed: 9,295 tests, 50 skipped.
  • Mocked Chromium queue E2E passed, including the queued to running transition.
  • Android ChatSwarmProgressTest passed with the local Android SDK.
  • Apple ChatSessionSidebarModelTests and ChatSwarmProgressTests passed: 47 tests.
  • ClawSweeper follow-up coverage passed: Workboard lifecycle/capture/rendering 261 tests; Android SessionObserverDigestTest plus app ktlint; UI typecheck; native i18n verification.
  • Chat-history follow-up passed: chat-history-handler.test.ts 1 test and full chat-send.test.ts 302 tests, including queued reconciliation over a prior terminal row.
  • Protocol check, Control UI i18n verification, native i18n verification, core/core-test/UI typechecks, formatting, max-lines, core/UI/apps lint, dead-export scan, and every non-macOS changed check passed.
  • Fresh project autoreview on the final diff was clean with no accepted/actionable findings.
  • The local check:changed macOS tooling configuration emitted no output for 15 minutes on the initial run and the prescribed retry, then exited 143 both times. This local gate is not represented as green; exact-head hosted CI is required before prepare/merge.
  • Judged diff: production code +194/-55 (net +139), tests and test support +478/-41 (net +437), generated native i18n +41/-0, docs +1/-1.

Before: admitted work looked running

Before: admitted session rendered with a running spinner

After: queued work explains the wait

After: queued session rendered with an hourglass and concurrency-slot explanation

Queued to running transition

queued-concurrency-transition-proof.webm
  • AI-assisted
  • No agent transcript included

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: android App: android app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels Aug 18, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 Aug 18, 2026
@clawsweeper

clawsweeper Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 18, 2026, 5:00 AM ET / 09:00 UTC.

ClawSweeper review

What this changes

The PR distinguishes admitted work waiting for a concurrency slot from work already executing, then projects and renders that queued state across Gateway, web, Android, and Apple session views.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open: current main does not expose a queued session status, and this PR supplies the needed lifecycle projection and client rendering. One model-facing consumer still drops the new status, so the patch needs a narrow follow-up before merge.

Priority: P2
Reviewed head: a04d4656fde0d8db857a1ccd88e9914dc960b2aa

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The PR has strong visible evidence and broad coverage, but the remaining model-facing status omission blocks a higher rating.
Proof confidence 🦞 diamond lobster (5/6) Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body also provides before/after media and a queued-to-running recording.
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 outside the external-contributor proof gate; its body also provides before/after media and a queued-to-running recording.
Evidence reviewed 4 items Current main lacks the requested state: Current main’s session-status schema has running and terminal literals but no queued literal, so the central behavior is not already implemented.
Lifecycle owner and projections: The PR derives queued from an admitted tracked run until execution starts, then carries that state through list, event, and history projections; the history path resolves the prior review finding.
Model-facing status omission: The shared protocol now permits queued, but the sessions_list output schema and parser still accept only running and terminal states, so a queued Gateway row loses its explanatory status before reaching the model.
Findings 1 actionable finding [P2] Preserve queued status in sessions_list
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs ui/src/e2e/session-management.queue.e2e.test.ts

Result: PASS (completed)

runner@runnervmzvulz:/tmp/clawsweeper-live-proof-125654-b5aPZt/target$ node scripts/run-vitest.mjs ui/src/e2e/session-management.queue.e2e.test.ts
[test] starting test/vitest/vitest.ui-e2e.config.ts
[test] preflight test/vitest/vitest.ui-e2e.config.ts
node scripts/run-vitest.mjs ui/src/e2e/session-management.queue.e2e.test.ts
[ui-e2e] Using system Chromium at /usr/bin/chromium-browser.
Downloading FFmpeg (playwright ffmpeg v1011) from https://cdn.playwright.dev/dbazure/download/playwright/builds/ffmpeg/1011/ffmpeg-linux.zip
|                                                                                |   0% of 2.3 MiB
|■■■■■■■■                                                                        |  10% of 2.3 MiB
|■■■■■■■■■■■■■■■■                                                                |  20% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■                                                        |  30% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                                |  40% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                        |  50% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                |  60% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                        |  70% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                |  80% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■        |  90% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% of 2.3 MiB
FFmpeg (playwright ffmpeg v1011) downloaded to /tmp/clawsweeper-live-proof-125654-b5aPZt/profile/cache/ms-playwright/ffmpeg-1011

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-125654-b5aPZt/target

 ✓  ui-e2e  ui/src/e2e/session-management.queue.e2e.test.ts (1 test) 15496ms
     ✓ shows admitted sessions waiting for a concurrency slot  6480ms

 Test Files  1 passed (1)
      Tests  1 passed (1)
   Start at  09:01:33
   Duration  23.07s (transform 528ms, setup 102ms, import 968ms, tests 15.50s, environment 0ms)

[test] passed 1 Vitest shard in 26.48s
runner@runnervmzvulz:/tmp/clawsweeper-live-proof-125654-b5aPZt/target$ node scripts/run-vitest.mjs ui/src/e2e/session-management.queue.e2e.test.ts




















Assertions:

  • PASS expect_output: shows admitted sessions waiting for a concurrency slot

How this fits together

Gateway admission records a session before it reaches an execution lane, then session lists, events, and history responses feed web and native clients. The queued state explains that pre-execution interval to operators before it becomes running.

flowchart LR
A[Work request] --> B[Gateway admission]
B --> C{Execution lane acquired?}
C -- No --> D[Queued session]
C -- Yes --> E[Running session]
D --> F[Session lists and events]
E --> F
F --> G[Web and native session views]
Loading

Before merge

  • Preserve queued status in sessions_list (P2) - The new shared status lets Gateway return queued, but sessions-list-tool.ts still permits and parses only running plus terminal values. A queued session therefore reaches the model without the reason it is waiting; add queued to both closed lists and cover that projection.
  • Resolve merge risk (P1) - The additive protocol status remains compatibility-sensitive until every closed downstream status consumer preserves queued rather than treating it as absent.
  • Resolve merge risk (P1) - Production code is net +139 lines for a bug fix; the cross-platform lifecycle boundary explains much of that growth, but the missing model projection shows the surface is not yet complete.
  • Complete next step (P2) - This maintainer-owned PR has one narrow pre-merge correction but is protected from automated repair routing.

Findings

  • [P2] Preserve queued status in sessions_list — packages/gateway-protocol/src/schema/sessions-row.ts:81
Agent review details

Security

None.

PR surface

Source +157, Tests +359, Docs 0, Other +101. Total +617 across 56 files.

View PR surface stats
Area Files Added Removed Net
Source 29 211 54 +157
Tests 14 394 35 +359
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 12 108 7 +101
Total 56 714 97 +617

Review metrics

Metric Value Why it matters
Production versus test delta production +194/-55 (net +139); tests/test support +478/-41; generated native i18n +41 The cross-platform lifecycle change has substantial justified coverage, but positive production growth warrants complete shared-status consumer coverage.

Stored data model

Persistent data-model change detected: migration/backfill/repair: ui/src/e2e/session-management.queue.e2e.test.ts, migration/backfill/repair: ui/src/test-helpers/app-sidebar-cases/session-indicators.ts, serialized state: src/gateway/server-methods/session-active-runs.test.ts, serialized state: src/gateway/server-methods/session-active-runs.ts, serialized state: src/gateway/server-methods/session-change-event.ts, serialized state: src/gateway/server-methods/sessions-read.ts, and 15 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete queued status propagation (recommended)
    Add queued to the sessions_list output schema and parser, with a regression proving a queued Gateway row reaches the model.

Technical review

Best possible solution:

Retain the lifecycle-owner design, then make queued a first-class status in the model-facing session tool and its focused regression coverage before landing.

Do we have a high-confidence way to reproduce the issue?

Yes—source inspection shows a queued row returned by Gateway is filtered out by the sessions_list tool’s closed status parser and output schema.

Is this the best way to solve the issue?

No—the lifecycle projection is the right owner-boundary fix, but it must propagate the new shared status through the model-facing consumer as well.

Full review comments:

  • [P2] Preserve queued status in sessions_list — packages/gateway-protocol/src/schema/sessions-row.ts:81
    The new shared status lets Gateway return queued, but sessions-list-tool.ts still permits and parses only running plus terminal values. A queued session therefore reaches the model without the reason it is waiting; add queued to both closed lists and cover that projection.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: A queued session is still omitted from the model-facing sessions_list result despite the new shared protocol value.
  • merge-risk: 🚨 compatibility: Adding a new Gateway session-status literal can silently degrade consumers that use closed status parsers.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster 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 outside the external-contributor proof gate; its body also provides before/after media and a queued-to-running recording.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame and history attribute the active-run controller and session projection baseline to Peter Steinberger; this PR continues that work. (role: recent session-lifecycle contributor; confidence: high; commits: fc8eb59ab2cb; files: src/gateway/chat-abort.ts, src/gateway/server-methods/session-active-runs.ts, src/gateway/server-methods/chat-history-handler.ts)

Rank-up moves

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

  • Add queued to sessions_list’s schema and parser with a focused projection regression.

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 (2 earlier review cycles)
  • reviewed 2026-08-18T07:45:58.081Z sha f228c65 :: needs changes before merge. :: [P2] Preserve queued state in linked Workboard cards | [P2] Render queued state in Android’s full session list
  • reviewed 2026-08-18T08:06:43.689Z sha fe09711 :: found issues before merge. :: [P2] Project queued status through chat history

@steipete
steipete force-pushed the steipete/jesse-s-team-openclaw-ai-issue-4cb4ce branch from 6e68cfd to 8727cb1 Compare August 18, 2026 06:31
@steipete
steipete marked this pull request as ready for review August 18, 2026 06:32
@steipete steipete self-assigned this Aug 18, 2026
@clawsweeper clawsweeper Bot added 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. and removed 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 Aug 18, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for a04d4656fde0d8db857a1ccd88e9914dc960b2aa.

Root cause and fix: session admission registered visible work before backend execution, but consumers treated every active owner as running. The lifecycle owners now record a sticky execution-start fact; list, event, transcript, and history projections use the canonical queued/running state; web, Workboard, Android, and Apple render queued distinctly. Authentication, credentials, admission policy, and concurrency limits are unchanged.

Exact final proof:

  • node scripts/run-vitest.mjs src/gateway/server-methods/session-active-runs.test.ts src/gateway/server.sessions.list-changed.test.ts src/gateway/server-session-events.test.ts src/auto-reply/reply/agent-runner-execution-lifecycle.test.ts: gateway 82/82; unchanged auto-reply retry 22/22.
  • Gateway-client focused suite: 13/13.
  • Full Control UI suite: 9,295 passed, 50 skipped.
  • 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: 1/1, including queued → running.
  • node scripts/run-vitest.mjs ui/src/lib/workboard/index.test.ts ui/src/pages/workboard/view.test.ts: 261/261.
  • ANDROID_HOME=$HOME/.android-sdk ./gradlew --no-daemon :app:testPlayDebugUnitTest --tests 'ai.openclaw.app.ui.SessionObserverDigestTest' :app:ktlintCheck: passed.
  • Apple ChatSessionSidebarModelTests + ChatSwarmProgressTests: 47/47.
  • node scripts/run-vitest.mjs src/gateway/server-methods/chat-history-handler.test.ts ui/src/pages/chat/chat-send.test.ts: 303/303.
  • pnpm native:i18n:verify, pnpm tsgo:ui, protocol check, UI i18n verify, formatting, max-lines, core/UI/apps lint, dead-export scan, and non-macOS changed checks: passed.
  • Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/32118772463, attempt 2, success.
  • Native prepare gate: GATES_MODE=hosted_exact_or_recent_parent, target/head a04d4656fde0d8db857a1ccd88e9914dc960b2aa, passed at 2026-08-18T09:30:16Z. OPENCLAW_TESTBOX=1 reused exact hosted CI; no remote Testbox was allocated (REMOTE_GATES_PROVIDER, REMOTE_GATES_LEASE_ID, and REMOTE_GATES_RUN_URL are empty).
  • Fresh autoreview after every behavioral/CI repair: clean, no accepted/actionable findings; final finding repairs and mechanical line-cap move each scored 0.99 confidence.

ClawSweeper moves:

  • Applied: queued Workboard lifecycle/capture/rendering and Android full-session-list copy (fe09711d4ae).
  • Applied: queued status through chat.history with prior-terminal-row reconciliation (53cf4bc88f2).
  • Applied: refreshed exact-head CI after every behavioral change; final run is green.
  • Skipped: drift-only rebase. GitHub reports no conflict, repository policy treats behind-main drift as advisory, and native prepare passed on the exact unchanged head.

Visual proof:

Known local gap: the local check:changed macOS tooling configuration emitted no output for 15 minutes on the initial run and prescribed retry, then exited 143 both times. It is not represented as locally green; exact-head hosted macOS Swift, macOS Node, iOS, Android, and aggregate CI all passed.

Judged diff: production +194/-55 (net +139); tests/support +478/-41 (net +437); generated native i18n +41/-0; docs +1/-1. No CHANGELOG.md edit and no release publication.

@steipete
steipete merged commit b8ff4fe into main Aug 18, 2026
404 of 406 checks passed
@steipete
steipete deleted the steipete/jesse-s-team-openclaw-ai-issue-4cb4ce branch August 18, 2026 09:31
@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
* fix: show sessions waiting for concurrency slots

* test: align queued session integration fixtures

* test: distinguish queued and reactivated followups

* fix: preserve queued state in workboard and android

* fix: project queued status through chat history

* test(ui): keep queued sidebar case under line cap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: android App: android app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L 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