Skip to content

fix: sidebar child badges include archived sessions after refresh - #165160

Merged
obviyus merged 1 commit into
mainfrom
fix/sidebar-child-count-archived-165118
Oct 4, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/sidebar-child-count-archived-165118

Conversation

@obviyus

@obviyus obviyus commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #165118

What Problem This Solves

Fixes sidebar child-count badges that include archived children after a refresh, even though expanding the parent shows only live children. Thanks @tre1d for the report.

User Impact

Parents now show the live child count immediately: mixed parents exclude archived children, and parents with no live children have no badge. Archived children remain available in the archived-sessions view. No stored data, schemas, archive lifecycle, or protocol changes.

Why This Change Was Made

The sessions-list projection now applies the same archive predicate to child links as it applies to the expander's session query. Prepared child metadata retains the archive timestamp for this read-only projection; the unfiltered lineage remains available to other readers.

Evidence

  • Real built Gateway and Chromium: created three parents with two children each through sessions.create, archived three children with openclaw sessions archive, then loaded the Control UI.
  • Before: live/mixed/all-archived parents each showed 2; expanding the all-archived parent removed its badge and showed no children.
  • After: counts 2 / 1 / no badge. Expanding live and mixed parents showed exactly their live children. The archived-sessions view still showed all three archived children.
  • Regression fails on 8bc460204197773ee26b66f970230e958d8c21fa by including the archived child; the fixed projection test file passes 5/5 tests, including archive/unarchive refreshes and archive-only/all views.
  • Gateway builds passed. The unchanged UI bundle built, but the baseline UI startup-size check reported 373,863 bytes against a 373,454-byte gzip limit; browser proof used that built bundle through an explicit Control UI root.
  • Live check on 0b5433e0be5ead3f01e5003f602916d74d3e61ba: a real gpt-5-mini turn through the fixed Gateway returned SIDEBAR_LIVE_OK with low reasoning and a 4,096-token output budget. One successful provider call; an initial pre-provider catalog lookup required models list --refresh.
  • Requested single-worker timing (pnpm test src/gateway/session-row-projection.list-page.test.ts --maxWorkers=1, same container, compiler cache misses on both): baseline 22.022 s wall / 4 tests passed; candidate 22.748 s wall / 5 tests passed. Exact-head CI passed: 459 s elapsed and 6,859 summed successful-job seconds, zero failed or cancelled jobs. openclaw/ci-gate is green.

Before

Before: archived children inflate sidebar badges

After

After: badges count only live children

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Oct 4, 2026
@obviyus
obviyus marked this pull request as ready for review October 4, 2026 22:22
@obviyus

obviyus commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

Please review exact head 0b5433e. The PR body includes inspected before/after Control UI screenshots, real creation/archive flow and controls, a failing-before/passing-after regression, and the successful gpt-5-mini live Gateway check. This changes only list presentation and prepared read metadata, not schemas, stored data, or archive lifecycle.

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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: 🐚 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 Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 6:35 PM ET / 22:35 UTC (Revision 2).

ClawSweeper review

What this changes

The Gateway filters child-session links by the requested archive view so sidebar badges count live children after refresh.

Merge readiness

✅ Ready for maintainer review

The prior review’s timing request is satisfied on the unchanged head. The fix remains necessary, the inspected screenshots demonstrate the corrected badges, and no blocking defect remains.

Priority: P2
Reviewed head: 0b5433e0be5ead3f01e5003f602916d74d3e61ba

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair with strong visible proof, meaningful regression coverage, and the prior evidence request completed.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots directly show the changed Gateway list behavior in the Control UI: 2/2/2 becomes 2/1/no badge after real creation and archive operations. The recorded expansion and archived-view controls support preservation of discovery and restoration; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after screenshots directly show the changed Gateway list behavior in the Control UI: 2/2/2 becomes 2/1/no badge after real creation and archive operations. The recorded expansion and archived-view controls support preservation of discovery and restoration; no stored-data contract changes.
Evidence reviewed 8 items Pinned patch and merge ownership: The introduced delta is limited to archive filtering, prepared child metadata, and its regression. Raw test-merge parents match the pinned base followed by the exact PR head; comparison with that base retains the same four-file change.
Fix remains necessary on current main: Fetched main still copies the presented child links without archive filtering. Its compact child metadata also omits archivedAt, so the existing UI correction after expansion does not resolve the initial server count.
Existing archive contract and preservation: Archive documentation defines exclusion from the default active list while retaining transcripts. The patch reuses the existing archive predicate after sharing presentation, preserves unfiltered projection lineage, and changes no storage, schema, configuration, or protocol.
Findings None None.
Security None None.

How this fits together

The Gateway prepares session lists from stored session metadata and sends them to the Control UI. Child links in those lists determine sidebar badges and which conversations users can expand.

flowchart TD
  A[Stored session metadata] --> B[Prepared session projection]
  C[Requested archive view] --> D[Session list filtering]
  B --> D
  D --> E[Matching child links]
  E --> F[Control UI badges and expanders]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +17, Tests +42. Total +59 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 23 6 +17
Tests 1 42 0 +42
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 65 6 +59

Review metrics

Metric Value Why it matters
Focused test cost 22.022 → 22.748 seconds; +0.726 seconds The recorded single-worker comparison satisfies the prior review’s test-cost request.

Technical review

Best possible solution:

Keep archive-aware counting in the Gateway list owner while preserving complete lineage for other readers and archived-session restoration.

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

Yes: current-main source exposes unfiltered child links, and the contributor’s real Gateway before/after evidence demonstrates the refresh mismatch. This read-only review did not execute the application.

Is this the best way to solve the issue?

Yes: reusing the archive predicate in the existing list projection repairs the producer without duplicating UI policy or changing archive lifecycle.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 42ebb9d73483.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a bounded sidebar count inconsistency without losing sessions or preventing conversation use.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after screenshots directly show the changed Gateway list behavior in the Control UI: 2/2/2 becomes 2/1/no badge after real creation and archive operations. The recorded expansion and archived-view controls support preservation of discovery and restoration; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after screenshots directly show the changed Gateway list behavior in the Control UI: 2/2/2 becomes 2/1/no badge after real creation and archive operations. The recorded expansion and archived-view controls support preservation of discovery and restoration; no stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after screenshots directly show the changed Gateway list behavior in the Control UI: 2/2/2 becomes 2/1/no badge after real creation and archive operations. The recorded expansion and archived-view controls support preservation of discovery and restoration; no stored-data contract changes.

Evidence

What I checked:

  • Pinned patch and merge ownership: The introduced delta is limited to archive filtering, prepared child metadata, and its regression. Raw test-merge parents match the pinned base followed by the exact PR head; comparison with that base retains the same four-file change. (src/gateway/session-utils-list.ts:613, 0b5433e0be5e)
  • Fix remains necessary on current main: Fetched main still copies the presented child links without archive filtering. Its compact child metadata also omits archivedAt, so the existing UI correction after expansion does not resolve the initial server count. (src/gateway/session-utils-list.ts:612, 42ebb9d73483)
  • Existing archive contract and preservation: Archive documentation defines exclusion from the default active list while retaining transcripts. The patch reuses the existing archive predicate after sharing presentation, preserves unfiltered projection lineage, and changes no storage, schema, configuration, or protocol. Public docs: docs/cli/sessions.md. (docs/cli/sessions.md:174, 0b5433e0be5e)
  • Inspected real behavior proof: Inspected both downloaded PR screenshots: before, live/mixed/all-archived parents each show 2; after, they show 2/1/no badge. The captured body describes real sessions.create and CLI archive operations against a built Gateway in Chromium, matching the changed list projection. Expansion and archived-view controls are also recorded in the body. (0b5433e0be5e)
  • Prior request resolved: The prior completed review had no findings and requested only test-cost evidence. The captured body now records baseline 22.022 seconds versus candidate 22.748 seconds for the requested single-worker command, with 4 versus 5 passing tests. The added regression covers cold reads, archive/unarchive publications, archive-only selection, and All mode. (src/gateway/session-row-projection.list-page.test.ts:125, 0b5433e0be5e)
  • Exact-head CI verified: GitHub run https://github.com/openclaw/openclaw/actions/runs/37239752457 completed successfully for the reviewed head in 459 seconds. Independently summed job timestamps confirm 6,859 successful-job seconds across 40 successful jobs, with zero failed or cancelled jobs in that run. (0b5433e0be5e)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (1 earlier review cycle)
  • reviewed 2026-10-04T22:26:52.287Z sha 0b5433e :: needs changes before merge. :: none

@obviyus

obviyus commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

The only requested item is now in the PR evidence: exact single-worker before/after wall times (22.022 s / 22.748 s), plus completed green CI (459 s elapsed, 6,859 successful-job seconds, zero failed/cancelled jobs). Same exact head 0b5433e; no code changes or CI reruns.

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus
obviyus merged commit 95d4195 into main Oct 4, 2026
226 of 234 checks passed
@obviyus
obviyus deleted the fix/sidebar-child-count-archived-165118 branch October 4, 2026 23:23
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…enclaw#165160)

The Control UI sidebar's child-count badge counted archived child sessions, so after a bulk archive it showed a count the expander couldn't open. The default (non-archived) `sessions.list` projection now filters each parent's `childSessions` with the same archive filter used for the rows themselves. `archived: "all"` still returns every child. Child links now carry `archivedAt`, so the filter needs no extra reads, and the serialized wire rows use the filtered copy.

Proof: a real Gateway and Chromium run that creates parents, archives children, then refreshes. Base badges were 2/2/2; with this change, live/mixed/all-archived parents show 2/1/none. Expanders and the archived view behave correctly. The regression test fails on base and passes here. Before and after screenshots are in the PR.

Fixes openclaw#165118.

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

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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

Sidebar child-count badge counts archived children after bulk archive (2026.9.8, follow-up to #157068)

1 participant