Repository navigation
fix: sidebar child badges include archived sessions after refresh - #165160
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
@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. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 6:35 PM ET / 22:35 UTC (Revision 2). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +17, Tests +42. Total +59 across 4 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@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. |
|
🦞👀 Re-review progress:
|
…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]>
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
sessions.create, archived three children withopenclaw sessions archive, then loaded the Control UI.8bc460204197773ee26b66f970230e958d8c21faby including the archived child; the fixed projection test file passes 5/5 tests, including archive/unarchive refreshes and archive-only/all views.0b5433e0be5ead3f01e5003f602916d74d3e61ba: a realgpt-5-miniturn through the fixed Gateway returnedSIDEBAR_LIVE_OKwith low reasoning and a 4,096-token output budget. One successful provider call; an initial pre-provider catalog lookup requiredmodels list --refresh.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-gateis green.Before
After