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
[FEATURE]: Add unarchive/restore for archived sessions #24153
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem: Archiving a session is currently a one-way operation. Once archived, sessions disappear from the sidebar and the only place they're visible is dimmed in the command palette file picker. There's no way to restore them without directly hitting the API.
Add an unarchive action that restores an archived session to active status and navigates to it. The backend already supports this — UpdatedTime accepts archived: null — it just needs UI wiring.
Entry points (Web app):
Command palette: "Unarchive session" command
Command palette file picker: action on dimmed archived sessions (the one place they're already visible)
Session dropdown menu: show "Unarchive" instead of "Archive" when viewing an archived session by URL
Keyboard shortcut via command palette
Entry points (TUI):
Session list dialog: new keybind to archive/unarchive toggle
Behavior: Unarchiving restores the session to its original workspace grouping and navigates to it.
Scope of changes:
PATCH endpoint validation: accept null for time.archived (~1 line)
unarchiveSession() function + command palette entry in layout.tsx
Event reducer: handle un-archive events in reactive store
File picker: unarchive action on archived session rows
This feature is missing in the opencode desktop to bring back archived sessions, today I spent half hour fixing this to access and important session i mistakenly archived in desktop app.
The desktop app has a poor design in this regard because it does not ask for confirmation of arching. It must ask are you sure to do this??
Reacted by SmB, aleksandr-openlab and fractalawareness
I looked into this and the interesting part is that it isn't only missing UI — the clear path is broken in two places, so wiring up an "Unarchive" button alone returns HTTP 200 and does nothing. That's probably worth knowing before anyone else picks this up.
1. packages/core/src/session/projector.ts — time_archived: info.time.archived passes undefined when the timestamp is cleared, and Drizzle omits undefined keys from .set(). That means "leave this column alone", not "set NULL", so the row keeps its old archived value.
2. The session update handler — the guard is if (ctx.payload.time?.archived !== undefined). A client clearing the field sends {"time":{}}, because JSON.stringify drops undefined-valued properties, so the guard short-circuits and setArchived is never reached.
I've put a fix up as a draft: #43919. It fixes both, adds the restore action (dropdown, command, and ctrl+a in the TUI), and makes archived sessions findable via palette search grouped under "Archived" — otherwise the restore action is unreachable, since you can't select a session you can't see. That last part is what #13463 asked for and what the review feedback on #24154 was pointing at.
Since packages/desktop mounts AppInterface from @opencode-ai/app, this also covers the desktop app, which is what @Mehdi-afs, @SharkDriver and @binatheis were asking about here.
@rekram1-node — I see this is assigned to you, so I don't want to cut across your work. Happy to have the PR closed if you've already got an approach in flight; I mainly wanted the two bugs written down somewhere visible. If it's useful as-is I'll mark it ready for review. I've deliberately left the sidebar "Archived" section out of scope — archived rows are stripped at three separate store layers before the sidebar sees them, and relaxing that also affects sessionTotal/hasMore accounting, so it seemed better as its own change.
One separate thing several people raised above: archiving has no confirmation step, which is how most of you got here. That's arguably the actual bug and it's independent of restore — worth a separate issue if there isn't one.
To be clear for anyone waiting on desktop: #47848 on its own doesn't add a button - it makes unarchive work at all, which was the blocker. The UI is the second one.
Activity
github-actions commentedon Apr 24, 2026
This issue might be a duplicate of existing issues. Please check:
For the TUI keybind aspect mentioned in this issue, please also check our pinned keybinds documentation: #4997
Mehdi-afs commentedon May 7, 2026
This feature is missing in the opencode desktop to bring back archived sessions, today I spent half hour fixing this to access and important session i mistakenly archived in desktop app.
The desktop app has a poor design in this regard because it does not ask for confirmation of arching. It must ask are you sure to do this??
sergioatp commentedon May 15, 2026
I'm stressing with this too. Sometimes we archive because we double-click the mouse, this needs to be fixed, man.
SharkDriver commentedon May 17, 2026
Please add "unarchive" to desktop. Please!
The-Ai-DevOps commentedon May 19, 2026
+1
sorasoras commentedon Jun 9, 2026
without this feature, The archive feature should have been disable
aleksandr-openlab commentedon Jul 28, 2026
feat(app): Archived view + restore action (TKT-314)
binatheis commentedon Aug 17, 2026
Also for Desktop please. Is UX nightmare!
alohaninja commentedon Aug 21, 2026
I looked into this and the interesting part is that it isn't only missing UI — the clear path is broken in two places, so wiring up an "Unarchive" button alone returns HTTP 200 and does nothing. That's probably worth knowing before anyone else picks this up.
1.
packages/core/src/session/projector.ts—time_archived: info.time.archivedpassesundefinedwhen the timestamp is cleared, and Drizzle omitsundefinedkeys from.set(). That means "leave this column alone", not "set NULL", so the row keeps its old archived value.2. The session update handler — the guard is
if (ctx.payload.time?.archived !== undefined). A client clearing the field sends{"time":{}}, becauseJSON.stringifydrops undefined-valued properties, so the guard short-circuits andsetArchivedis never reached.I've put a fix up as a draft: #43919. It fixes both, adds the restore action (dropdown, command, and
ctrl+ain the TUI), and makes archived sessions findable via palette search grouped under "Archived" — otherwise the restore action is unreachable, since you can't select a session you can't see. That last part is what #13463 asked for and what the review feedback on #24154 was pointing at.Since
packages/desktopmountsAppInterfacefrom@opencode-ai/app, this also covers the desktop app, which is what @Mehdi-afs, @SharkDriver and @binatheis were asking about here.@rekram1-node — I see this is assigned to you, so I don't want to cut across your work. Happy to have the PR closed if you've already got an approach in flight; I mainly wanted the two bugs written down somewhere visible. If it's useful as-is I'll mark it ready for review. I've deliberately left the sidebar "Archived" section out of scope — archived rows are stripped at three separate store layers before the sidebar sees them, and relaxing that also affects
sessionTotal/hasMoreaccounting, so it seemed better as its own change.One separate thing several people raised above: archiving has no confirmation step, which is how most of you got here. That's arguably the actual bug and it's independent of restore — worth a separate issue if there isn't one.
alohaninja commentedon Sep 8, 2026
Follow-up on my note above - the fix is up.
Split in two, since small PRs move much faster here:
ctrl+aTo be clear for anyone waiting on desktop: #47848 on its own doesn't add a button - it makes unarchive work at all, which was the blocker. The UI is the second one.
neriousy commentedon Oct 1, 2026
Closing as a duplicate of #6680, which tracks viewing and restoring archived sessions. Please add your use case and 👍 there.