Archived Session Management
/install archived-session-management
Archived Session Management
Implement archived-session UX as an end-to-end feature, not a single-button patch. Archived session work spans the Control UI, gateway RPC handlers, transcript file moves, the session_history SQLite index, and the live sessions.json store.
Core workflow
-
Inspect the whole chain first
- UI list/search rendering
- gateway methods for
sessions.archived,sessions.resume,sessions.deleteArchived - archive/restore helpers in
src/gateway/session-archive.ts - history DB filters in
src/config/sessions/history-db.ts - live session store behavior in
sessions.json
-
Treat these as separate failure classes
- archived list cannot find a real session
- archived list finds the session but resume fails
- resume works but opens the wrong live session
- session vanishes from both Live and Archived due to DB/store drift
-
Fix backend truth before UI polish
- Make archived search and restore semantics correct.
- Then wire or refine UI buttons, copy, filters, and pagination.
-
Reconcile legacy/inconsistent rows when needed
- Archived session features often fail because the DB, transcript path, and live store disagree.
- Be tolerant in reads, then repair writes so future rows stay consistent.
Required implementation areas
1. Archived-session search
Archived search must match more than just friendly labels. Include at least:
sessionIdsessionKeydisplayNamefirstMessageagentIdchannelchatTypestatusfilePath
When filtering archived sessions, do not rely on status = 'archived' alone. Legacy rows can still be archived-discoverable when:
archivedAt IS NOT NULL, orfilePathpoints into/sessions/archive/
Read references/implementation-map.md before editing the query layer.
2. Restore / resume behavior
Restoring an archived session must be idempotent.
Handle all three cases:
- transcript exists only in archive → move it back to active sessions dir
- transcript already exists in active sessions dir → do not fail; repair metadata and continue
- transcript exists nowhere → return not found
When restore succeeds, update the history row so it reflects the active transcript path and active status.
3. Rebind restored sessions into a unique live key
Do not resume old archived main sessions into agent:main:main.
Older rows often store that key, which causes the UI to jump back into the current main thread instead of the restored transcript.
Bind restored transcripts to a distinct live key such as:
agent:\x3CagentId>:archive-\x3CsessionId>
Then write that binding into the live session store so the session actually appears in Live and can be opened by URL.
4. UI expectations
Archived-session UI should include:
- Archived tab / section
- search box
- Resume button
- Delete action for archived transcripts when supported
- loading / empty states that are specific enough to debug
If the repo already has the UI shell, wire it to the corrected backend instead of rebuilding it.
Debugging checklist
When a user says an archived session is broken, verify all four:
- History row exists in
session_history - Transcript file exists at the path the row expects, or at the active fallback path
- History row status/path fields are coherent
- Live store contains a session binding after resume
If a session is in neither Live nor Archived, suspect DB/store drift immediately.
File map
Read references/implementation-map.md for the concrete OpenClaw file map, bug patterns, and example fixes.
Delivery standard
When work is complete, report:
- what failed
- which layer was wrong (UI, restore logic, DB filter, store binding, or mixed state)
- what changed
- whether a rebuild / gateway restart is needed
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install archived-session-management - After installation, invoke the skill by name or use
/archived-session-management - Provide required inputs per the skill's parameter spec and get structured output
What is Archived Session Management?
Implement, extend, or repair archived-session browsing in OpenClaw Control UI. Use when adding or fixing Archived Sessions / Recent Archived Sessions UI, arc... It is an AI Agent Skill for Claude Code / OpenClaw, with 96 downloads so far.
How do I install Archived Session Management?
Run "/install archived-session-management" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Archived Session Management free?
Yes, Archived Session Management is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Archived Session Management support?
Archived Session Management is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Archived Session Management?
It is built and maintained by maverick-software (@maverick-software); the current version is v1.0.0.