Skip to content

fix(archive): use host title projections for the list - #133

Merged
Ultroncn merged 2 commits into
mainfrom
fix/archived-list-host-titles
Dec 1, 2026
Merged

Ultroncn merged 2 commits into
mainfrom
fix/archived-list-host-titles

Conversation

@Ultroncn

@Ultroncn Ultroncn commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Closes #131.

On 2.0.9, cold-start Archived refreshes still opened every existing session log to scan for the last session/title event, scaling with total compressed log bytes (about 9.3 s across 171 zstd logs / 138 MB on Windows 11).

GET /state now reads list titles from the Host's sessionProjections (for live sessions) and sessionProjectionCache (including cachedPredecessorTitle hints across adjacent format versions) without opening any session logs. Entries without a saved projection stay visible as Untitled chat / 未命名会话.

Explicit Archived search batches pass includeTitles: true so cold log titles are still matched, and one-character queries check exact titles from logs without scanning message bodies. Previews and ZIP exports continue to read the original session logs, and session files, tags, notes and archive markers are not modified by listing.

I tested on macOS with Node.js 24.22.3 against DSH 0.2.2-rc.5 (171 compressed v4 sessions plus 680 missing archive IDs after a cold restart): GET /state made zero session-log open calls and returned in ~27 ms. The unit suite had 513 passes and 19 skips. All eight native Host fixtures, both client fixtures, the SQLite checks, release-candidate/changelog checks and npm pack --dry-run --json passed.

@Ultroncn
Ultroncn merged commit 6fa0f24 into main Dec 1, 2026
25 of 30 checks passed
@Ultroncn
Ultroncn deleted the fix/archived-list-host-titles branch December 1, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dangling archived ids make /state scale linearly (8–9 s) and cannot be cleaned

1 participant