{"record":{"id":"bb6867347af204b7","repo":"zed-industries/zed","slug":"cannot-open-repository-on-disconnected-remote-mach","errorCode":null,"errorMessage":"cannot open repository on disconnected remote machine","messagePattern":"cannot open repository on disconnected remote machine","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_ui/src/thread_worktree_archive.rs","lineNumber":410,"sourceCode":"            .next()\n    });\n\n    if let Some((repo, project)) = live_repo {\n        return Ok((repo, project));\n    }\n\n    let app_state =\n        current_app_state(cx).context(\"no app state available for temporary project\")?;\n\n    // For remote paths, create a fresh RemoteClient through the connection\n    // pool (reusing the existing SSH transport) and build a temporary\n    // remote project. Each RemoteClient gets its own server-side headless\n    // project, so there are no RPC routing conflicts with other projects.\n    let temp_project = if let Some(connection) = remote_connection_owned {\n        let remote_client = cx\n            .update(|cx| {\n                if !remote::has_active_connection(&connection, cx) {\n                    anyhow::bail!(\"cannot open repository on disconnected remote machine\");\n                }\n                Ok(remote_connection::connect_reusing_pool(connection, cx))\n            })?\n            .await?\n            .context(\"remote connection was canceled\")?;\n\n        cx.update(|cx| {\n            Project::remote(\n                remote_client,\n                app_state.client.clone(),\n                app_state.node_runtime.clone(),\n                app_state.user_store.clone(),\n                app_state.languages.clone(),\n                app_state.fs.clone(),\n                false,\n                cx,\n            )\n        })","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/agent_ui/src/thread_worktree_archive.rs#L392-L428","documentation":"When restoring (unarchiving) a thread worktree whose project lives on a remote machine, Zed builds a temporary remote project by reusing the SSH connection from the pool. remote::has_active_connection now reports the connection is gone, so no temporary remote project can be created and the restore aborts.","triggerScenarios":"Restoring an archived thread while the SSH remote has disconnected: network change, laptop sleep, remote server restart, or Zed restarted without re-establishing the connection.","commonSituations":"Resuming work after connectivity loss; remote dev box rebooted; a stale archive referencing a remote project that is no longer reachable.","solutions":["Reconnect to the remote machine (reopen the remote project) and retry the restore.","Verify SSH reachability and credentials/agent forwarding to that host.","If the remote is gone for good, restore against a local clone of the repository or remove the archive."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if let Some(connection) = &remote_connection {\n    if !remote::has_active_connection(connection, cx) {\n        // prompt the user to reconnect to the remote before restoring\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check has_active_connection before starting a remote restore and surface a reconnect prompt.","Retry the restore automatically once the connection is re-established.","Keep enough metadata in the archive row to fall back to restoring from a local clone."],"tags":["zed","remote","ssh","worktree-archive","thread-restore"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}