Skip to content

feat(ui): add a background tasks pane to chat panes - #104010

Merged
steipete merged 4 commits into
mainfrom
claude/openclaw-tasks-agents-pane-9e39e6
Jul 11, 2026
Merged

steipete merged 4 commits into
mainfrom
claude/openclaw-tasks-agents-pane-9e39e6

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #104003

What Problem This Solves

Background work (subagent spawns, cron executions, ACP runs, CLI/media jobs) was only visible on the separate Tasks page or openclaw tasks list. While chatting there was no way to see what the agent is doing in the background, stop a runaway subagent, or open a subagent's transcript without leaving the conversation.

Why This Change Was Made

Adds a collapsible Background tasks rail to each Control UI chat pane, following the existing session-workspace rail pattern. The rail is scoped to the pane's agent through the existing tasks.list { agentId } filter, kept live by the existing task gateway event, and cancels through tasks.cancel — no new gateway RPCs, events, or config surfaces. Shared task normalizers/label helpers moved from the Tasks page into ui/src/lib/tasks/data.ts so both surfaces use one canonical data path. Rail state is per-pane and in-memory (collapsed by default); no new persisted settings.

User Impact

  • A new activity toggle in the split-pane header and a floating opener in single-pane chat (with a running-count badge) open a per-agent Background tasks rail.
  • Running section: status/runtime chips, progress summaries, and a stop control (gated on operator.write).
  • Collapsible Finished section with terminal summaries and errors.
  • "View transcript" opens the task's child session (subagent/ACP transcript) in the same pane.
  • The Tasks page is unchanged and remains the full cross-agent ledger.

Evidence

  • New unit tests: ui/src/pages/chat/components/chat-background-tasks.test.ts (agent-scoped loads, live event upsert/delete/restore handling, cancellation refusal surfacing, render actions) and moved ui/src/lib/tasks/data.test.ts.
  • New mocked-gateway Playwright e2e: ui/src/pages/chat/background-tasks.e2e.test.ts — opens the rail, asserts agent-scoped tasks.list params, pushes a task completion event and watches the row move Running → Finished, clicks Stop and asserts the tasks.cancel request, clicks View transcript and asserts pane navigation to the child session.
  • Local runs: pnpm test ui/src/pages/chat/components/chat-background-tasks.test.ts ui/src/lib/tasks/data.test.ts ui/src/pages/tasks/tasks-page.test.ts (15 passed), pnpm test ui/src/pages/chat/background-tasks.e2e.test.ts (passed), pnpm tsgo:test:ui clean, pnpm ui:i18n:check clean.
  • Screenshot (mocked gateway, running + finished sections): attached in PR comment.

Docs: docs/web/control-ui.md chat section and docs/automation/tasks.md Control UI section updated.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Jul 11, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Screenshots from the mocked-gateway Playwright e2e (ui/src/pages/chat/background-tasks.e2e.test.ts):

Rail open — running subagent + queued cron with stop controls, finished section:

Background tasks rail open

After a pushed task completion event — the subagent row moved from Running to Finished live:

Pushed completion

@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: 30b20dc392

ℹ️ 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 +613 to +616
.chat-tasks-rail {
grid-column: -2;
grid-row: 1;
display: flex;

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 Hide the tasks rail at the narrow breakpoint

When a user opens the background-tasks rail and then narrows the chat below 1120px, this new rail still renders as display: flex: the existing narrow media rule only hides .chat-workspace-rail while both task toggles are hidden and .chat-workbench switches to flex layout. That leaves the tasks rail taking space ahead of the chat with no visible close affordance. Add .chat-tasks-rail to the narrow breakpoint hide/collapse behavior.

Useful? React with 👍 / 👎.

@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: 633e283deb

ℹ️ 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 +138 to +143
const current = getBackgroundTasksState(host);
if (current !== state || current.requestId !== requestId) {
return;
}
current.tasks = mergeTaskLists(recent, active);
current.loadedClient = client;

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 Ignore task loads from prior connections

If the background-tasks rail is open while a tasks.list request spans a disconnect/reconnect that reuses the same GatewayBrowserClient, this stale response can still pass the requestId check and set loadedClient back to the client. The next connected render then sees loadedClient === host.client and skips the refetch that the disconnect path is trying to force, so any task events missed while offline leave the rail and badge stale until a manual refresh; stale errors can similarly block auto-reload. Tie the response to the current connected epoch/client state, or invalidate the request id on disconnect.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 633e283debaca55c32f5bb1cdc9d68f9dfc27f9c, but the PR head is now e5f7ad2f1662a1d79e06341bbce7fc7ca6fef648. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

@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: e5f7ad2f16

ℹ️ 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 +223 to +224
const payload = await client.request("tasks.cancel", { taskId });
if (getBackgroundTasksState(host) !== state) {

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 Guard task cancels against reconnects

When an operator clicks Stop and the Gateway disconnects/reconnects before tasks.cancel resolves, ChatPane increments connectionEpoch even if the same browser client object is reused, but this handler only checks that the background-task state object is still current. A stale cancellation refusal or task snapshot can therefore set state.error or replace rows after the reconnect and after a fresh task list is loaded; the existing Tasks page avoids this with an operation epoch in its cancellation lifecycle. Capture/check the connection epoch (or invalidate pending cancels on disconnect) before applying this response.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 4669235 into main Jul 11, 2026
74 checks passed
@steipete
steipete deleted the claude/openclaw-tasks-agents-pane-9e39e6 branch July 11, 2026 00:56
vincentkoc added a commit that referenced this pull request Jul 11, 2026
* origin/main:
  fix(tui): preserve UTF-16 pairs in long tokens (#104024)
  fix(release): raise Telegram attestor buffer (#104025)
  fix(slack): apply sender policy to group DMs (#104007)
  feat(ui): add a background tasks pane to chat panes (#104010)
  docs(changelog): credit landed fixes
  fix(installer): clean temporary files on failure (#103725)
  fix(clickclack): sanitize outbound assistant text (#103142)
  fix(sms): normalize Twilio RCS webhook senders (#102373)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 11, 2026
* feat(ui): add background tasks rail to chat panes

* chore(i18n): sync control-ui locale bundles

* fix(ui): match gateway owner-key task scoping and hide tasks rail on narrow viewports

* chore(i18n): translate background tasks rail strings
steipete added a commit that referenced this pull request Jul 11, 2026
…panes

The tasks rail (from #104010) only rendered as a right-docked 230-280px
column and vanished with its toggles below a 1120px viewport, so narrow
split-view panes got a crushed thread and compact windows lost access
to background tasks entirely — the same bug class #104033 fixed for the
workspace rail and detail panel.

The rail now follows the pane's measured width: it presents as a
full-width bottom strip (sections side by side like the workspace
rail's bottom dock) when the pane is too narrow for a side column, and
the workspace rail keeps first claim on the side slot when only one
column fits. Side-docked rails, not bottom strips, now count against
the width available to the chat + detail split.

Closes #104091
steipete added a commit that referenced this pull request Jul 11, 2026
…panes (#104107)

The tasks rail (from #104010) only rendered as a right-docked 230-280px
column and vanished with its toggles below a 1120px viewport, so narrow
split-view panes got a crushed thread and compact windows lost access
to background tasks entirely — the same bug class #104033 fixed for the
workspace rail and detail panel.

The rail now follows the pane's measured width: it presents as a
full-width bottom strip (sections side by side like the workspace
rail's bottom dock) when the pane is too narrow for a side column, and
the workspace rail keeps first claim on the side slot when only one
column fits. Side-docked rails, not bottom strips, now count against
the width available to the chat + detail split.

Proof: check:changed + 212 focused tests green on Testbox at this exact
content; codex autoreview clean; chromium+webkit visual verification at
seven window widths plus split view with zero geometry overlaps.
Landed with maintainer CI override.

Closes #104091
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
…panes (openclaw#104107)

The tasks rail (from openclaw#104010) only rendered as a right-docked 230-280px
column and vanished with its toggles below a 1120px viewport, so narrow
split-view panes got a crushed thread and compact windows lost access
to background tasks entirely — the same bug class openclaw#104033 fixed for the
workspace rail and detail panel.

The rail now follows the pane's measured width: it presents as a
full-width bottom strip (sections side by side like the workspace
rail's bottom dock) when the pane is too narrow for a side column, and
the workspace rail keeps first claim on the side slot when only one
column fits. Side-docked rails, not bottom strips, now count against
the width available to the chat + detail split.

Proof: check:changed + 212 focused tests green on Testbox at this exact
content; codex autoreview clean; chromium+webkit visual verification at
seven window widths plus split view with zero geometry overlaps.
Landed with maintainer CI override.

Closes openclaw#104091
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* origin/main:
  fix(tui): preserve UTF-16 pairs in long tokens (openclaw#104024)
  fix(release): raise Telegram attestor buffer (openclaw#104025)
  fix(slack): apply sender policy to group DMs (openclaw#104007)
  feat(ui): add a background tasks pane to chat panes (openclaw#104010)
  docs(changelog): credit landed fixes
  fix(installer): clean temporary files on failure (openclaw#103725)
  fix(clickclack): sanitize outbound assistant text (openclaw#103142)
  fix(sms): normalize Twilio RCS webhook senders (openclaw#102373)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Background tasks pane in the Control UI chat view

1 participant