Remote Worktree Support — Summary of Changes
Problem
The agent panel's "create new thread in worktree" feature only supported local projects. Remote (SSH/WSL/Docker) projects need the same capability, plus correct sidebar integration.
Changes Made
1. HeadlessRemoteClientDelegate (remote_connection/src/remote_connection.rs)
New public struct implementing RemoteClientDelegate without UI. Forwards binary downloads to AutoUpdater, drops password prompts with a log warning.
2. Remote worktree workspace creation (agent_ui/src/agent_panel.rs)
handle_worktree_requested: extractsremote_connection_optionsfrom project, fails early if disconnectedopen_worktree_workspace_and_start_thread: new remote branch usingremote::connect()→RemoteClient::new()→Project::remote()→open_remote_project_with_existing_connection()+multi_workspace.add()
3. Sidebar remote thread support (sidebar/src/sidebar.rs)
ThreadEntryWorkspace::Closednow carrieshost: Option<RemoteConnectionOptions>open_workspace_and_activate_thread: branches onhost— remote uses headless delegate flow, local unchanged- All pattern match sites updated,
activate_archived_threadlooks up host from project group keys - Worktree tooltip says "Remote" vs "Local" (
ui/src/components/ai/thread_item.rs)
4. Proto: root_repo_common_dir in WorktreeMetadata + AddWorktreeResponse
proto/worktree.proto: addedoptional string root_repo_common_dirto both messagesremote_server/headless_project.rs: includes value inAddWorktreeResponseworktree/worktree.rs:Worktree::remote()sets it from metadata;metadata_proto()includes it;apply_remote_updateonly updates whenSome(never clears)project/worktree_store.rs: passes through increate_remote_worktree,worktree_metadata_protos; emits newWorktreeUpdatedRootRepoCommonDireventproject/project.rs: newEvent::WorktreeUpdatedRootRepoCommonDir, forwarded from worktree store
5. Stale key cleanup (workspace/src/multi_workspace.rs)
subscribe_to_workspace: handlesWorktreeUpdatedRootRepoCommonDir— adds correct key, removes stale keys, notifies- New
remove_stale_project_group_keys()method
6. Dependency changes
agent_ui/Cargo.toml: addedremote,remote_connectionto deps; added remote test infra to dev-depssidebar/Cargo.toml: addedremote_connection,futuresto deps; added remote test infra to dev-deps
7. Tests
agent_ui:test_worktree_creation_for_remote_project— verifies remote code path is takensidebar:test_clicking_closed_remote_thread_opens_remote_workspace— verifies grouping and stale key cleanup
What's Left
See plan.md.