{"record":{"id":"5b8a89d2a52ba34d","repo":"warpdotdev/warp","slug":"remote-read-failed-e","errorCode":null,"errorMessage":"Remote read failed: {e}","messagePattern":"Remote read failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/ai/blocklist/action_model/execute/read_files.rs","lineNumber":171,"sourceCode":"                                    line_ranges: loc\n                                        .lines\n                                        .iter()\n                                        .map(|r| remote_server::proto::LineRange {\n                                            start: r.start as u32,\n                                            end: r.end as u32,\n                                        })\n                                        .collect(),\n                                }\n                            })\n                            .collect(),\n                        max_file_bytes: None,\n                        max_batch_bytes: None,\n                    };\n\n                    let response = handle\n                        .read_file_context(request)\n                        .await\n                        .map_err(|e| anyhow::anyhow!(\"Remote read failed: {e}\"))?;\n\n                    let failed_files = response\n                        .failed_files\n                        .into_iter()\n                        .map(|f| ReadFilesFailedFile {\n                            path: f.path,\n                            message: f.error.map(|e| e.message).unwrap_or_else(|| {\n                                \"File not found or could not be read\".to_string()\n                            }),\n                        })\n                        .collect::<Vec<_>>();\n\n                    if !failed_files.is_empty() && response.file_contexts.is_empty() {\n                        let failed = describe_failed_files(&failed_files);\n                        return Ok(ReadFilesResult::Error(format!(\n                            \"Failed to read files: {failed}\"\n                        )));\n                    }","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/blocklist/action_model/execute/read_files.rs#L153-L189","documentation":"Thrown by Warp Agent Mode's ReadFiles executor when the session is a Warpified remote session and the RPC `host_request_handle.read_file_context(request)` fails. The message wraps the underlying transport/RPC error (`{e}`) from the remote-server connection, so the agent cannot read files over the remote bridge. It is distinct from per-file failures, which arrive as `response.failed_files` and are reported softly.","triggerScenarios":"An agent read_files tool call runs in a session whose session_type is Some(SessionType::WarpifiedRemote { host_id: Some(_) }); a host_request_handle was resolved from RemoteServerManager, but the `read_file_context` gRPC call returns Err — the SSH/remote connection dropped, the remote warp-server process died, the host_id went stale after a reconnect, or the host rejected the request.","commonSituations":"Remote host connection lost mid-conversation; remote warp-server crashed or restarted leaving a stale host handle; VPN or network interruption during a read; large file batches amplifying a flaky link. Note the sibling guard at the top of the function: a WarpifiedRemote session with NO usable handle returns a friendly 'file read/edit tool is not available' result instead of this error.","solutions":["Check the remote session connection state, reconnect the Warpified host, then retry the agent request","Verify the remote warp-server is running and reachable and that the host_id still resolves in RemoteServerManager (the handle exists but the connection behind it is dead)","Retry with fewer or smaller files to rule out batch/size limits over a slow link","If the connection cannot be restored, read the files from inside the remote shell (cat/sed) instead of the file-read tool"],"exampleFix":"// before\nlet response = handle\n    .read_file_context(request)\n    .await\n    .map_err(|e| anyhow::anyhow!(\"Remote read failed: {e}\"))?;\n\n// after: degrade to an actionable agent-visible result instead of failing the whole action\nlet response = match handle.read_file_context(request).await {\n    Ok(response) => response,\n    Err(e) => {\n        return Ok(ReadFilesResult::Error(format!(\n            \"Remote read failed: {e}. Check the remote connection and retry.\"\n        )))\n    }\n};","handlingStrategy":"retry","validationCode":"// Before dispatching a remote read, confirm the host handle resolves.\nlet Some(handle) = remote_server::manager::RemoteServerManager::as_ref(ctx)\n    .host_request_handle(host_id)\nelse {\n    return Ok(ReadFilesResult::Error(\n        \"Remote host not connected; reconnect before reading files.\".into(),\n    ));\n};","typeGuard":"fn remote_read_available(session_type: &Option<SessionType>) -> bool {\n    matches!(session_type, Some(SessionType::WarpifiedRemote { host_id: Some(_) }))\n}","tryCatchPattern":"match handle.read_file_context(request).await {\n    Ok(response) => response,\n    Err(e) => {\n        log::warn!(\"Remote read failed: {e}\");\n        // transport errors are retryable: surface a retryable result to the agent\n        return Ok(ReadFilesResult::Error(format!(\"Remote read failed: {e}\")));\n    }\n}","preventionTips":["Check remote host connectivity before running agent file tools on a Warpified session","Re-resolve the host_request_handle after reconnects instead of caching it across sessions","Treat transport-level failures as retryable and per-file failures (failed_files) as permanent"],"tags":["remote","rpc","network","files","agent"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}