Repository navigation
Description
Operating system
Linux (Debian-based, kernel 7.0.0-30-generic, AppImage build)
Orca version
v1.4.137 (X-AppImage-Version from the generated desktop entry)
Details
Short summary:
An editor tab (a PNG image preview) resurrects on every app restart / window reload. Closing the tab does not stick. The persisted session state in orca-data.json accumulates duplicated records for the same file — session restore appears to re-add a new tab record (new uuid, fresh createdAt) while leaving the previous openFilesByWorktree entries behind, so closing the visible tab only removes one of several stale records and the file reopens on the next restore.
What happened?
- A PNG file (
.scratch/armor_cuirass_8dir/cuirass_8dir_sheet_preview.pnginside a git worktree workspace) was opened as an editor tab on Aug 23. - Since then, across restarts/window reloads, the tab keeps coming back. Closing it does not persist; after the next reload it is present (and active) again.
- The file itself is never touched — mtime is still Aug 23, and no process re-opens it. The reopening comes purely from session restore.
State evidence (from ~/.config/orca/profiles/local-default/orca-data.json, single worktree key <worktreeId>::/home/damchan/project/Godot/Godot_rust.char3d):
workspaceSession.openFilesByWorktree[<key>]contains 3 identical records for the samefilePath/relativePath(differing only in editor-entity uuid).workspaceSession.unifiedTabs[<key>]contains 2 editor tab entries for the sameentityId(the PNG path), samecreatedAt(1788002466152= the moment of today's window reload),sortOrder0 and 1.workspaceSession.activeFileIdByWorktree[<key>]still points at this file (with a third, different pane uuid embedded in the id).tabGroups[<key>][0].tabOrdercontains aneditor:id for this file with yet another uuid that matches neither of the twounifiedTabsentries.
So each restore cycle seems to mint a new editor-entity uuid for the same file and append records, while close only removes the currently-rendered one. The stale openFilesByWorktree + activeFileIdByWorktree records then re-materialize the tab on the next restore.
While inspecting I also found the same pattern with a file that fails to open: a stale editor tab record for ~/.orca/keybindings.json (file does not exist on disk) persisted under the global-floating-terminal session and restored every launch.
How can we reproduce it? (best effort — this accumulated over normal use)
- Open an image file as an editor tab in a worktree workspace.
- Reload the window / restart Orca a few times with the tab open.
- Close the tab, restart Orca.
- Tab is back and active. Inspect
orca-data.json: duplicatedopenFilesByWorktreerecords and duplicatedunifiedTabseditor entries for that file.
Anything else that might help:
- Workaround that works: quit Orca fully, remove all records referencing the file from
openFilesByWorktree,unifiedTabs,tabGroups[].tabOrder, andactiveFileIdByWorktree, restart. The tab stays gone. - Suggested fixes: dedupe editor tab records by
entityIdon session restore; on tab close, purge allopenFilesByWorktree/activeFileIdByWorktreerecords for that file, not just the current editor-entity uuid; skip restoring editor records whose target file no longer exists. - Possibly related: Phantom terminal tabs survive close and are restored from persisted layout state (SSH host) #10342 (phantom terminal tabs restored from persisted layout state), [Bug]: Duplicate pi terminal tab spawned on worktree switch (session restore), even with Agent sleep off #10208 (duplicate terminal tab on worktree switch during session restore). This report is the editor-tab variant with the concrete persisted-state shape.
Activity
DamChan0 commentedon Aug 29, 2026
Sharing the workaround I'm running locally until this is fixed, in case it helps others (or serves as a reference for the restore-time fix).
Approach
Since the duplicated/stale records live entirely in
orca-data.json, a cleaner script can repair the persisted session offline:openFilesByWorktreerecord perfilePathand the firstunifiedTabseditor entry perentityId, drop the rest.~/.orca/keybindings.jsontab I found underglobal-floating-terminal).tabGroups[].tabOrder, and deleteactiveFileIdByWorktreeentries whose percent-decoded path no longer exists.--applyrefuses to write while Orca is running (otherwise Orca overwrites the cleaned file with its in-memory state on exit), and backs up the original before writing.To make it self-healing I also wrapped the launcher so the cleaner runs before every start — duplicates may still accumulate during a session, but they never survive a restart.
Essentially the same logic would work as an upstream fix if applied at session-restore time: dedupe by
entityId, skip records whose file is gone, and purge all records for a file when its tab is closed (not just the current editor-entity uuid).orca-tab-cleanLaunch wrapper (Linux AppImage)
Then point the desktop entry at the wrapper (
Exec=~/.local/bin/orca-launch %U).Result on my affected state
Dry run against the state described in the report:
After quitting Orca, applying, and restarting, the phantom tab no longer resurrects.
Caveats: field names are from v1.4.137's
orca-data.jsonschema and may drift across versions;mobileClientTabSelectionsByDeviceIdand other tab-adjacent keys are intentionally untouched.OrcaWin commentedon Aug 29, 2026
Related editor-tab close/restore reports (not a match for closing this):
This one is specifically session restore minting duplicate
openFilesByWorktree/unifiedTabseditor records so a close does not stick.Reported on v1.4.137; current GitHub release is v1.4.192. I could not find a later merge that dedupes those editor records, so leaving open. Worth retrying on a current build if you can.
fix(editor): address review findings on the editor record leak fix
fix(editor): heal duplicate and mis-owned editor records at restore
test(tools): add a background repro for duplicate editor records in a…
fix(editor): address review findings on the editor record heal
nwparker commentedon Sep 27, 2026
Closing as fixed by merged #17370. That change reproduces the duplicate persisted editor records from this report and repairs the same-owner/file records and stale tab references during restore; its regression test verifies that a closed editor stays closed after a second hydration. No later report of this failure is attached here.
fix(session): deduplicate editor records during restore (stablyai#17370)