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
One invalid field in one tab record wipes the entire persisted workspace session at startup #12918
A single invalid field in one record of the persisted workspace session makes startup validation discard the entire local workspaceSession — every worktree's tabs, tab groups, layouts, and sleeping-agent records — and replace it with defaults.
Details
parseWorkspaceSession (src/shared/workspace-session-schema.ts) zod-validates the whole session and returns ok: false on the first issue; both call sites in src/main/persistence.ts respond by logging Corrupt workspace session, using defaults and dropping the payload wholesale. The same applies per host partition.
Observed concretely: one terminal tab record was persisted with only 7 of its fields (no customTitle/color/createdAt/defaultTitle — a snapshot-projected record that reached the local store). At every subsequent launch the validator rejected tabsByWorktree.<worktree>.<i>.customTitle: Invalid input and reset the session, wiping ~20 worktrees' tabs and 11 sleeping-agent resume records each time until the record was repaired by hand.
The schema file itself already documents this blast-radius hazard for one field (lastVisitedAtByWorktreeId parses leniently, with a comment explaining that a strict rejection "would cause parseWorkspaceSession to fall back to defaults for the ENTIRE session ... a blast radius far larger"). The same reasoning applies to every entry-shaped field.
Expected
Drop the individual corrupt entry (one tab, one map value) and keep the rest of the session. Falling back to defaults should be reserved for payloads that cannot be salvaged at all.
Activity
AmethystLiang commentedon Aug 6, 2026
thanks for reporting. looking into it