Skip to content

Fix remote file tree not updating with local file changes#10514

Merged
kevinyang372 merged 2 commits into
masterfrom
kevin/initialize-repo-metadata-model-with-incremental-updates
May 8, 2026
Merged

Fix remote file tree not updating with local file changes#10514
kevinyang372 merged 2 commits into
masterfrom
kevin/initialize-repo-metadata-model-with-incremental-updates

Conversation

@kevinyang372
Copy link
Copy Markdown
Member

@kevinyang372 kevinyang372 commented May 8, 2026

Problem

The file tree in remote SSH sessions does not update when files change on the server. Cd-ing in and out of the directory restores the correct state.

Root Cause

The daemon process creates its RepoMetadataModel with emit_incremental_updates = false.

initialize_app() calls RepoMetadataModel::new(ctx) for all launch modes, including RemoteServerDaemon. The new() constructor leaves emit_incremental_updates disabled on the local sub-model. When the file system watcher detects changes and apply_file_tree_mutations runs, it returns None instead of a RepoMetadataUpdate, so IncrementalUpdateReady is never emitted.

The ServerModel subscribes to IncrementalUpdateReady events to push them to clients, but they never arrive.

Cd-ing fixes the issue because NavigatedToDirectory triggers a full snapshot push (via RepositoryUpdated or directly in the handler), which replaces the entire client-side tree.

This has been broken since the initial commit — the new_with_incremental_updates constructor existed but was never wired into the daemon initialization path.

Fix

In initialize_app(), use RepoMetadataModel::new_with_incremental_updates(ctx) when the launch mode is RemoteServerDaemon.


Oz conversation | Plan

@cla-bot cla-bot Bot added the cla-signed label May 8, 2026
Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kevinyang372 kevinyang372 changed the title Initialize metadata model with incremental updates Fix remote file tree not updating with local file changes May 8, 2026
@kevinyang372 kevinyang372 marked this pull request as ready for review May 8, 2026 21:59
@kevinyang372 kevinyang372 requested a review from moirahuang May 8, 2026 21:59
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 8, 2026

@kevinyang372

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR enables incremental repository metadata updates for the remote server daemon by constructing RepoMetadataModel with incremental emission enabled only in RemoteServerDaemon launch mode.

Concerns

  • Manual testing evidence is missing for a user-visible remote file-tree behavior change. Please include screenshots or a screen recording showing a remote SSH file-tree update after a server-side file change, or justify why manual testing is not possible.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@kevinyang372 kevinyang372 merged commit 1711d59 into master May 8, 2026
43 of 44 checks passed
@kevinyang372 kevinyang372 deleted the kevin/initialize-repo-metadata-model-with-incremental-updates branch May 8, 2026 22:20
trungtai1805 pushed a commit to trungtai1805/warp that referenced this pull request May 9, 2026
…#10514)

## Problem
The file tree in remote SSH sessions does not update when files change
on the server. Cd-ing in and out of the directory restores the correct
state.

## Root Cause
The daemon process creates its `RepoMetadataModel` with
`emit_incremental_updates = false`.

`initialize_app()` calls `RepoMetadataModel::new(ctx)` for **all**
launch modes, including `RemoteServerDaemon`. The `new()` constructor
leaves `emit_incremental_updates` disabled on the local sub-model. When
the file system watcher detects changes and `apply_file_tree_mutations`
runs, it returns `None` instead of a `RepoMetadataUpdate`, so
`IncrementalUpdateReady` is never emitted.

The `ServerModel` subscribes to `IncrementalUpdateReady` events to push
them to clients, but they never arrive.

Cd-ing fixes the issue because `NavigatedToDirectory` triggers a full
snapshot push (via `RepositoryUpdated` or directly in the handler),
which replaces the entire client-side tree.

This has been broken since the initial commit — the
`new_with_incremental_updates` constructor existed but was never wired
into the daemon initialization path.

## Fix
In `initialize_app()`, use
`RepoMetadataModel::new_with_incremental_updates(ctx)` when the launch
mode is `RemoteServerDaemon`.

---
[Oz
conversation](https://staging.warp.dev/conversation/c0f4ca93-e310-48aa-afd1-0ccc6b8e384d)
| [Plan](https://staging.warp.dev/drive/notebook/ehhdaoqpILmQhzyNRukMbl)
zhangyu1818-bot pushed a commit to zhangyu1818/warply that referenced this pull request May 10, 2026
…#10514)

## Problem
The file tree in remote SSH sessions does not update when files change
on the server. Cd-ing in and out of the directory restores the correct
state.

## Root Cause
The daemon process creates its `RepoMetadataModel` with
`emit_incremental_updates = false`.

`initialize_app()` calls `RepoMetadataModel::new(ctx)` for **all**
launch modes, including `RemoteServerDaemon`. The `new()` constructor
leaves `emit_incremental_updates` disabled on the local sub-model. When
the file system watcher detects changes and `apply_file_tree_mutations`
runs, it returns `None` instead of a `RepoMetadataUpdate`, so
`IncrementalUpdateReady` is never emitted.

The `ServerModel` subscribes to `IncrementalUpdateReady` events to push
them to clients, but they never arrive.

Cd-ing fixes the issue because `NavigatedToDirectory` triggers a full
snapshot push (via `RepositoryUpdated` or directly in the handler),
which replaces the entire client-side tree.

This has been broken since the initial commit — the
`new_with_incremental_updates` constructor existed but was never wired
into the daemon initialization path.

## Fix
In `initialize_app()`, use
`RepoMetadataModel::new_with_incremental_updates(ctx)` when the launch
mode is `RemoteServerDaemon`.

---
[Oz
conversation](https://staging.warp.dev/conversation/c0f4ca93-e310-48aa-afd1-0ccc6b8e384d)
| [Plan](https://staging.warp.dev/drive/notebook/ehhdaoqpILmQhzyNRukMbl)

(cherry picked from commit 1711d59)
tungd pushed a commit to tungd/warp that referenced this pull request May 11, 2026
…#10514)

## Problem
The file tree in remote SSH sessions does not update when files change
on the server. Cd-ing in and out of the directory restores the correct
state.

## Root Cause
The daemon process creates its `RepoMetadataModel` with
`emit_incremental_updates = false`.

`initialize_app()` calls `RepoMetadataModel::new(ctx)` for **all**
launch modes, including `RemoteServerDaemon`. The `new()` constructor
leaves `emit_incremental_updates` disabled on the local sub-model. When
the file system watcher detects changes and `apply_file_tree_mutations`
runs, it returns `None` instead of a `RepoMetadataUpdate`, so
`IncrementalUpdateReady` is never emitted.

The `ServerModel` subscribes to `IncrementalUpdateReady` events to push
them to clients, but they never arrive.

Cd-ing fixes the issue because `NavigatedToDirectory` triggers a full
snapshot push (via `RepositoryUpdated` or directly in the handler),
which replaces the entire client-side tree.

This has been broken since the initial commit — the
`new_with_incremental_updates` constructor existed but was never wired
into the daemon initialization path.

## Fix
In `initialize_app()`, use
`RepoMetadataModel::new_with_incremental_updates(ctx)` when the launch
mode is `RemoteServerDaemon`.

---
[Oz
conversation](https://staging.warp.dev/conversation/c0f4ca93-e310-48aa-afd1-0ccc6b8e384d)
| [Plan](https://staging.warp.dev/drive/notebook/ehhdaoqpILmQhzyNRukMbl)
cephalonaut pushed a commit that referenced this pull request May 12, 2026
## Problem
The file tree in remote SSH sessions does not update when files change
on the server. Cd-ing in and out of the directory restores the correct
state.

## Root Cause
The daemon process creates its `RepoMetadataModel` with
`emit_incremental_updates = false`.

`initialize_app()` calls `RepoMetadataModel::new(ctx)` for **all**
launch modes, including `RemoteServerDaemon`. The `new()` constructor
leaves `emit_incremental_updates` disabled on the local sub-model. When
the file system watcher detects changes and `apply_file_tree_mutations`
runs, it returns `None` instead of a `RepoMetadataUpdate`, so
`IncrementalUpdateReady` is never emitted.

The `ServerModel` subscribes to `IncrementalUpdateReady` events to push
them to clients, but they never arrive.

Cd-ing fixes the issue because `NavigatedToDirectory` triggers a full
snapshot push (via `RepositoryUpdated` or directly in the handler),
which replaces the entire client-side tree.

This has been broken since the initial commit — the
`new_with_incremental_updates` constructor existed but was never wired
into the daemon initialization path.

## Fix
In `initialize_app()`, use
`RepoMetadataModel::new_with_incremental_updates(ctx)` when the launch
mode is `RemoteServerDaemon`.

---
[Oz
conversation](https://staging.warp.dev/conversation/c0f4ca93-e310-48aa-afd1-0ccc6b8e384d)
| [Plan](https://staging.warp.dev/drive/notebook/ehhdaoqpILmQhzyNRukMbl)
cephalonaut pushed a commit that referenced this pull request May 12, 2026
## Problem
The file tree in remote SSH sessions does not update when files change
on the server. Cd-ing in and out of the directory restores the correct
state.

## Root Cause
The daemon process creates its `RepoMetadataModel` with
`emit_incremental_updates = false`.

`initialize_app()` calls `RepoMetadataModel::new(ctx)` for **all**
launch modes, including `RemoteServerDaemon`. The `new()` constructor
leaves `emit_incremental_updates` disabled on the local sub-model. When
the file system watcher detects changes and `apply_file_tree_mutations`
runs, it returns `None` instead of a `RepoMetadataUpdate`, so
`IncrementalUpdateReady` is never emitted.

The `ServerModel` subscribes to `IncrementalUpdateReady` events to push
them to clients, but they never arrive.

Cd-ing fixes the issue because `NavigatedToDirectory` triggers a full
snapshot push (via `RepositoryUpdated` or directly in the handler),
which replaces the entire client-side tree.

This has been broken since the initial commit — the
`new_with_incremental_updates` constructor existed but was never wired
into the daemon initialization path.

## Fix
In `initialize_app()`, use
`RepoMetadataModel::new_with_incremental_updates(ctx)` when the launch
mode is `RemoteServerDaemon`.

---
[Oz
conversation](https://staging.warp.dev/conversation/c0f4ca93-e310-48aa-afd1-0ccc6b8e384d)
| [Plan](https://staging.warp.dev/drive/notebook/ehhdaoqpILmQhzyNRukMbl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants