Skip to content

One invalid field in one tab record wipes the entire persisted workspace session at startup #12918

Closed

Description

@robertnisipeanu

Summary

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.

Orca 1.4.174, macOS.

Activity

  1. AmethystLiang commented on Aug 6, 2026

    @AmethystLiang
    Contributor

    thanks for reporting. looking into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions