fix(files): rescan workspace from refresh actions - #7358
ralphsmith80 wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cea3826. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces a new RPC endpoint You can customize Macroscope's approvability policy. Learn more. |
|
Not sure if this is a real issue, but my agent got crazy opening PRs so closing for now. |

What this does
Refresh files now triggers a real server-side workspace index rescan before the clients reload the listing. Files created, renamed, moved, or deleted outside T3 become visible from the existing refresh controls on web, desktop, iOS, and Android, including remote environments.
Fixes #6452.
Verification
Intentional decisions
Normal list reads keep the cached index for performance. Only explicit refresh performs a scan. Repeated refreshes for the same environment and workspace share one in-flight scan. If a scan fails, the existing server service invalidates the cache so the follow-up read rebuilds it.
Generated with GPT-5.6 in the Codex harness through T3 Code.
Note
Low Risk
Scoped to explicit refresh UX and read-path RPC; list caching behavior for normal reads is unchanged, with a focused server test for rescan-after-cache.
Overview
File refresh no longer only re-fetches the cached listing—it triggers a server-side workspace index rescan first, so files changed outside T3 show up when users hit existing refresh controls on web and mobile.
A new
projects.refreshEntriesRPC wires throughWorkspaceEntries.refresh, with read-scope auth. The client adds arefreshEntriescommand (single-flight per environment +cwd) that invalidateslistEntriesafter a successful scan; normal list reads stay cached for performance.Web
useProjectEntriesQueryand mobileuseProjectEntriesRefreshcall that command and keep the file tree in a pending state until the scan finishes, replacing prior local query-atom refresh behavior.Reviewed by Cursor Bugbot for commit b6f120f. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
projects.refreshEntriesRPC to rescan workspace from refresh actionsprojects.refreshEntriesWebSocket RPC (defined in rpc.ts) that triggers a server-side rescan of workspace directory entries.refreshEntriescommand in projectCommands.ts with single-flight concurrency keyed by[environmentId, cwd]; on success, it invalidates thelistEntriesquery cache.useProjectEntriesRefreshhook that tracksisRefreshingstate and ignores stale completions whenenvironmentIdorcwdchange.useProjectEntriesQueryon web to use the same command-based refresh instead ofuseAtomRefresh.Macroscope summarized b6f120f.