Skip to content

fix(ui): nested archive dialog misses worker-owned children and overcounts promoted sessions - #173014

Merged
steipete merged 1 commit into
mainfrom
steipete/nested-archive-review-fixes
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/nested-archive-review-fixes

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #172489

What Problem This Solves

Fixes two gaps in the nested-session archive dialog from #172489, both raised in its review:

  • From the sidebar, archiving a parent whose only child is an unloaded worker (subagent) run skipped the dialog. Persistent sessions owned by that worker were left out of the decision.
  • For a deeper tree such as root → child → grandchild, the dialog said "has 2 nested sessions … they move to the top level". Archiving only the root promotes just the direct child; the grandchild stays nested under it.

User Impact

User impact: the Archive session? choice now also appears when a session's nested sessions sit behind a worker run that hasn't loaded yet. The message now counts only the sessions that actually move to the top level. Archive N sessions still archives the full tree.

Why This Change Was Made

The sidebar projection leaves unloaded worker branches out of a row's childSessionKeys but keeps them in childLoadParentKeys. The archive hint now checks both, through sidebarSessionHasArchiveDescendants in session-menu-descendants.ts. The dialog's count now uses the archive tree's existing ancestorsByKey. Only rows whose sole persistent ancestor is the root are counted, which matches what moves up when only the root is archived.

Evidence

  • New sidebar case "worker branch: true": a parent's only child is an unloaded worker that owns a persistent session, and clicking archive opens the choice dialog. With the hint fix reverted, this case fails (negative control).
  • The runtime test for the root → child → grandchild tree now expects "has a nested session … it moves to the top level", while still offering "Archive 3 sessions".
  • Focused tests pass 9/9. pnpm tsgo:ui and tsconfig.core.test.ui-{components,other}.json report 0 errors, and oxlint and oxfmt are clean.
  • Codex autoreview (P1): scoped-clean.

…ounts promoted sessions

Follow-up to #172489 review: the sidebar hint now also counts unloaded worker branches (childLoadParentKeys), and the dialog copy counts only direct children, the sessions that actually move to the top level.
@clawsweeper

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

@steipete
steipete marked this pull request as ready for review October 15, 2026 10:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-15T10:03:32.532165Z 7bd7078 Draft marked ready
ℹ️ 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR restores archive choices for unloaded worker-owned descendants and counts only children that become top-level sessions.

Example: Archive root in a root → child → grandchild tree.

  • Before: The dialog says 2 nested sessions move to the top level.
  • After: The dialog says 1 nested session moves to the top level and still offers Archive 3 sessions.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, narrowly scoped correction with coherent regression coverage and no findings; available validation supports the production composition through an in-process harness.
Proof confidence 🦐 gold shrimp (3/6) The supplied maintainer-authored classification places this PR outside the ordinary contributor proof gate; its new scenarios use mocked Gateway requests, while the inspected historical screenshots cover only the earlier one-child dialog.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Archiving a parent can omit the nested-session choice, and the dialog can overstate how many sessions move to the top level.
Reason: Both corrections restore the existing archive contract, and the supplied maintainer-authored classification establishes direction without another product decision.

Regression provenance

Regression provenance — verified: source commit 86380bba721a by Peter Steinberger; canonical PR #172489 (blame-to-merge-commit).

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it corrects two source-confirmed archive-dialog bugs still present on fetched main, with no introduced correctness or security findings.

Priority: P2
Reviewed head: 7bd7078d688338eb4424e15dce0b413ed483ac4a

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not show the unloaded-worker or three-level-tree correction running through a real Control UI; the worker negative control is reported in the body, and the old dialog expectation independently establishes the count regression.
Agent review details

How this fits together

The Control UI sidebar supplies a descendant hint to the shared archive runtime, which reads the Gateway-owned tree, presents archive choices, and delegates confirmed writes to existing mutation owners.

flowchart TD
  A[Sidebar archive action] --> B[Descendant hint]
  B --> C[Shared archive runtime]
  C --> D[Gateway child discovery]
  D --> E[Persistent ancestor map]
  E --> F[Archive choice dialog]
  F --> G[Existing guarded mutations]
Loading

Technical review

Best possible solution:

Use the retained sidebar load-parent facts for discovery and the existing persistent-ancestor map for promotion counts.

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

Source establishes both triggers: an unloaded worker produces no navigation child but retains a load-parent hint, and a three-level tree has two descendants but only one child promoted by parent-only archive; no target code was executed.

Is this the best way to solve the issue?

The focused repair uses existing projection facts and archive-tree ownership, preserves leaf behavior and full-tree counts, and adds regression coverage through the sidebar action and shared dialog runtime.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 97d03398c3e1.

Provenance checked

  • Sidebar archive descendant hint keeps the original intent (86380bb: The archive-choice feature used a caller hint to discover descendants only for parents and preserve leaf archives without extra Gateway reads.)
  • Nested-session promotion copy keeps the original intent (86380bb: The dialog explains parent-only promotion and offers a counted full-tree alternative; counting direct persistent children makes that explanation accurate.)
  • Persistent ancestry and guarded tree archive keeps the original intent (d0b4640: Separate sidebar placement from execution ancestry, traverse hidden workers, exclude independent branches, and archive descendants through existing guarded mutations.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 86380bb adds ui/src/components/session-organizer-archive.runtime.ts:65 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 86380bba721a; files: ui/src/components/session-organizer-archive.runtime.ts)

PR surface

Source +13, Tests +24. Total +37 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 16 3 +13
Tests 2 89 65 +24
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 105 68 +37

Labels

Label changes:

  • add P2: The archive choice can be skipped for worker-owned descendants, and deeper trees receive misleading promotion counts; both have limited UI blast radius.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The archive choice can be skipped for worker-owned descendants, and deeper trees receive misleading promotion counts; both have limited UI blast radius.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 15, 2026, 6:16 AM ET / 10:16 UTC.

@steipete
steipete merged commit c82c82e into main Oct 16, 2026
146 of 147 checks passed
@steipete
steipete deleted the steipete/nested-archive-review-fixes branch October 16, 2026 08:56
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…ounts promoted sessions (openclaw#173014)

Follow-up to openclaw#172489 review: the sidebar hint now also counts unloaded worker branches (childLoadParentKeys), and the dialog copy counts only direct children, the sessions that actually move to the top level.
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 P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant