{"record":{"id":"c1a7f71dc55d8d21","repo":"warpdotdev/warp","slug":"timed-out-waiting-for-warp-drive-to-sync","errorCode":null,"errorMessage":"Timed out waiting for Warp Drive to sync","messagePattern":"Timed out waiting for Warp Drive to sync","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/common.rs","lineNumber":163,"sourceCode":"            .with_timeout(WORKSPACE_METADATA_REFRESH_TIMEOUT)\n    });\n\n    async move {\n        let _ = refresh_future\n            .await\n            .map_err(|_| anyhow::anyhow!(\"Timed out refreshing team metadata\"))?;\n        Ok(())\n    }\n}\n\n/// Refresh Warp Drive before executing an operation.\npub fn refresh_warp_drive(\n    ctx: &AppContext,\n) -> impl Future<Output = anyhow::Result<()>> + Send + 'static + use<> {\n    UpdateManager::as_ref(ctx)\n        .initial_load_complete()\n        .with_timeout(WARP_DRIVE_SYNC_TIMEOUT)\n        .map_err(|_| anyhow::anyhow!(\"Timed out waiting for Warp Drive to sync\"))\n}\n\n/// Fetch the conversation's server metadata and validate that its harness matches the caller's\n/// `--harness` choice. Returns the metadata on success so the caller can reuse it (e.g. for the\n/// server conversation token).\n///\n/// Called up-front before any task/config-build logic consumes `args.harness`, so a mismatch\n/// error surfaces before side effects like task creation. We deliberately do NOT auto-upgrade\n/// the harness: `Harness::Oz` default with a Claude conversation id is treated as a mismatch\n/// and errors out.\npub(super) async fn fetch_and_validate_conversation_harness(\n    ai_client: Arc<dyn AIClient>,\n    conversation_id: &str,\n    args_harness: Harness,\n) -> Result<ServerAIConversationMetadata, AgentDriverError> {\n    let metadata = ai_client\n        .list_ai_conversation_metadata(Some(vec![conversation_id.to_string()]))\n        .await","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/common.rs#L145-L181","documentation":"Thrown when UpdateManager::as_ref(ctx).initial_load_complete() does not finish within WARP_DRIVE_SYNC_TIMEOUT (60 seconds, app/src/ai/agent_sdk/driver.rs:172). Warp Drive is the cloud-sync layer; initial_load_complete resolves only after the first full sync of drive objects. The timeout means the client never observed that initial sync completing.","triggerScenarios":"Calling refresh_warp_drive(ctx) (or the environment-resolution paths in app/src/ai/agent_sdk/environment.rs that use the same constant) when the UpdateManager's initial load future stalls >60s — offline machine, auth failure preventing sync, large drive taking longer than 60s for first load, or websocket to the sync backend being down.","commonSituations":"First run of an ambient-agent/CLI command on a new machine before Warp Drive has synced; running with a logged-out or token-expired account; firewall blocking the sync websocket; or an unusually large synced workspace whose initial load exceeds the fixed 60s budget.","solutions":["Verify you are logged in and the Warp app has completed its first Drive sync (open the app once and let it finish), then retry the command.","Check connectivity/auth: expired credentials make initial_load_complete never resolve while retrying quietly.","For very large drives where 60s is genuinely too short, as a maintainer bump or make WARP_DRIVE_SYNC_TIMEOUT configurable.","If sync is optional for your flow, structure the caller to degrade gracefully instead of propagating the error."],"exampleFix":"// before\nUpdateManager::as_ref(ctx)\n    .initial_load_complete()\n    .with_timeout(WARP_DRIVE_SYNC_TIMEOUT)\n    .map_err(|_| anyhow::anyhow!(\"Timed out waiting for Warp Drive to sync\"))\n\n// after (caller decides whether drive sync is mandatory)\nif requires_drive {\n    refresh_warp_drive(ctx).await?;\n} else if let Err(err) = refresh_warp_drive(ctx).await {\n    log::warn!(\"Warp Drive sync skipped: {err:#}\");\n}","handlingStrategy":"retry","validationCode":"if !UpdateManager::as_ref(ctx).has_completed_initial_load() {\n    // not required, but lets you warn before burning the 60s timeout\n    log::warn!(\"Warp Drive initial load still pending\");\n}","typeGuard":null,"tryCatchPattern":"let mut attempt = 0;\nloop {\n    match refresh_warp_drive(ctx).await {\n        Ok(()) => break,\n        Err(err) if err.to_string().contains(\"Timed out waiting for Warp Drive to sync\") && attempt < 1 => {\n            attempt += 1;\n            tokio::time::sleep(std::time::Duration::from_secs(5)).await;\n        }\n        Err(err) => return Err(err),\n    }\n}","preventionTips":["Open the Warp app once on a new machine so the first Drive sync completes before CLI/agent use.","Degrade gracefully when drive data (environments, settings) is not needed for the operation.","Alert on repeated 60s sync timeouts — they usually mean blocked websockets or expired auth, not slow disks."],"tags":["timeout","warp-drive","sync","rust","agent-sdk"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}