Skip to content

fix(files): reload the file tree while a run writes and on window focus (#1144) - #1153

Merged
agegr merged 1 commit into
mainfrom
fix/file-tree-live-refresh
Oct 9, 2026
Merged

agegr merged 1 commit into
mainfrom
fix/file-tree-live-refresh

Conversation

@agegr

@agegr agegr commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Fixes #1144.

Problem

The file tree reloaded only when a run ended or when you pressed refresh. Files the agent wrote during a long run, or files changed in an editor or terminal, stayed hidden until then.

Change

  • useAgentSession reports each top-level tool_execution_end via a new onToolEnd option. AppShell then schedules one tree reload at most once a second, skipping the read-only preset's read/grep/find/ls. It uses the existing explorerRefreshKey, so the git status and an open diff refresh too.
  • FileExplorer reloads when the window gets focus, which covers changes made outside Pi Web.
  • No fs watcher and no polling. A reload keeps the open folders and shows no spinner, as the refresh button already did.
  • Note in docs/agents/files-and-access.md.

Checked

  • tsc --noEmit, eslint on the touched files, node --test hooks components (905 pass).
  • Isolated dev server (port 30241, scratch agent dir) with headless Chrome: I created a file in the project from outside. It was not listed before focus (count 0) and was listed after a window focus (count 1).
  • Not checked: the tool-end path during a real model run (no model in the scratch setup).

🤖 Generated with Claude Code

…us (#1144)

The tree reloaded only when a run ended or on the refresh button, so files
the agent wrote mid-run, or changed in an editor or terminal, stayed hidden.
Now any top-level tool but read/grep/find/ls schedules a reload (at most one
a second), and the explorer reloads when the window gets focus. No watcher,
no polling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@agegr agegr mentioned this pull request Oct 9, 2026
@agegr
agegr merged commit 4ad8aa3 into main Oct 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File list hot refresh

1 participant