You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4ad8aa3
Browse filesBrowse the repository at this point in the historyBrowse files
fix(files): reload the file tree while a run writes and on window focus (#1144) (#1153)
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>
Copy file name to clipboardExpand all lines: docs/agents/files-and-access.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,9 @@
17
17
- The files tab head's eye switch, "Show ignored files" (a toggle with `aria-pressed`, off by default, kept per browser in `lib/sidebar-prefs.ts` and restored after hydration like the tab), lists with `type=list&hidden=1`: the Git-ignored and name-list entries come back with `hidden: "ignored" | "excluded"` (`getFileTreeHiddenReasons()`), and the tree dims them with the reason in the name's tooltip. `.git` and `.DS_Store` stay out either way; dotfiles get no rule of their own. Inside a hidden directory Git has no answer (nothing below it is tracked), so its entries inherit the parent's reason on the client. Toggling reloads open directories and marks collapsed ones for reload. Search and `@` mentions do not follow the switch.
18
18
- A directory link (symlink or Windows junction) is authorized by where it resolves (#748): one inside a root that leads outside every root is listed but refused beneath it. Never authorize the lexical path: a link committed to a cloned repo would expose `~/.ssh` or `/`. The listing reports its target as `outsideLinkTarget`; the explorer's "Allow browsing" posts `?type=allow-link` with it. `checkLinkedDirectoryApproval()` (`lib/linked-directory.ts`) requires the link's directory to be inside the roots after resolving links and the link to still point where the operator was shown; the route then `allowFileRoot()`s the target until the server restarts — the grant `/api/cwd/validate` gives any directory, so it widens nothing a caller could not already reach. A target that contains a root or the home folder (`/`, `~`, a parent of the project) is listed with `outsideLinkEncloses`, and the explorer confirms before allowing it.
19
19
20
+
## When the file tree reloads
21
+
- No watcher and no polling: the tree (root, every open folder, git status) reloads when a run ends, at most once a second while a run's tools finish (any top-level tool but the read-only preset's `read`/`grep`/`find`/`ls`: AppShell's `handleToolEnd`, from `useAgentSession`'s `onToolEnd`), when the window gets focus (changes made in an editor or terminal), after an upload, and on the refresh button (#1144). A reload keeps the open folders and shows no spinner.
22
+
20
23
## Uploads and chat drops
21
24
- The explorer's Upload button and a non-image file dropped onto the chat share one client, `uploadFiles()` (`lib/file-upload-client.ts`), and the one endpoint, `POST /api/files/<cwd>?type=upload`; never add a second write path for drops. The explorer asks `upload-check` first and lets the user replace or skip; a chat drop goes straight to `conflict=skip`, so it never replaces a file. It then inserts `@name` for every file the response lists as uploaded *or* skipped (a skipped name is a file already there, often the very file dragged out of the project) and says in a notice that the mention points to the existing file.
22
25
- Dropped images still attach to the prompt. Folders are left out with a notice: the endpoint writes flat file names only (`validateUploadFileNames()`), and the browser cannot tell where a dropped file lives on disk, so the copy always lands in the cwd root.
0 commit comments