Skip to content

Desktop: file tree shows a stale directory snapshot (Reload does not refresh it) #57099

Open

Description

@ZicolasJac

Description

Desktop: file tree shows a stale directory snapshot (Reload does not refresh it)

Environment

  • OpenCode Desktop 2.0.32 (Windows 11, packaged build)
  • Workspace: an ordinary Git repository (verified with git status)

Summary

Directories created after the desktop window has been open never appear in the right-side file tree ("Changes" and "All files" tabs), even after triggering Reload (Ctrl+R / View → Reload). Opening a new window (Ctrl+Shift+N) shows the complete tree immediately.

The server data is correct — GET /api/fs/list returns every entry, including the ones missing from the UI.

Steps to reproduce

  1. Open a workspace in Desktop and leave the window open (in our case: the app ran for ~2 days).
  2. Create a new top-level directory from a terminal or via agent tools (e.g. .worktrees/, .idea/, .build/, .cbb/).
  3. Look at the right-side file tree → the new directory does not appear.
  4. Press Ctrl+R (View → Reload) → still absent.
  5. Open a new window (Ctrl+Shift+N) → the directory appears immediately.

Evidence

Server sees the entries

GET /api/fs/list?location[directory]=D:\ai-workspace\jsygt-openapi-aiws
children(16):
  [directory] .build\
  [directory] .cbb\
  [directory] .codespace\
  [directory] .git\
  [directory] .idea\
  [directory] .opencode\
  [directory] .qoder\
  [directory] .workbuddy\
  [directory] .worktrees\
  [directory] deploy\
  [directory] docs\
  [directory] openspec\
  [file] .gitignore
  [file] AGENTS.md
  [file] CBB-WORKSPACE.json
  [file] README.md

The UI in the already-open window showed only 12 of those 16 entries (missing .build, .cbb, .idea, .worktrees).

Same workspace, two windows

  • Old window: missing directories (stale snapshot).
  • New window (Ctrl+Shift+N): all directories present.

This isolates the problem to renderer state, not the server or the filesystem.

No workspace filesystem watcher

Server log shows watcher subscribe only for config-ish files, and no filesystem.changed events for workspace content:

timestamp=... message="watcher subscribe" path="...\\AGENTS.md" type=file
timestamp=... message="watcher subscribe" path="...\\.git\\HEAD" type=file

No directory watcher and no filesystem.changed events for the workspace. As a consequence:

  • new files/directories are not reflected in the tree;
  • (likely related) modified file contents in the Review pane do not auto-refresh either.

Expected

  • The file tree should reflect filesystem changes (new/removed directories and files).
  • At minimum, Reload (Ctrl+R) should rebuild the complete tree state instead of keeping a stale snapshot.
  • Ideally the workspace should be watched so filesystem.changed events drive both the file tree and session review.

Notes

  • Workaround for users: open a new window (Ctrl+Shift+N) or restart the app.
  • Reproduced on Windows; the same workspace tree issue has been observed across multiple workspaces (one workspace created new dirs after the window was opened → hidden; another older workspace with all dirs pre-existing → tree complete).

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot

No response

Operating System

No response

Terminal

No response

Activity

  1. opencode-agent commented on Oct 19, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and the /api/fs/list output.

    There are two parts here:

    Two details would help:

    • After Ctrl+R in the stale window, open DevTools (View → Toggle DevTools) and look at the Network tab for the fs/list request. Does it go out, does it show (disk cache) / (memory cache), and does its response include .build, .cbb, .idea and .worktrees?
    • In the old window and the new one, is the workspace path written exactly the same, including drive-letter case and \ vs /?

    Until then, opening a new window (Ctrl+Shift+N) works around it, as you found.

  2. tattwamasii2p commented on Nov 14, 2026

    @tattwamasii2p

    Additional reproduction (Linux) — and a clue: the tree refreshes on tab switch

    Environment

    • opencode version: CLI opencode --version → v2.0.32, binary at ~/.opencode/bin/opencode
    • OS: Linux 6.8.0-138-generic, x86_64
    • Terminal: TERM=xterm-256color (TERM_PROGRAM unset)
    • Shell: /bin/bash
    • Install/channel: release install (latest)
    • Active plugins: none found in config
    • Workspace: not a git repository (no .git) — the workspace in the original issue report (this issue thread) was a git repo, so this may be a differentiating factor worth checking

    Summary

    Same stale file tree on Linux, but with an observation that I think pinpoints the cause: the tree only refreshes when the tab is switched away and back. It never picks up changes while the tab stays active, and no kind of file write makes it update.

    Steps to reproduce

    1. Open a workspace in a tab (call it tab A) and leave it active.
    2. Create a file in that workspace by any of these means:
      • the agent's own write tool (i.e. written by the IDE itself),
      • a direct write from a shell (printf ... > file),
      • an atomic rename (file.tmp → os.replace → file),
      • an append to an already-tracked log file.
    3. Verify on disk: the file exists with normal permissions (ls -la, stat).
    4. Look at the file tree in Opencode GUI: none of the new files appear. This holds both for newly created files in the workspace root and for files created inside an already-expanded subdirectory.
    5. Switch to another tab (+ tab) and switch back to tab A.
    6. The file tree now shows all of the new files.

    Actual behavior

    No automatic refresh at all — not after seconds, not after minutes, and not on any write method. Only a tab switch (i.e. a component remount) re-reads the directory.

    Expected behavior

    The file tree should pick up filesystem changes while the tab is active, or at least offer a manual refresh means (button or otherwise) (see #63715).

    Why this is useful for the investigation

    • It rules out an IN_MOVED_TO / atomic-rename hypothesis: even files written by OpenCode's own write tool are invisible, so the watcher is not missing a specific event mask — it appears to receive no events at all, consistent with workspace watcher emits no events in desktop: file tree does not refresh live; workspace watcher emits no events (Windows) #56615.
    • Since a tab switch does produce a correct tree, GET /api/fs/list presumably returns the right data (the UI simply never re-queries it) — the same conclusion the original report reached from the API side.
    • In my case I did not need to rely on a full app reload: the reliable workaround was switching tabs, which is cheaper than the new-window workaround in the OP.

    Workaround found: switch to another tab and back (re-mounts the tree component).

    This comment has been posted by Opencode AI agent, a bit edited by human ( @tattwamasii2p ) (Human writes: I didn't verify links to other issues from this report comment, so our mileage may vary --- but other points in this report comment seem to be correct).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions