Skip to content

bug: GUI loses worktree-linked sessions; sessions move to Inbox and disappear from Code view #295

Description

@marcinkardas

Bug: Worktree-linked GUI sessions can detach into Inbox and disappear from Code view

Operating system(s)

  • Windows
  • macOS
  • Linux

What happened?

There seems to be a bug where GUI sessions can lose their association with a worktree/code context.

A session that was started from the Code tab inside a new worktree can disappear from that worktree and become accessible only through Inbox. After that, it no longer appears in the Code tab, does not show up under the worktree, and cannot be restored or switched back into the original worktree context.

This makes the session effectively detached from the code workflow, even though it was originally created from a worktree.

What happened

I started a new conversation from a new worktree in the GUI.

During the conversation, I switched to the Chat tab. I had some trouble switching the model/provider, but after it eventually worked, I sent a test message.

Then I tried to return to the Code tab to check the response in the worktree context.

At that point, I could no longer access the session from the Code tab. The session was only visible through Inbox.

The session no longer appeared under the worktree, and I had no way to restore or reattach it to the worktree.

Actual behavior

  • A worktree-created session becomes detached from the worktree.
  • The session moves or appears only in Inbox.
  • The session disappears from the worktree in the Code tab.
  • The worktree/session is not visible in Past sessions.
  • I cannot switch back to that worktree/session.
  • It behaves as if the original worktree-linked conversation never existed.
  • There is no visible way to restore, reattach, or move the session back into the worktree/code context.

Expected behavior

A session started from a worktree in the Code tab should remain associated with that worktree, even if I temporarily switch to Chat, change model/provider, or navigate using the sidebar.

At minimum, the GUI should provide a way to:

  • return to the original worktree/session from the Code tab,
  • reattach an Inbox session to a worktree,
  • show detached worktree sessions in Past sessions,
  • or warn before detaching a session from its worktree context.

Steps to reproduce

This happened more than once, but not always in the same way.

Case 1

  1. Open the GUI.
  2. Create or switch to a new worktree in the Code tab.
  3. Start a new conversation in that worktree.
  4. Switch to the Chat tab during the conversation.
  5. Change the model/provider.
  6. Send a message.
  7. Try to return to the Code tab.
  8. The session is no longer available in the worktree context.
  9. The session is accessible only from Inbox.

Case 2

  1. Start a worktree-linked session in the GUI.
  2. Click one of the sidebar icons during the session.
  3. The session becomes detached in the same way.
  4. It disappears from the worktree/Code view and is only visible in Inbox.

Impact

This is disruptive because worktree-linked coding sessions can effectively be lost from the code workflow.

The conversation still exists in Inbox, but it is no longer usable as a worktree/code session. I cannot switch to the worktree from that session, cannot find it in Past sessions, and cannot continue the original code workflow from the Code tab.

Agent implementation prompt

This seems related to navigation/state management in the GUI. The session probably still exists, but its metadata linking it to the worktree/code context appears to be lost or not restored when switching between Code, Chat, Inbox, and sidebar navigation.

A recovery option would be useful, for example:

  • “Move session to worktree”
  • “Reattach to current worktree”
  • “Open in Code context”
  • “Show detached sessions”
  • or a worktree/session repair command.

App version or commit

0.1.66-dev

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions