Skip to content

feat(sessions): first-class archived-session handling (tri-state filter, pruning exemption, inline archived UI) - #112554

Merged
steipete merged 2 commits into
mainfrom
claude/archived-sessions-handling-eb4e1f
Jul 22, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/archived-sessions-handling-eb4e1f

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Archived sessions were second-class: the sidebar could only bounce you to a separate page to see them, neither surface offered a mixed Active+Archived view (the protocol filter was a plain boolean), and — worst — automatic session-store maintenance silently pruned archived sessions once they aged past the retention window, so "archive" quietly meant "delete later."

Why This Change Was Made

Archive should be a safe long-term shelf: browsable in place, restorable, and kept until the user explicitly deletes it. Modeled on the archived-session UX in Claude Desktop's session sidebar (status filter with Active / Archived / All, inline dimmed rows, and an in-conversation Unarchive banner).

User Impact

  • Retention contract: archived sessions are exempt from every automatic maintenance path — age pruning, entry caps, model-run cleanup, disk-budget eviction, and cleanup repairs. Only explicit delete (sessions.delete, which requires archivedOnly for write-scope operators) removes them. The SQLite stale-candidate precheck also skips archived rows so they cannot force repeated store loads.
  • Protocol (additive): sessions.list archived now accepts true | false | "all"; booleans behave exactly as before.
  • Sidebar: the sort/filter menu gains a persisted Status group (Active / Archived / All). Archived rows render inline, dimmed with an archive glyph, excluded from unread/attention/lineage promotion; the context menu offers Unarchive; deleting an archived row uses the write-scope archivedOnly path. The nav-away "View archived" footer button is removed. The retired internal ?showArchived=1 dashboard URL is deliberately not parsed (not a shipped contract; noted inline in route.ts).
  • Sessions page: the binary toggle becomes Active / Archived / All; All dims archived rows and labels them; recency filter stays active-only; per-status empty states (also fixes the always-"filtered" empty-state predicate caused by default includeUnknown=false).
  • Chat: archived sessions show a full-width banner above the disabled composer — "This session is archived. Unarchive it to continue the conversation." with an Unarchive action.
  • app-sidebar-session-data.ts exceeded the 700-line cap and was split: the session-catalog concern moved to a new AppSidebarSessionCatalogDataElement layer (pure move, no behavior change).

Docs updated: docs/concepts/session.md (retention), docs/web/control-ui.md (sidebar/page filters, banner).

Evidence

All remote proof on Blacksmith Testbox tbx_01ky440qxp5entrdfgk32jhxx4 (provider blacksmith-testbox, synced from this branch):

  • Focused suites (17 files: protocol schema, gateway list filter, store pruning incl. new archived-exemption cases for prune/cap/disk-budget, UI lib/sidebar/sessions-page/chat): 719 tests passing.
  • pnpm check:changed fully green (format, i18n catalog, typecheck core/tests/UI, lint core incl. max-lines, boundaries; 15m19s, wrapper exitCode 0).
  • Post-fix rerun of ui/src/components/app-sidebar.test.ts + app-sidebar-session-types.test.ts: 154 tests passing.
  • Codex-backed autoreview (gpt-5.6-sol): stale-request race on filter switch found and fixed (token retirement in refreshSidebarSessions); archived-state handoff claim refuted (chat.history sessionInfo.archived drives the banner independent of roster membership); legacy-URL compat consciously rejected per repo compat policy.

@steipete
steipete marked this pull request as ready for review July 22, 2026 06:34
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: XL maintainer Maintainer-authored PR labels Jul 22, 2026
Archived sessions are now exempt from every automatic maintenance path
(age prune, entry cap, model-run prune, disk budget, cleanup repairs);
only explicit sessions.delete removes them. sessions.list gains an
additive tri-state archived filter (true | false | "all"). The sidebar
gets a persisted Active/Archived/All status filter with inline dimmed
archived rows, replacing the nav-away View-archived button; the Sessions
page toggle becomes the same tri-state with dimmed+badged rows in All
mode; the chat composer's archived notice becomes a full-width banner
with an Unarchive action.
@steipete
steipete force-pushed the claude/archived-sessions-handling-eb4e1f branch from eb68189 to 16e5053 Compare July 22, 2026 06:36
@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat(sessions): first-class archived-session handling (tri-state filter, pruning exemption, inline archived UI) This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete merged commit d4f19bf into main Jul 22, 2026
117 checks passed
@steipete
steipete deleted the claude/archived-sessions-handling-eb4e1f branch July 22, 2026 08:28
@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 23, 2026
…er, pruning exemption, inline archived UI) (openclaw#112554)

* feat(sessions): first-class archived-session handling

Archived sessions are now exempt from every automatic maintenance path
(age prune, entry cap, model-run prune, disk budget, cleanup repairs);
only explicit sessions.delete removes them. sessions.list gains an
additive tri-state archived filter (true | false | "all"). The sidebar
gets a persisted Active/Archived/All status filter with inline dimmed
archived rows, replacing the nav-away View-archived button; the Sessions
page toggle becomes the same tri-state with dimmed+badged rows in All
mode; the chat composer's archived notice becomes a full-width banner
with an Unarchive action.

* chore(protocol): regenerate Swift gateway models for tri-state archived filter
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 gateway Gateway runtime maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant