[PR #12798] fix(desktop): navigate to root session after archiving instead of subagent #14376

Open
opened 2026-02-16 18:19:10 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12798

State: open
Merged: No


Summary

Fixes #11222

After archiving the current session with Ctrl+Shift+Backspace, the app would sometimes navigate to a subagent/child session instead of the next root session. This happened because both archiveSession functions (in layout.tsx and session.tsx) selected the next session from the unfiltered session list, which includes subagent sessions (those with parentID set).

Changes

  • packages/app/src/pages/layout.tsx: Filter store.session to exclude subagent and archived sessions before selecting the next session to navigate to
  • packages/app/src/pages/session.tsx: Same fix applied to the archiveSession function here

The deleteSession function in session.tsx already applied this filter correctly — this PR makes archiveSession consistent with that behavior.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12798 **State:** open **Merged:** No --- ## Summary Fixes #11222 After archiving the current session with `Ctrl+Shift+Backspace`, the app would sometimes navigate to a subagent/child session instead of the next root session. This happened because both `archiveSession` functions (in `layout.tsx` and `session.tsx`) selected the next session from the unfiltered session list, which includes subagent sessions (those with `parentID` set). ## Changes - **`packages/app/src/pages/layout.tsx`**: Filter `store.session` to exclude subagent and archived sessions before selecting the next session to navigate to - **`packages/app/src/pages/session.tsx`**: Same fix applied to the `archiveSession` function here The `deleteSession` function in `session.tsx` already applied this filter correctly — this PR makes `archiveSession` consistent with that behavior.
yindo added the pull-request label 2026-02-16 18:19:10 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14376