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
storage: one undecodable legacy session file permanently breaks sessions:list and onboarding snapshot #1418
SqliteSessionStore runs importLegacySessionMetadataTree in its constructor and every store operation awaits the resulting ready promise (packages/storage/src/session-store.ts:99 + ensureReady). The import is intentionally fail-atomic — scan/decode completes before the transaction begins (packages/storage/src/session-metadata-transfer.ts:24-28) — and only tolerates ENOENT. A single permanently undecodable session.jsonl therefore rejects ready on every launch: sessions:list and onboarding:getSnapshot fail forever, and the renderer only shows a generic "刷新会话列表失败" toast with no actionable detail.
Evidence
Observed live: a profile containing sessions/947ea80c-…/session.jsonl whose first line is a turn_state record instead of a SessionHeader → both IPC handlers throw Invalid legacy session header … malformed fields on every launch, leaving the sidebar empty.
Impact
Any user with one corrupted legacy session file (crash/kill mid-write, or test pollution from pre-isolation dev runs) loses the session list and onboarding snapshot permanently, with no recovery path short of finding and deleting the file by hand.
Direction (not prescriptive)
Keep the atomic transaction, but quarantine-and-report undecodable files: skip them, name them in an actionable error or diagnostics surface, and let the rest of the catalog import. The renderer surface for that report is a product decision.
Fixed by #1426 — malformed legacy headers are skipped (not tombstoned) so one corrupt session.jsonl no longer breaks sessions:list/onboarding; the reported turn_state first-record case is covered by tests. The diagnostics-surface part of the issue direction is left as a separate product decision.
Activity
Astro-Han commentedon Jul 24, 2026
Fixed by #1426 — malformed legacy headers are skipped (not tombstoned) so one corrupt
session.jsonlno longer breakssessions:list/onboarding; the reportedturn_statefirst-record case is covered by tests. The diagnostics-surface part of the issue direction is left as a separate product decision.