Skip to content

feat(app): view archived sessions & unarchive#15250

Open
alexyaroshuk wants to merge 16 commits intoanomalyco:devfrom
alexyaroshuk:feat/unarchive
Open

feat(app): view archived sessions & unarchive#15250
alexyaroshuk wants to merge 16 commits intoanomalyco:devfrom
alexyaroshuk:feat/unarchive

Conversation

@alexyaroshuk
Copy link
Copy Markdown
Contributor

@alexyaroshuk alexyaroshuk commented Feb 26, 2026

Issue for this PR

Closes #6680, #12393

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a new "Archived Sessions" section in Settings that allows users to:

  • View all archived sessions across projects (or filtered to current project)
  • Restore (unarchive) any archived session back to the sidebar

How did you verify your code works?

  1. bun test
  2. manual test:
  • able to view archived sessions for current project
  • able to view archived sessions for all projects
  • when a session is unarchived, the archived session list is rebuilt, and the session list in the sidebar-items is rebuilt as well (we now see this session as if it was not archived)
  • when a session is archived, the archived session list is rebuilt

Screenshots / recordings

image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Comparison to #6769

This pr solves the same underlying issue as 6769, but differently:
Compared to PR #6769, I've placed the archived sessions feature in Settings/ Data(new tab) instead of the sidebar dropdown, added a multi-project filter (All/Current project), and used a simpler list view without the built-in search. The backend changes are in routes/session.ts instead of server.ts.

Files changed

Files Changes
packages/app/src/components/settings-archive.tsx New component to view/restore archived sessions
packages/app/src/components/dialog-settings.tsx Added Archived Sessions tab in Data section
packages/opencode/src/server/routes/session.ts Added archived filter param, nullable archived for unarchive
packages/opencode/src/session/index.ts Added archived filter in list query, setArchived accepts null
packages/app/src/i18n/*.ts Added related keys

@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate PRs Found

  1. PR Feat/view archived sessions #6769: Feat/view archived sessions

  2. PR feat: add session archive/unarchive support to TUI #13961: feat: add session archive/unarchive support to TUI

  3. PR feat(app): temporarily disable archive session button and command #12020: feat(app): temporarily disable archive session button and command

@alexyaroshuk
Copy link
Copy Markdown
Contributor Author

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate PRs Found

  1. PR Feat/view archived sessions #6769: Feat/view archived sessions

  2. PR feat: add session archive/unarchive support to TUI #13961: feat: add session archive/unarchive support to TUI

  3. PR feat(app): temporarily disable archive session button and command #12020: feat(app): temporarily disable archive session button and command

  1. addressed above, slightly different implementation - not a duplicate
  2. tui change, not quite related to desktop
  3. 12020 is a bandaid change, unrelated

@alexyaroshuk alexyaroshuk marked this pull request as ready for review February 26, 2026 16:44
@alexyaroshuk
Copy link
Copy Markdown
Contributor Author

@adamdotdevin Could this get a review? Anything I should change?

@Shaik121
Copy link
Copy Markdown

I just experienced this exact issue - I archived a session by mistake and couldn't find any way to unarchive it in the UI. The session data was still in the SQLite database, but there was no way to restore it through the interface.

This PR would have saved my session! Really glad to see this fix coming. The implementation looks clean - having the archived sessions in Settings > Data makes perfect sense.

Tested the branch locally and the unarchive functionality works as expected. This solves issues #6680 and #12393 perfectly.

🚀 Please prioritize this merge!

@Shaik121
Copy link
Copy Markdown

Shaik121 commented Apr 1, 2026

Update: I've also created a complementary PR with tests for the archive/unarchive functionality:

✅ PR #1 (from my fork): Shaik121#1

The tests verify:

  • Session.setArchived works correctly for both archive and unarchive
  • Session.listGlobal with archived filter returns correct sessions

All tests pass (2 pass, 0 fail).

Could the maintainers please review and merge PR #15250? This feature is critical for users who accidentally archive sessions - there's currently no way to unarchive them in the UI. The tests confirm the backend functionality works as expected.

cc @adamdotdevin

@B67687
Copy link
Copy Markdown

B67687 commented Apr 14, 2026

Finding from Rebase Attempt

I tried rebasing PR #15250 onto current dev but ran into extensive conflicts that need manual resolution:

Conflicts Found (18 files):

  • Core backend: session.ts, index.ts - API changes for archive/unarchive
  • i18n: 14 language files - new keys added in different order

Key Conflict Example (session.ts):

```typescript
// Dev (HEAD):
if (updates.time?.archived !== undefined) {
await Session.setArchived({ sessionID, time: updates.time.archived })
}

// Their version handles unarchive (archived: null):
if (updates.time !== undefined && "archived" in updates.time) {
session = await Session.setArchived({ sessionID, time: updates.time.archived ?? undefined })
}
```

Recommendation:

This PR needs a careful manual rebase by a maintainer or contributor with time for the 18-file merge. The test failures in CI (transform.test.ts lines 1819, 1871) are PRE-EXISTING issues unrelated to this PR - they're failing because new providers were added to dev after this PR was made.

Test Failure Investigation:

  • Expected providers: subset
  • Got extra: alibaba, copilot, openaiCompatible, openrouter
  • These are NEW providers added to dev after PR creation
  • NOT caused by archive feature changes

Thanks for the feature! Looking forward to this landing.

@Shaik121
Copy link
Copy Markdown

Test Failure Analysis

I analyzed the failing CI tests - they appear to be pre-existing issues unrelated to this PR:

Evidence

  1. upstream/dev branch (current main): 4 failing tests
  2. This PR (feat(app): view archived sessions & unarchive #15250): Tests fail due to dependency issues in the branch

The failures are:

  • Plugin loading errors (, )
  • Effect package version conflicts
  • These exist in too, not caused by archive code

Recommendation

Merge this PR - The archive/unarchive functionality in is correct:

  • It adds Settings > Data > Archived Sessions UI
  • Adds unarchive (restore) button for each session
  • The backend Session.setArchived already works (verified by tests in PR feat: compact and other improvements #1)

The test failures are a separate issue that needs fixing in the CI pipeline, not a reason to block this feature.

cc @adamdotdevin @B67687 - please merge this PR. The feature is ready and tested!

@B67687
Copy link
Copy Markdown

B67687 commented Apr 14, 2026

Hey @uriva! I'm working on the archive feature. I see this PR has the original GUI implementation. I attempted to rebase it in #22400 but ran into massive i18n conflicts across 14 locale files.

I just created a fresh, cleaner rebuild in #22406 that:

  • Uses only the GUI component code from this PR (settings-archive.tsx)
  • Adds just the new i18n keys needed (6 keys in en.ts)
  • Works with the existing backend support already in dev

This PR (#15250) can remain as the canonical reference. I'll close the old rebase PR #22400 as duplicate.

Let me know if you'd prefer to continue from here or if you want to move forward with #22406 - happy to help either way!

@B67687
Copy link
Copy Markdown

B67687 commented Apr 14, 2026

Feature implementation moved to PR #22406. Please review there.

@uriva
Copy link
Copy Markdown

uriva commented Apr 14, 2026

@B67687 I'm not sure how can I help, I submitted a PR
you probably want to get the opencode people to respond
I've yet to be able to do this on any of my PRs and decided to stop sending them

@Shaik121
Copy link
Copy Markdown

Quick Fix Option

I can help resolve the conflicts if you'd like. The PR has:

Would it help to:

  1. Close feat: session archive/unarchive GUI support (rebase of #15250) #22400 and feat: add session archive/unarchive GUI support (v2) #22406 as suggested
  2. Keep feat(app): view archived sessions & unarchive #15250 as the canonical PR
  3. Just resolve the merge conflicts

Let me know if you need help with the rebase - I can assist!

@B67687
Copy link
Copy Markdown

B67687 commented Apr 15, 2026

Yes please! That would be great. The GUI work adds Settings > Archived Sessions tab (in my fork PR B67687#2). The TUI part is already in upstream (#22372). Let's get this feature merged!

@B67687
Copy link
Copy Markdown

B67687 commented Apr 15, 2026

Update: Created a clean minimal PR with only the GUI changes: B67687#3

Closed old fork PRs #1 and #2 as duplicates - they contained too much mergedev bloat. The new PR has just the 3 archive-specific files needed.

This PR (15250) should now merge cleanly with just the GUI work!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: view archived sessions on desktop

6 participants