Skip to content

Desktop File Tree and Review use original session directory after agent moves work into a worktree #24954

@rubencu

Description

@rubencu

Description

In the Desktop app, if a session starts in the repo root and the agent later creates/uses a separate git worktree for the task, the File Tree and Review views keep using the original session directory.

The visible result is confusing:

  • File Tree All Files / Changes do not show the files changed in the worktree.
  • Review keeps showing changes from the original repo root, or shows 0 changes, even though the agent changed files in the worktree.
  • Switching sessions can appear to refresh the UI, but the underlying diff source is still the original root directory.

This seems related to the session retaining its initial session.directory. The agent can do real work in another worktree via shell/tool commands, but the UI still scopes file/diff data to the original session directory.

Related prior discussion:

Plugins

None relevant.

OpenCode version

Desktop app. Also reproduced while testing from dev / origin/dev around 9fbeafb63ed749077e9cc55a47df3629b5b7adc3.

Steps to reproduce

  1. Open the Desktop app for a git repository from the repo root.
  2. Start a session while the session/workspace directory is the repo root.
  3. In that session, ask the agent to create a separate git worktree from the default development branch, for example from origin/dev, and make changes there.
  4. Open the File Tree All Files / Changes views and the Review tab for that session.
  5. Switch between sessions that worked in different worktrees.

Expected behavior

The File Tree and Review views should reflect the directory/worktree where the selected session actually made changes, or the app should make it explicit that moving a running session's effective workdir into another worktree is unsupported.

Actual behavior

The File Tree and Review views remain scoped to the original session directory. Changes made in the worktree are not shown for that session, while changes from the original repo root can continue to appear.

Screenshot and/or share link

Not available.

Operating System

macOS 26.3.1

Terminal

Desktop app / zsh when running local dev builds.

Metadata

Metadata

Assignees

Labels

webRelates to opencode on web / desktop

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions