Skip to content

feat(ui): expand child sessions in sidebar - #108838

Merged
steipete merged 6 commits into
mainfrom
codex/expandable-child-sessions
Jul 16, 2026
Merged

steipete merged 6 commits into
mainfrom
codex/expandable-child-sessions

Conversation

@steipete

@steipete steipete commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Related: #52803

AI-assisted: built and reviewed with Codex.

What Problem This Solves

Spawned child sessions are hidden from the normal Control UI sidebar, so operators cannot see parent-child structure, follow nested work, or open a child transcript without leaving the chat workflow.

Why This Change Was Made

The sidebar now progressively discloses child sessions beneath their parent. Expanding a row loads its children through the existing sessions.list({ spawnedBy }) contract, renders nested status and runtime, and opens a child in chat without giving child rows root-only pin, grouping, drag, selection, or menu behavior.

Direct child routes reconstruct their visible ancestry through sessions.describe, including parents outside the current root page. Existing root grouping, pagination, and session scope remain authoritative. No protocol, config, persistence, or migration surface changes.

The interaction takes the useful part of ymichael/bb—compact progressive disclosure of worker activity—while preserving OpenClaw's existing session ownership and navigation contracts.

User Impact

Operators can expand any session with children, monitor running/completed/failed descendants with elapsed runtime, and open a child transcript directly. The default sidebar stays compact; children load only after expansion, and newly spawned children do not force rows open.

Evidence

Visual proof

Collapsed

Collapsed parent row showing two child sessions

Expanded

Expanded parent row showing two completed child sessions

The screenshots use synthetic labels only. The expanded state was also exercised against a real isolated OpenClaw Gateway session graph created through OpenAI: a parent spawned two child sessions, both completed, and the Control UI opened the exact child transcript. The API key came from a SecretRef and was never printed or stored in the repository.

Exact-head automated proof

Final PR head: f58474682681ed3edc32cec3299a3150545c795f

  • Hosted CI on the final PR head: passed.
  • pnpm check:changed on Blacksmith Testbox at runtime head 146a4797078300f39531e6b13264dd61d8b2da94: passed, including core/UI typechecks and all lint shards. The final head differs only by removing a release-owned root changelog edit.
  • pnpm check:test-types on the same runtime head Testbox: passed.
  • Production pnpm build on the same runtime head Testbox: passed, including Control UI asset and performance checks.
  • Browser-level session-management E2E: 18/18 passed, including expands child sessions inline and opens a child chat.
  • Focused component/data tests: 89/89 passed.
  • Strict Control UI i18n check: passed with authenticated translations for all 20 locales and zero fallback pairs.
  • Source-blind behavior validation: 8/8 acceptance scenarios passed.
  • Mandatory Codex autoreview: clean after addressing stale-request, incomplete-page retry, and main-integration findings.

Behavior covered

  • Recursive expand/collapse with lazy, paginated child loading.
  • Cross-agent children returned by the parent-scoped list contract.
  • Running, done, failed, killed, and timeout presentation plus stable elapsed runtime.
  • Direct cold routes and ancestry reconstruction when the parent is outside the current root window.
  • Stale request rejection across route, capability, client, and reconnect changes.
  • Root-only grouping, pinning, drag, multi-select, pagination, and menus.
  • Documentation and authenticated locale updates for the new UI behavior; release context remains in this PR body.

@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 16, 2026

@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: 6d41b3e6f7

ℹ️ 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 +601 to +604
.filter((row) => {
const parentKey = row.spawnedBy ?? row.parentSessionKey;
return !parentKey || !rootKeys.has(parentKey);
})

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 Keep off-page children out of root rows

When sessions.list returns a child row whose parent is not in the current page/window (for example a newer child with an older parent), this keeps the row and then builds it as a root session. That gives a non-active child root grouping, pinning, dragging, multi-select, and pagination controls even though the new Control UI docs say child rows stay outside those surfaces; only the active routed child should be promoted or have its parent lineage loaded.

Useful? React with 👍 / 👎.

}
}
for (const row of rowsByKey.values()) {
const parentKey = row.spawnedBy ?? row.parentSessionKey;

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 Prefer explicit parentSessionKey for tree parents

This chooses legacy spawnedBy before explicit parentSessionKey, but existing lineage code treats parentSessionKey as the best parent when both are present (see packages/acp-core/src/session-lineage-meta.ts). For moved/dashboard child rows that retain a stale spawnedBy but have a current parentSessionKey, the sidebar maps the child under the old parent and the directly-opened active path can expand the wrong ancestor.

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: 146a479707

ℹ️ 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".

!adopted.has(lineageRoot.key) &&
!scopedRootRows.some((row) => row.key === lineageRoot.key)
) {
scopedRootRows.push(lineageRoot);

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 Keep direct child ancestry ahead of root pagination

When a user opens a child session whose parent is outside the current root page and the sidebar already has visibleSessionLimit root rows, this appends the recovered parent after those rows. renderSessionListBody then immediately applies limitSidebarSessionRows, and because the recovered parent is neither active nor pinned (the active row is the child), it is treated as overflow and dropped, so the child and ancestor path stay hidden until the user loads more sessions. Promote this lineage root before pagination or make it a required row.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 2488d79 into main Jul 16, 2026
92 of 94 checks passed
@steipete
steipete deleted the codex/expandable-child-sessions branch July 16, 2026 10:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 17, 2026
* feat(ui): expand child sessions in sidebar

* test(ui): type child session list options

* refactor(ui): split child session data helpers

* fix(ui): preserve session link semantics

* fix(ui): retry incomplete child session loads

* chore: keep release changelog owner-only
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* feat(ui): expand child sessions in sidebar

* test(ui): type child session list options

* refactor(ui): split child session data helpers

* fix(ui): preserve session link semantics

* fix(ui): retry incomplete child session loads

* chore: keep release changelog owner-only
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.

1 participant