You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a6c66d1
Browse filesBrowse the repository at this point in the historyBrowse files
feat(levelcode): resume sessions + Done/Rename/Delete from History
The read side of Sessions. Reopen a past session and it walks back in — the
model's context is restored (budget-fitted to the window, §4.5) and the
readable conversation is replayed into the chat; the card actions archive,
rename, and soft-delete. All append-only, so nothing rewrites history.
- sessionEvents.js: toDisplayTurns(messages) — the pure fold from a raw
transcript to the readable prompts + prose to replay (tool_result user
messages and tool_use-only assistant turns dropped).
- sessions.js: resume(id) rebuilds the transcript, plans the load (three-tier
planResume), re-attaches so further turns append to the SAME session (no
fork), and returns { full, messages, turns, plan, note }. rename/archive/
trash/setPinned are append-only label/title events; reindex now keys off any
id so a lifecycle edit on a past session updates its list row too.
- extension.js: handleSessionAction routes resume/done/rename/delete from both
surfaces; resumeSession restores agentMessages + replays via a sessionResumed
post + focuses the chat; refreshSessions pushes the list to the modal and the
sidebar after an edit. Done archives (reversible), Delete soft-trashes.
- media/chat.html: a "Resumed" banner (+ the honest summary note when the
transcript was too big to carry verbatim) and resumeTranscript() replaying
the conversation; log-token themed, no drift to the SESSIONS-PURE block.
- package.json: sessions.resumeBudgetPct (default 40).
- tests: +2 sessionEvents (toDisplayTurns), +4 sessions (resume verbatim /
compacted / missing, and archive+rename+trash), +1 sessionsUi (resume
wiring). Full suite 30 files green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
agentMessages.unshift({role: 'user',content: '[Resumed session — the earlier part of this conversation ('+omitted+' message'+(omitted===1 ? '' : 's')+') was omitted to fit the context window. It is shown above in the transcript but not included here; ask if you need details from it.]'});
735
+
}
736
+
conversation=[];
737
+
checkpoints.length=0;currentCheckpoint=null;// old file-snapshots can't be restored
Copy file name to clipboardExpand all lines: extensions/levelcode-ai/package.json
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -441,6 +441,13 @@
441
441
"description": "Folder to store session History in. Empty = ~/.levelcode/sessions. Each project gets its own subfolder; the files are append-only JSONL you can back up, diff, or delete by hand.",
442
442
"scope": "machine"
443
443
},
444
+
"levelcode.ai.sessions.resumeBudgetPct": {
445
+
"type": "number",
446
+
"default": 40,
447
+
"minimum": 5,
448
+
"maximum": 100,
449
+
"description": "When you resume a session, the share of the model's context window its restored transcript may fill before it is summarized to fit. Lower = resume with less history (cheaper, faster); higher = carry more of the past conversation verbatim. The full transcript is always kept on disk and shown in the replay regardless."
0 commit comments