[PR #3618] Optimize session list loading by stripping diff content #10714

Closed
opened 2026-02-16 18:15:27 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/3618

State: closed
Merged: No


Problem

Session list loading takes 10+ seconds when sessions contain large diffs (hundreds of MBs). The /session endpoint returns full summary.diffs with before and after file contents, but the list view only needs file names and change counts.

Solution

Strip before/after fields from diffs in Session.list(), keeping only metadata (file, additions, deletions). Made FileDiff.before/after optional to support both lightweight (list view) and full diffs (message details).

Added session-loader.ts to handle batched reading (10 concurrent) and optimize large file parsing (>100KB reads only first chunk).

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/3618 **State:** closed **Merged:** No --- ## Problem Session list loading takes 10+ seconds when sessions contain large diffs (hundreds of MBs). The `/session` endpoint returns full `summary.diffs` with `before` and `after` file contents, but the list view only needs file names and change counts. ## Solution Strip `before`/`after` fields from diffs in `Session.list()`, keeping only metadata (file, additions, deletions). Made `FileDiff.before/after` optional to support both lightweight (list view) and full diffs (message details). Added `session-loader.ts` to handle batched reading (10 concurrent) and optimize large file parsing (>100KB reads only first chunk).
yindo added the pull-request label 2026-02-16 18:15:27 -05:00
yindo closed this issue 2026-02-16 18:15:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10714