What happened?
Repro: pi --resume OOMs with large session history
Environment
- pi: 0.73.0
- node: v25.9.0
- npm: 11.13.0
- session files: 2725 JSONL files
- session dir size: 4.2G
- largest session: ~203MB
Actual
Pi crashes with V8 heap OOM while loading sessions:
Resume Session (All) | Loading 2/2724 | Name: All Sort: Threaded
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Screenshot evidence:
/tmp/pi-clipboard-d3dd53a5-7703-409c-b5e0-de4130a84aaf.png
Likely trigger
pi --resume appears to eagerly scan/parse too much session JSONL content when many/large
historical sessions exist.
Steps to reproduce
Steps
-
Have a large Pi session history under:
~/.pi/agent/sessions
In this case:
find ~/.pi/agent/sessions -type f -name '*.jsonl' | wc -l
# 2725
2. Run:
```bash
pi --resume
- Open the default resume picker with scope All, sort Threaded.
- Wait while it starts loading sessions.
Expected behavior
Resume picker should stay responsive and either lazily load/index sessions or degrade
gracefully.
Version
0.73.0
What happened?
Repro:
pi --resumeOOMs with large session historyEnvironment
Actual
Pi crashes with V8 heap OOM while loading sessions:
Screenshot evidence:
/tmp/pi-clipboard-d3dd53a5-7703-409c-b5e0-de4130a84aaf.png
Likely trigger
pi --resume appears to eagerly scan/parse too much session JSONL content when many/large
historical sessions exist.
Steps to reproduce
Steps
Have a large Pi session history under:
~/.pi/agent/sessionsIn this case:
Expected behavior
Resume picker should stay responsive and either lazily load/index sessions or degrade
gracefully.
Version
0.73.0