Skip to content

feat: show background work in the sidebar - #188433

Merged
steipete merged 6 commits into
mainfrom
codex/sidebar-background-work
Oct 30, 2026
Merged

steipete merged 6 commits into
mainfrom
codex/sidebar-background-work

Conversation

@steipete

@steipete steipete commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Related: #141098, #168852

What Problem This Solves

A session looks idle in the sidebar when its turn finishes but an exec process it started is still running.

User Impact

Background-only sessions keep a quieter running ring around their own leading glyph and remain visible beyond quiet-row limits. The ring clears when the last tracked process exits or stops. Active turns keep the normal ring, including queued styling. Glyph-less rows use a 12px ring, and assistive technology announces “Background work running” once.

Why This Change Was Made

The Gateway owns the optional positive integer backgroundProcessCount, derived from the existing background-process registry using the process panel's session/agent scope rules, without its output/row truncation. Live row presentation and its retained cache witness include the count. Registry changes use the existing lifecycle row publisher to send sessions.changed with reason background-processes; zero sends a null clearing receipt while ordinary zero-count rows omit the field. Existing sessions.processes.changed delivery is preserved, including its five-second coalescing.

The sidebar consumes row metadata, with no per-row process RPC or second process store. A row's own work belongs on the left ring; right-side spinners summarize hidden persistent rows only. Hidden subagents retain the parent's existing leading ring labeled Subagents working, including the queued-parent handling from #168852. Own active runs retain their normal ring; the quiet Background work running ring is used only when neither own-turn nor subagent activity is present. Persistent-child-only background activity stays on the collapsed child toggle rather than the idle parent's ring. Collapsed Coding/catalog sections and child aggregates include background work. Home, rail shortcuts, child rows, and adopted catalog rows retain their existing activity presentation with background-only rings added. The additive protocol field has no version bump; protocol outputs and browser validators are regenerated. Model requests, prompt prefixes, and tool definitions are unchanged.

Counts cover processes already reported by the existing Gateway registry, irrespective of placement. Remote-only worker process registries currently expose RPC observations without a retained Gateway count; this change does not introduce a remote count cache or async row read.

Evidence

Gateway and UI regressions failed on the base for the intended missing count/ring and idle-parent ring behavior. The fixed Gateway test proves process start, positive row count and publication, exit, omitted zero count, and null clearing publication. Mocked Gateway E2E proves ring styling/name, live clearing without session-list or process-list polling, visibility beyond the quiet-child cap, collapsed section activity, persistent-child toggle aggregates, and hidden subagents retaining the parent’s leading ring even when background work also runs.

  • Gateway boundary/siblings: 5 files, 96 tests passed; observation/schema: 2 files, 24 tests passed. The extracted Gateway regression also passed after the file-size repair.

  • Focused UI component/browser runs passed: 7 files / 81 tests, 3 files / 40 tests, final row file / 23 tests, and final visibility/tree files / 14 tests.

  • pnpm tsgo, pnpm tsgo:ui, pnpm protocol:gen && pnpm protocol:check, pnpm ui:validators:gen, pnpm ui:validators:check, i18n baseline/verify, scoped oxlint/format/stylelint, Control UI controller checks, baseline ratchets, and git diff --check passed.

  • All 28 ring-sweep E2E files ran: 27 passed; the new file had one wrong-scope header-selector failure, corrected and both tests passed on focused replay. Initial sweep: 160 passed / 1 failed (820.17s); focused replay: 2 passed (43.16s).

  • Codex autoreview through P2: scoped-clean; no actionable findings.

  • Coordinator correction preserves refactor: migrate sidebar rendering to Solid 2 #168852's Subagents working leading ring, label, and queued-parent behavior, removes the trailing subagent spinner, and keeps quiet background styling below own-turn/subagent activity. Added regressions were red for the missing ring and incorrect background precedence, then green. Six affected unit/browser files passed 74 tests; after adding a rail regression, the complete rail suite passed 35 tests, and the final compact test setup passed focused replay. The rail regression also proved persistent-child-only background work cannot animate the parent's glyph.

  • Final correction E2E: 5 files / 34 tests passed (184.67s): subagents-panel, chat-run-lifecycle, session-management.groups, background-work.real-gateway, and sidebar-background-work. Final pnpm tsgo:ui, scoped oxlint/format, and git diff --check passed. The only lint repair shortened the rail test setup to stay within the existing file cap; no suppression or baseline increase.

  • Codex autoreview of the correction through P2 found one rail aggregate-count inconsistency, fixed with a red/green regression. The final candidate, including the compact test setup, is scoped-clean with no actionable findings. No CI was manually rerun.

  • Landing CI repair: check-test-types-core-2 exposed two unsupported Testing Library exact options in the new glyph regression. Replaced them with anchored accessible-name regexes, preserving exact matching. The affected ui-components test typecheck passed, all 6 glyph Chromium tests passed, scoped oxlint/format and git diff --check passed, and Codex autoreview through P2 was scoped-clean. The failing catalog-admission E2E also passed all 3 tests locally on the original exact head; this replay is not claimed as a flake repair. No CI was manually rerun.

  • Second landing CI repair: the catalog suite retained an expectation for a header spinner while its active row was visible. The approved design reserves that spinner for hidden rows; the test now verifies its absence while preserving active/settled leading-ring assertions. The regression reproduced locally (79 passed / 1 failed), then the full catalog suite passed all 80 tests. Scoped lint/format, git diff --check, and Codex autoreview through P2 passed. The catalog-admission setup timeout matches scheduled main run 41071928241, including the same initial-tool locator and 30-second timeout.

  • Transitive subagent CI repair: the existing queued-parent/idle-child/working-grandchild integration exposed a real projection regression. The tree now folds a persistent child's hidden subagent running/queued counts upward without folding that child's own background activity into the leading ring. Loaded and unloaded projection regressions failed before the fix; tree/sidebar/row/rail suites passed 179 tests, tsgo:ui and the ui-components test graph passed, and background-work/subagent E2E passed 10 tests. Scoped lint/format and independent Codex autoreview through P2 passed. Production growth for this repair is 3 lines.

  • Remaining CI investigation on 8f5189f57dde: fresh pnpm build passed on that exact head (root-help metadata 6.56s) and the exact tested main parent 0dad367a93cb (7.81s); neither root-help static graph contains a PR-changed source. The Files-panel unit and WebKit composer suites passed locally on the PR head and on that main parent (25 tests on main). These observations are qualification evidence, not claims that CI was green or the intermittent failures were fixed. No CI was manually rerun.

Before:

before

After:

after

Both captures use synthetic data, light theme, 1440×900, and the same background-only session.

Proof scope, timings, and change size

The ring sweep used rg 'session-glyph__ring|Active run|Queued' ui/src and ran every matching E2E test file plus the new regression, with the repository E2E wrapper and one worker. Every inventory file was confirmed present in the run. The only failing assertion searched inside the header toggle; inspected failure media showed the spinner in the sibling status slot. The corrected assertion targets that same visible indicator at its owning section, without weakening behavior.

Gateway full green run: 205.57s including 81.688s cold compiler preparation; new regression: 3.566s. Observation/schema wrapper: 15.10s. Focused UI runs: 13.70s, 4.29s, 6.23s, and 10.83s respectively. CI seconds are not yet available.

Production +149/−18 (including generated browser validator +4/−1), tests +407/−10, docs +8/−0. Growth is the optional row metadata, existing-event wiring, presentation/visibility rules, and regressions at distinct registry/publication, component, and browser boundaries. No new manager or persistent state owner was added.

The initial broad E2E launches stopped before tests for a text-versus-JSON selection-file mistake and stale generated browser validators. Both were corrected; failed attempts were retained. Scoped lint found the new regression exceeded the primary Gateway test file's line cap; it was moved into the suite's existing support registration without a suppression. No CI rerun was requested.

Final landing qualification

Prepared head b019fc9c2a6e0aaff239841d9328ed1e0831b915, CI run 41086361133, attempt 1: all 77 jobs completed. The sole root failure was Android 4KiB emulator setup, followed by the aggregate CI gate. API 36 device metadata failed to load and adb root closed before application build/tests. The tested merge preserves byte-identical Android application, workflow and TLS setup inputs; those same native inputs passed earlier PR CI and scheduled main CI. The automatic table labels it new because main passed; inspected setup failure and source equality establish the separate operator attribution.

The final source passed 179 focused sidebar/tree/row/rail tests, 10 background-work/subagent E2E tests and UI/type-graph checks. Exact committed head also passed catalog-admission E2E (3 tests) and workspace/WebKit suites (25 tests). Security passed. Landing uses the authorized pinned native admin exception with hashed artifacts and full failed-job accounting. CI remains failed; current-head native application coverage is unavailable because setup never reached those tests. No CI was manually rerun.

Project running background process counts from the existing registry and publish live row changes, including clearing receipts. Regenerate the additive protocol browser validator without a protocol version bump.
Keep background-only sessions visible with a quieter leading ring and a distinct accessible name. Separate own work from hidden child aggregates across sidebar rows, Home, catalog entries, and rail shortcuts, and document the indicator.
@clawsweeper

clawsweeper Bot commented Oct 30, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T16:06:49.547014Z b019fc9 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: M labels Oct 30, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 30, 2026
Restore the existing leading Subagents working ring and queued-parent behavior. Keep quiet background styling below own-turn and subagent activity, and keep persistent child aggregates on their toggle. Remove the trailing subagent spinner and cover ring precedence and rail ownership.
@steipete steipete changed the title feat(ui): show background work in the sidebar feat: show background work in the sidebar Oct 30, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR exposes running background-process counts on session rows and shows quieter sidebar activity rings.

Example: Background build has one running exec process after its agent turn finishes.

  • Before: The session looks idle.
  • After: Its leading glyph shows a quieter ring labeled Background work running.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful, appropriately owned feature with visible proof, but two source-reproducible indicator regressions block a clean verdict.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected synthetic before/after browser screenshots demonstrate the changed leading ring; supplied registry/publication and browser regressions support count propagation and clearing without process polling.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: A session appears idle while an exec process continues after its turn finishes.
Reason: Maintainer authorship supplies direction, and the change makes existing work visible without adding configuration or another process owner.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep open: the feature has owner direction and clear value, but two activity-indicator regressions need repair.

Priority: P2
Reviewed head: 8f5189f57ddecd189a3f2b7c563943f327a39908

Before merge

  • Preserve catalog activity for rows hidden by pagination (P2) - With an expanded catalog containing six sessions, CatalogRows renders only the first five until Show more is selected. If only the sixth session is running, this new collapsed-only condition removes the header spinner while its leading ring is also absent from the DOM. The catalog therefore looks idle despite hidden work. Derive the summary from rows hidden by pagination or collapsed groups, while continuing to omit it when all active rows are visible.
  • Keep background-only children from suppressing unloaded subagent activity (P2) - For an idle parent with hasActiveSubagentRun=true, an unloaded working subagent, and one loaded persistent child with backgroundProcessCount=1 but no active turn, this addition makes summary.runningChildCount equal 1. The fallback at line 185 consequently stops populating subagentSummary.runningChildCount. Leading presentation now reads that subagent-only summary, so the parent's Subagents working ring disappears, or becomes the quieter background ring if the parent also has a process. Preserve separate evidence of loaded turn activity when deciding whether the Gateway flag has already been accounted for, and cover this mixed loaded/unloaded case.

Findings

  • [P2] Preserve catalog activity for rows hidden by pagination — ui/src/components/app-sidebar-session-catalog-render.tsx:627
  • [P2] Keep background-only children from suppressing unloaded subagent activity — ui/src/components/app-sidebar-session-tree.ts:44-46
Agent review details

How this fits together

The Gateway derives session metadata from the process registry and publishes it to the Control UI, which projects sidebar rows, child summaries, and catalog indicators.

flowchart LR
  A[Process registry] --> B[Session row presentation]
  A --> C[Lifecycle row publisher]
  B --> C
  C --> D[UI session owner]
  D --> E[Sidebar tree and catalogs]
  E --> F[Activity rings]
Loading

Technical review

Best possible solution:

Keep the existing registry and presentation owners, preserve indicators for paginated hidden activity, and exclude background-only counts from the unloaded-run fallback decision.

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

Both findings follow deterministically from the current pagination and tree-projection branches; no target code was executed during this read-only review.

Is this the best way to solve the issue?

Deriving metadata from the existing registry is appropriately scoped, but hidden-row aggregation must preserve pagination and unloaded-subagent behavior.

Full review comments:

  • [P2] Preserve catalog activity for rows hidden by pagination — ui/src/components/app-sidebar-session-catalog-render.tsx:627
    With an expanded catalog containing six sessions, CatalogRows renders only the first five until Show more is selected. If only the sixth session is running, this new collapsed-only condition removes the header spinner while its leading ring is also absent from the DOM. The catalog therefore looks idle despite hidden work. Derive the summary from rows hidden by pagination or collapsed groups, while continuing to omit it when all active rows are visible.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.
  • [P2] Keep background-only children from suppressing unloaded subagent activity — ui/src/components/app-sidebar-session-tree.ts:44-46
    For an idle parent with hasActiveSubagentRun=true, an unloaded working subagent, and one loaded persistent child with backgroundProcessCount=1 but no active turn, this addition makes summary.runningChildCount equal 1. The fallback at line 185 consequently stops populating subagentSummary.runningChildCount. Leading presentation now reads that subagent-only summary, so the parent's Subagents working ring disappears, or becomes the quieter background ring if the parent also has a process. Preserve separate evidence of loaded turn activity when deciding whether the Gateway flag has already been accounted for, and cover this mixed loaded/unloaded case.
    Confidence: 0.95
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1d6f75fd7450.

Provenance checked

  • Leading rings and hidden-row summaries keeps the original intent (701687f: Move own activity to the leading glyph and reserve trailing activity for rows hidden behind disclosures.)
  • Hidden subagent activity fallback keeps the original intent (173c467: Hide transient run rows while retaining their activity on persistent parents and preserving lazy descendant loading.)
  • Catalog header animation changes intended behavior with a stated reason (45d1a41: Keep the activity branch mounted through unread updates so its animation does not restart.)
  • Bare ring dimensions changes intended behavior with a stated reason (a1d62cf: Recent sidebar presentation established the previous geometry; this PR explicitly chooses a 12px glyph-less ring and updates its geometry assertion.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/components/app-sidebar-session-tree.test.ts src/components/app-sidebar-session-row-render.test.tsx src/components/app-sidebar-session-catalogs.test.ts
  • pnpm test:ui:e2e ui/src/e2e/sidebar-background-work.e2e.test.ts
  • pnpm tsgo:ui
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 173c467 adds ui/src/components/app-sidebar-session-tree.ts:192 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 173c46790594; files: ui/src/components/app-sidebar-session-tree.ts)
  • Shakker: Raw commit e25a981 adds src/agents/bash-process-observation.ts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e25a98150544; files: src/agents/bash-process-observation.ts)

PR surface

Source +128, Tests +367, Docs +8. Total +503 across 36 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 22 146 18 +128
Tests 13 377 10 +367
Docs 1 8 0 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 36 531 28 +503

Review metrics

Metric Value Why it matters
Production versus test LOC Production +146/−18; tests/support +377/−10 Growth adds derived metadata and presentation across existing owners, with distinct protocol, publication, visibility, and browser regressions.

Labels

Label changes:

  • add P2: Useful sidebar visibility improvement with two bounded activity-indicator regressions.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Useful sidebar visibility improvement with two bounded activity-indicator regressions.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 30, 2026, 11:48 AM ET / 15:48 UTC.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b019fc9c2a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +39 to +43
const count = countRunningBackgroundProcesses({
scopeKeys: [canonicalKey, params.key, ...(params.sessionId ? [params.sessionId] : [])],
agentId: params.agentId,
});
return count > 0 ? count : undefined;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Read background counts from the session's execution owner

For sessions running on paired-device or cloud workers, this only inspects the Gateway's local process registry, so backgroundProcessCount remains absent even while background commands are running. Worker processes live in the worker command's registry, and their worker.processes.changed notifications are handled separately in server-methods/nodes.event.ts, which still only broadcasts sessions.processes.changed. Consequently, these sessions never receive the new background ring or visibility retention after their turn finishes. The existing server-methods/session-processes.ts already distinguishes local and worker process owners; the row count and its change publications need to respect that same ownership.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 0185de8 into main Oct 30, 2026
140 of 145 checks passed
@steipete
steipete deleted the codex/sidebar-background-work branch October 30, 2026 16:37
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
* feat(gateway): expose background work on session rows

Project running background process counts from the existing registry and publish live row changes, including clearing receipts. Regenerate the additive protocol browser validator without a protocol version bump.

* feat(ui): show background work in the sidebar

Keep background-only sessions visible with a quieter leading ring and a distinct accessible name. Separate own work from hidden child aggregates across sidebar rows, Home, catalog entries, and rail shortcuts, and document the indicator.

* fix(ui): preserve subagent sidebar working rings

Restore the existing leading Subagents working ring and queued-parent behavior. Keep quiet background styling below own-turn and subagent activity, and keep persistent child aggregates on their toggle. Remove the trailing subagent spinner and cover ring precedence and rail ownership.

* test(ui): use supported exact glyph name queries

* test(ui): align expanded catalog activity expectations

* fix(ui): retain transitive hidden subagent activity
obviyus added a commit that referenced this pull request Nov 14, 2026
## What Problem This Solves

An agent can end its turn and wait for a background command whose exit continues the chat (`tools.exec.notifyOnExit`, on by default). Nothing in the conversation says that work is pending. The only signal is a quiet ring in the sidebar, and raw completion notices are hidden from chat history, so the chat looks finished until the agent suddenly replies.

## User Impact

While the chat is idle and a background command will continue it, a card above the composer reads **Waiting on `<command>`** with its elapsed time. Selecting it opens that command's live output in **Processes**, where **Stop** already lives. Two or more waiters collapse to **Waiting on N processes**; expanding it lists each one.

The card hides while a turn runs and disappears when the command exits, as its completion starts the next turn. A requested Stop removes it at once, because a stopped command does not continue the chat. Chats with no background work load nothing new.

## Why This Change Was Made

- **Data:** `sessions.processes.list` rows gain an optional `wakesSession: true`. The existing process observation sets it for running, backgrounded commands that still have a captured chat destination and no requested Stop, matching the completion owner's guards. It reuses `hasExitWake`, the exit-wake check that #198908 added beside the exec result formatter, so the card and the agent's guidance read the same fact. The additive protocol field has no version bump; protocol outputs and validators were regenerated (no generated diff).
- **UI:** the card shares the composer stack's card rules with the goal and progress cards (selector lists in `composer-progress.css`, no new stylesheet), plus the shared session spinner, `ElapsedTime` and the scroll-state name fade. It reads the existing `ProcessesPanelData` observation, the same owner Processes and Details use, so reads, `sessions.processes.changed` refreshes and access errors behave identically. It mounts only while the session row reports `backgroundProcessCount`; session keying and run-state checks live in the lazy chunk.
- **Opening output:** selecting a command reuses the existing Details → Processes action, so **Back** returns to Details, which lists the running commands.
- **Not Labs:** like the sidebar background-work ring (#188433), this presents existing state without new cost or config.

## Evidence

Real Gateway, real agent (`gpt-5.5` through the OpenAI Responses API), isolated state and port. The agent started `sh wait-for-deploy.sh` and later `sh watch-ci.sh` itself as background exec calls, then ended its turn. Before: `main` at `18892937f802` (dist fixture). After: this branch, Gateway from source with the branch's production Control UI build. Avatars are blurred in every capture.

| Scenario | Before | After |
| --- | --- | --- |
| Idle, waiting on one command · 1440×900 · dark | ![Before: idle chat waiting on one command, desktop dark](https://github.com/user-attachments/assets/d95bae30-c24e-4334-8c52-923ff87a9f9d) | ![After: Waiting on sh wait-for-deploy.sh card above the composer, desktop dark](https://github.com/user-attachments/assets/1e6301b4-093f-44ed-922b-a0d5b3e46bbf) |
| Idle, waiting on one command · 1440×900 · light | ![Before: idle chat waiting on one command, desktop light](https://github.com/user-attachments/assets/473758cd-504d-4445-b9e0-83032c3f5067) | ![After: waiting card, desktop light](https://github.com/user-attachments/assets/e618e94d-e62c-4f83-9e5c-7f75fd5ff212) |
| Idle, waiting on one command · 390×844 · dark | ![Before: phone dark](https://github.com/user-attachments/assets/0827c741-921b-4154-b0a4-a7fbcdf567d5) | ![After: waiting card above the phone composer, dark](https://github.com/user-attachments/assets/26c9c966-3652-4f2b-a40e-9013715c6bd1) |
| Idle, waiting on one command · 390×844 · light | ![Before: phone light](https://github.com/user-attachments/assets/94c009b6-761c-40e1-9a22-a5d1cd225cda) | ![After: waiting card above the phone composer, light](https://github.com/user-attachments/assets/c67aa929-984c-4e5f-bd39-591ffcd347ff) |

New states:

| State | Screenshot |
| --- | --- |
| Card selected: live output and Stop in Processes · 1440×900 · dark | ![Processes detail opened from the waiting card, desktop dark](https://github.com/user-attachments/assets/74fde24e-740d-4a0d-aab0-19b1454cb9fa) |
| Card selected · 1440×900 · light | ![Processes detail opened from the waiting card, desktop light](https://github.com/user-attachments/assets/96e181ee-2e01-4e15-97ea-b0a183f5b6da) |
| Card selected · 390×844 · dark | ![Processes sheet opened from the waiting card, phone dark](https://github.com/user-attachments/assets/ca2f907d-fc44-43f5-ab8a-f04f46d8083d) |
| Two waiters, collapsed · 1440×900 · dark | ![Waiting on 2 processes, collapsed, desktop dark](https://github.com/user-attachments/assets/06bc227e-663c-4236-af4a-6947fc528fc7) |
| Two waiters, expanded · 1440×900 · dark | ![Waiting on 2 processes, expanded, desktop dark](https://github.com/user-attachments/assets/75b56dcf-42e4-4dcb-a94b-153a2c7e5f15) |
| Two waiters, expanded · 1440×900 · light | ![Waiting on 2 processes, expanded, desktop light](https://github.com/user-attachments/assets/5856391a-4dc8-4e30-8034-dc2f770e2f87) |
| Two waiters, expanded · 390×844 · dark | ![Waiting on 2 processes, expanded, phone dark](https://github.com/user-attachments/assets/aacc8304-6912-4689-9394-086527e9c60b) |
| Two waiters, expanded · 390×844 · light | ![Waiting on 2 processes, expanded, phone light](https://github.com/user-attachments/assets/770ce3c2-2f7b-4d72-ba7f-f34c6d1e15dc) |

The video (real time, ~98 s) starts with two waiters. The first command exits: the card hides while the woken turn runs, the agent reports the deploy, and the card returns for the remaining command. The second exit ends with no card.

https://github.com/user-attachments/assets/a1c1a505-a49b-40f8-bc37-44d22956c264

Also exercised on the same Gateway: selecting **Stop** in the opened detail removed the card within one refresh and started no turn; a fresh page load showed the card within 0.5 s.

- `ocx test`: `bash-process-observation.test.ts` 8 passed (new case: only running, destination-captured, unstopped processes are marked; exit clears it) and `chat-composer-waiters.test.tsx` 1 passed (filters non-waiters, opens the selected output, collapses two waiters and expands them).
- UI typecheck, scoped oxlint/oxfmt, stylelint, Control UI controller guard, `ui:i18n:verify` and baseline (no change), test-lines ratchet (+92 of 400) passed. `protocol:gen` and `ui:validators:gen` produced no diff.
- Control UI budgets vs the `18892937f802` base build (`ui:check-performance --base-dist`): chat boot JS +202 B gzip (the lazy gate), total CSS +114 B gzip / +871 B raw, startup and New Session +10 B. The first revision added +449 B JS and +848 B CSS gzip; sharing the composer stack rules and moving logic into the lazy chunk removed most of it. Because the base already exceeds these caps, the gate allows 64 B, so `control-ui-performance` still fails on this growth.

## CI

Rebased onto `main` after #198908 landed (head `05a3083e`); CI for this head is running. Known reds on the previous head:

- `control-ui-performance`: caused by this PR (chat boot JS +220 B gzip, total CSS +114 B gzip). `main` is already over these caps, so the gate allows 64 B. Maintainer-approved in #198891 (comment).
- `check-test-types`: inherited (`scripts/perf/state-read-worker-bench.ts`, not touched here).
- A local `ocx build --dts` of this head stops at the absolute Control UI budget check, as current `main` commits (`e741fd0d`, `d98f18ff`) do; the packed tarball integrity check, `openclaw --version` and `gateway --help` pass.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 15, 2026
## What Problem This Solves

An agent can end its turn and wait for a background command whose exit continues the chat (`tools.exec.notifyOnExit`, on by default). Nothing in the conversation says that work is pending. The only signal is a quiet ring in the sidebar, and raw completion notices are hidden from chat history, so the chat looks finished until the agent suddenly replies.

## User Impact

While the chat is idle and a background command will continue it, a card above the composer reads **Waiting on `<command>`** with its elapsed time. Selecting it opens that command's live output in **Processes**, where **Stop** already lives. Two or more waiters collapse to **Waiting on N processes**; expanding it lists each one.

The card hides while a turn runs and disappears when the command exits, as its completion starts the next turn. A requested Stop removes it at once, because a stopped command does not continue the chat. Chats with no background work load nothing new.

## Why This Change Was Made

- **Data:** `sessions.processes.list` rows gain an optional `wakesSession: true`. The existing process observation sets it for running, backgrounded commands that still have a captured chat destination and no requested Stop, matching the completion owner's guards. It reuses `hasExitWake`, the exit-wake check that openclaw#198908 added beside the exec result formatter, so the card and the agent's guidance read the same fact. The additive protocol field has no version bump; protocol outputs and validators were regenerated (no generated diff).
- **UI:** the card shares the composer stack's card rules with the goal and progress cards (selector lists in `composer-progress.css`, no new stylesheet), plus the shared session spinner, `ElapsedTime` and the scroll-state name fade. It reads the existing `ProcessesPanelData` observation, the same owner Processes and Details use, so reads, `sessions.processes.changed` refreshes and access errors behave identically. It mounts only while the session row reports `backgroundProcessCount`; session keying and run-state checks live in the lazy chunk.
- **Opening output:** selecting a command reuses the existing Details → Processes action, so **Back** returns to Details, which lists the running commands.
- **Not Labs:** like the sidebar background-work ring (openclaw#188433), this presents existing state without new cost or config.

## Evidence

Real Gateway, real agent (`gpt-5.5` through the OpenAI Responses API), isolated state and port. The agent started `sh wait-for-deploy.sh` and later `sh watch-ci.sh` itself as background exec calls, then ended its turn. Before: `main` at `39efe6fb1cd8` (dist fixture). After: this branch, Gateway from source with the branch's production Control UI build. Avatars are blurred in every capture.

| Scenario | Before | After |
| --- | --- | --- |
| Idle, waiting on one command · 1440×900 · dark | ![Before: idle chat waiting on one command, desktop dark](https://github.com/user-attachments/assets/d95bae30-c24e-4334-8c52-923ff87a9f9d) | ![After: Waiting on sh wait-for-deploy.sh card above the composer, desktop dark](https://github.com/user-attachments/assets/1e6301b4-093f-44ed-922b-a0d5b3e46bbf) |
| Idle, waiting on one command · 1440×900 · light | ![Before: idle chat waiting on one command, desktop light](https://github.com/user-attachments/assets/473758cd-504d-4445-b9e0-83032c3f5067) | ![After: waiting card, desktop light](https://github.com/user-attachments/assets/e618e94d-e62c-4f83-9e5c-7f75fd5ff212) |
| Idle, waiting on one command · 390×844 · dark | ![Before: phone dark](https://github.com/user-attachments/assets/0827c741-921b-4154-b0a4-a7fbcdf567d5) | ![After: waiting card above the phone composer, dark](https://github.com/user-attachments/assets/26c9c966-3652-4f2b-a40e-9013715c6bd1) |
| Idle, waiting on one command · 390×844 · light | ![Before: phone light](https://github.com/user-attachments/assets/94c009b6-761c-40e1-9a22-a5d1cd225cda) | ![After: waiting card above the phone composer, light](https://github.com/user-attachments/assets/c67aa929-984c-4e5f-bd39-591ffcd347ff) |

New states:

| State | Screenshot |
| --- | --- |
| Card selected: live output and Stop in Processes · 1440×900 · dark | ![Processes detail opened from the waiting card, desktop dark](https://github.com/user-attachments/assets/74fde24e-740d-4a0d-aab0-19b1454cb9fa) |
| Card selected · 1440×900 · light | ![Processes detail opened from the waiting card, desktop light](https://github.com/user-attachments/assets/96e181ee-2e01-4e15-97ea-b0a183f5b6da) |
| Card selected · 390×844 · dark | ![Processes sheet opened from the waiting card, phone dark](https://github.com/user-attachments/assets/ca2f907d-fc44-43f5-ab8a-f04f46d8083d) |
| Two waiters, collapsed · 1440×900 · dark | ![Waiting on 2 processes, collapsed, desktop dark](https://github.com/user-attachments/assets/06bc227e-663c-4236-af4a-6947fc528fc7) |
| Two waiters, expanded · 1440×900 · dark | ![Waiting on 2 processes, expanded, desktop dark](https://github.com/user-attachments/assets/75b56dcf-42e4-4dcb-a94b-153a2c7e5f15) |
| Two waiters, expanded · 1440×900 · light | ![Waiting on 2 processes, expanded, desktop light](https://github.com/user-attachments/assets/5856391a-4dc8-4e30-8034-dc2f770e2f87) |
| Two waiters, expanded · 390×844 · dark | ![Waiting on 2 processes, expanded, phone dark](https://github.com/user-attachments/assets/aacc8304-6912-4689-9394-086527e9c60b) |
| Two waiters, expanded · 390×844 · light | ![Waiting on 2 processes, expanded, phone light](https://github.com/user-attachments/assets/770ce3c2-2f7b-4d72-ba7f-f34c6d1e15dc) |

The video (real time, ~98 s) starts with two waiters. The first command exits: the card hides while the woken turn runs, the agent reports the deploy, and the card returns for the remaining command. The second exit ends with no card.

https://github.com/user-attachments/assets/a1c1a505-a49b-40f8-bc37-44d22956c264

Also exercised on the same Gateway: selecting **Stop** in the opened detail removed the card within one refresh and started no turn; a fresh page load showed the card within 0.5 s.

- `ocx test`: `bash-process-observation.test.ts` 8 passed (new case: only running, destination-captured, unstopped processes are marked; exit clears it) and `chat-composer-waiters.test.tsx` 1 passed (filters non-waiters, opens the selected output, collapses two waiters and expands them).
- UI typecheck, scoped oxlint/oxfmt, stylelint, Control UI controller guard, `ui:i18n:verify` and baseline (no change), test-lines ratchet (+92 of 400) passed. `protocol:gen` and `ui:validators:gen` produced no diff.
- Control UI budgets vs the `39efe6fb1cd8` base build (`ui:check-performance --base-dist`): chat boot JS +202 B gzip (the lazy gate), total CSS +114 B gzip / +871 B raw, startup and New Session +10 B. The first revision added +449 B JS and +848 B CSS gzip; sharing the composer stack rules and moving logic into the lazy chunk removed most of it. Because the base already exceeds these caps, the gate allows 64 B, so `control-ui-performance` still fails on this growth.

## CI

Rebased onto `main` after openclaw#198908 landed (head `05a3083e`); CI for this head is running. Known reds on the previous head:

- `control-ui-performance`: caused by this PR (chat boot JS +220 B gzip, total CSS +114 B gzip). `main` is already over these caps, so the gate allows 64 B. Maintainer-approved in openclaw#198891 (comment).
- `check-test-types`: inherited (`scripts/perf/state-read-worker-bench.ts`, not touched here).
- A local `ocx build --dts` of this head stops at the absolute Control UI budget check, as current `main` commits (`b160df89`, `0212c217`) do; the packed tarball integrity check, `openclaw --version` and `gateway --help` pass.

Co-authored-by: Ayaan Zaidi <[email protected]>
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: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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