#12884: Feature/named persistent sessions
app: web-ui
gateway
stale
Cluster:
Session Management Enhancements
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Added named persistent sessions feature allowing users to create labeled sessions that survive `/new` and `/reset` commands. Sessions can be created via `sessions.create` API or `/session new` command, deleted sessions are archived with metadata sidecars for restoration, and the UI displays persistent sessions with a 📌 badge.
Major changes:
- Added `persistent`, `userCreated`, `description`, and `createdAt` fields to `SessionEntry` type
- Implemented `sessions.create` RPC method to create named sessions with optional inheritance from existing sessions
- Implemented `sessions.restore` RPC method to recover deleted sessions from archived transcripts and metadata sidecars
- Modified `sessions.delete` to write session metadata to separate `.metadata.json` sidecar files (preserves clean JSONL transcripts)
- Modified `sessions.reset` to block resetting persistent sessions
- Added `includeDeleted` parameter to `sessions.list` to show archived sessions
- Added `/session new`, `/session list`, and `/session switch` commands for chat-based session management
- UI changes include delete/restore controls and persistent session indicators
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The implementation is thorough with comprehensive e2e tests covering creation, deletion, restoration, and edge cases. Previous review concerns about transcript mutation and full-file reads have been addressed by using metadata sidecar files. Input validation is proper with schema-based constraints on labels and parameters. The code follows existing patterns and includes proper error handling.
- No files require special attention
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#6653: fix: persist archived session entry on /new or /reset
by leicao-me · 2026-02-01
77.6%
#16061: fix(sessions): tolerate invalid sessionFile metadata
by haoyifan · 2026-02-14
76.7%
#14358: fix: preserve session overrides (verbose, model) across /new or /rese…
by WyattSanders · 2026-02-12
75.0%
#12296: security: persistence-only secret redaction for session transcripts
by akoscz · 2026-02-09
74.7%
#15684: fix(telegram): persist relative session transcript paths
by Jdo300 · 2026-02-13
74.4%
#4664: fix: per-session metadata files to eliminate lock contention
by tsukhani · 2026-01-30
74.1%
#14576: Fix/memory loss bugs
by ENCHIGO · 2026-02-12
73.9%
#13882: feat: Enhance session checkpoint system with better types and valid...
by trevorgordon981 · 2026-02-11
73.7%
#12996: feat(infra): Add session persistence with atomic writes and recovery
by trevorgordon981 · 2026-02-10
72.9%
#8751: fix(security): use 0o600 permissions for session transcript files
by revenuestack · 2026-02-04
72.9%