Quick summary
Interactive studio code sessions resume appears stuck on "Resuming session…" when a session .jsonl has accumulated many studio.tool_progress entries. The same bloat slows studio code sessions list because every session file is fully parsed. Distinct from #3286 (live-UI duplicate progress): progress ticks are still persisted and replayed on resume.
Steps to reproduce
- Run a Studio Code session that triggers many tool operations (file search, terminal, etc.) over a modest number of user turns.
- Inspect the session
.jsonl under the sessions directory — it grows primarily with customType: "studio.tool_progress" lines.
- Run
studio code sessions resume <id> (interactive TUI).
- CLI stays on "Resuming session…" for a long time or appears frozen.
Workaround (confirms root cause): studio code sessions resume <id> "message" --json completes without hanging (skips TUI replay).
Optional: studio code sessions list also becomes slow when multiple session files are similarly bloated.
What you expected to happen
Progress messages are ephemeral UI state. Resume should restore conversation context (messages, tool results, site selection) quickly, without replaying every loader tick stored on disk.
What actually happened
Interactive resume hangs or feels frozen on "Resuming session…" until tens of thousands of studio.tool_progress entries are replayed. Session list is slow because each .jsonl is fully read.
In one affected session: ~25,000 total lines, ~24,900 studio.tool_progress (~99%), ~270 lines of real content after pruning progress only, ~10 MB file size — with relatively few user turns. After removing studio.tool_progress entries (with backup), interactive resume worked immediately.
Impact
Some (< 50%)
Available workarounds?
No but the app is still usable
Platform
Windows
Logs or notes
Environment
- OS: Windows 10 (pattern should apply to any platform using the CLI TUI)
- Commands:
studio code sessions resume, studio code sessions list
- Session storage:
%APPDATA%\Studio\sessions
Root cause (code path)
- Every progress callback is persisted —
apps/cli/commands/ai/index.ts:
setProgressCallback( ( message, update ) => {
ui.setLoaderMessage( message, update );
if ( ! message.trim() ) return;
void append( ( sm ) => appendStudioEntry( sm, 'studio.tool_progress', { message } ) );
} );
-
Interactive resume replays every entry — apps/cli/ai/sessions/replay.ts (studio.tool_progress branch calls setLoaderMessage per line). ~25k entries = O(n) replay of UI noise.
-
Session list reads full files — tools/common/ai/sessions/store.ts: listAiSessions() calls readPiFileEntries(filePath) for every .jsonl.
Suggested directions (non-prescriptive)
- Do not persist
studio.tool_progress (live-only setLoaderMessage), or
- Persist only the latest progress per tool run / coalesce updates, or
- Skip
studio.tool_progress in replaySessionHistory, and/or
- Derive session summaries for
list without parsing entire JSONL bodies.
Workarounds today
- Headless resume:
studio code sessions resume <id> "<prompt>" --json
- Prune
studio.tool_progress from .jsonl (backup first)
Community maintenance tool (not affiliated with Automattic): https://github.com/silvaitamar/wp-studio-session-cleaner
Happy to provide redacted samples or help validate a fix.
Quick summary
Interactive
studio code sessions resumeappears stuck on "Resuming session…" when a session.jsonlhas accumulated manystudio.tool_progressentries. The same bloat slowsstudio code sessions listbecause every session file is fully parsed. Distinct from #3286 (live-UI duplicate progress): progress ticks are still persisted and replayed on resume.Steps to reproduce
.jsonlunder the sessions directory — it grows primarily withcustomType: "studio.tool_progress"lines.studio code sessions resume <id>(interactive TUI).Workaround (confirms root cause):
studio code sessions resume <id> "message" --jsoncompletes without hanging (skips TUI replay).Optional:
studio code sessions listalso becomes slow when multiple session files are similarly bloated.What you expected to happen
Progress messages are ephemeral UI state. Resume should restore conversation context (messages, tool results, site selection) quickly, without replaying every loader tick stored on disk.
What actually happened
Interactive resume hangs or feels frozen on "Resuming session…" until tens of thousands of
studio.tool_progressentries are replayed. Session list is slow because each.jsonlis fully read.In one affected session: ~25,000 total lines, ~24,900
studio.tool_progress(~99%), ~270 lines of real content after pruning progress only, ~10 MB file size — with relatively few user turns. After removingstudio.tool_progressentries (with backup), interactive resume worked immediately.Impact
Some (< 50%)
Available workarounds?
No but the app is still usable
Platform
Windows
Logs or notes
Environment
studio code sessions resume,studio code sessions list%APPDATA%\Studio\sessionsRoot cause (code path)
apps/cli/commands/ai/index.ts:Interactive resume replays every entry —
apps/cli/ai/sessions/replay.ts(studio.tool_progressbranch callssetLoaderMessageper line). ~25k entries = O(n) replay of UI noise.Session list reads full files —
tools/common/ai/sessions/store.ts:listAiSessions()callsreadPiFileEntries(filePath)for every.jsonl.Suggested directions (non-prescriptive)
studio.tool_progress(live-onlysetLoaderMessage), orstudio.tool_progressinreplaySessionHistory, and/orlistwithout parsing entire JSONL bodies.Workarounds today
studio code sessions resume <id> "<prompt>" --jsonstudio.tool_progressfrom.jsonl(backup first)Community maintenance tool (not affiliated with Automattic): https://github.com/silvaitamar/wp-studio-session-cleaner
Happy to provide redacted samples or help validate a fix.