{"record":{"id":"cf9d81be484c6fe8","repo":"warpdotdev/warp","slug":"timed-out-refreshing-team-metadata","errorCode":null,"errorMessage":"Timed out refreshing team metadata","messagePattern":"Timed out refreshing team metadata","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/common.rs","lineNumber":151,"sourceCode":"///\n/// This ensures that team state is up-to-date before creating cloud objects or performing\n/// other operations that depend on team membership.\npub fn refresh_workspace_metadata<C>(\n    ctx: &mut C,\n) -> impl Future<Output = anyhow::Result<()>> + Send + 'static + use<C>\nwhere\n    C: GetSingletonModelHandle + UpdateModel,\n{\n    let refresh_future = TeamUpdateManager::handle(ctx).update(ctx, |manager, ctx| {\n        manager\n            .refresh_workspace_metadata(ctx)\n            .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///","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/common.rs#L133-L169","documentation":"Thrown when refreshing workspace/team metadata via TeamUpdateManager::handle(ctx).update(...) does not complete within WORKSPACE_METADATA_REFRESH_TIMEOUT (10 seconds, app/src/ai/agent_sdk/common.rs:30). The with_timeout wrapper converts the elapsed future into an Err, which is mapped to this anyhow message. It signals that the server round-trip for team metadata (members, settings) stalled, not that the data is invalid.","triggerScenarios":"Calling the agent-SDK helper that wraps refresh_workspace_metadata(ctx) with .with_timeout(WORKSPACE_METADATA_REFRESH_TIMEOUT) — i.e. any ambient-agent operation that first refreshes team metadata. It fires when that future does not resolve within 10s: slow/blocked network, server latency, expired auth token forcing retries, or the TeamUpdateManager model being busy/deadlocked.","commonSituations":"Running warp CLI agent commands on a flaky connection, VPN half-open tunnels, CI runners with no network egress, clock-skewed auth, or a saturated event loop where the manager update never gets scheduled. Also seen right after login when a first metadata fetch races a token refresh.","solutions":["Check network connectivity to the Warp server endpoint and retry the command — the timeout is a fixed 10s so transient slowness is the most common cause.","Re-authenticate (warp logout / warp login) if requests are silently looping on an expired token.","If it reproduces consistently on a fast network, capture logs for the TeamUpdateManager update and report a possible deadlock/stall in refresh_workspace_metadata.","As a maintainer, consider retrying once with backoff or surfacing the underlying future's state instead of only the timeout."],"exampleFix":"// before\nlet _ = refresh_future\n    .await\n    .map_err(|_| anyhow::anyhow!(\"Timed out refreshing team metadata\"))?;\n\n// after (retry once before giving up)\nlet result = refresh_future\n    .await\n    .map_err(|_| anyhow::anyhow!(\"Timed out refreshing team metadata\"));\nif result.is_err() {\n    log::warn!(\"team metadata refresh timed out; retrying once\");\n    // rebuild the update future and await it again before failing\n}","handlingStrategy":"retry","validationCode":"let start = std::time::Instant::now();\nif !net_up() {\n    anyhow::bail!(\"no network; team metadata refresh will time out\");\n}\nfn net_up() -> bool {\n    std::net::TcpStream::connect(\"stable.warp.dev:443\").is_ok()\n}","typeGuard":null,"tryCatchPattern":"match refresh_team_metadata(ctx).await {\n    Ok(()) => {},\n    Err(err) if err.to_string().contains(\"Timed out refreshing team metadata\") => {\n        log::warn!(\"team metadata refresh timed out; continuing with cached metadata\");\n        // or retry once with backoff before surfacing\n    }\n    Err(err) => return Err(err),\n}","preventionTips":["Retry once with a short backoff before treating the 10s team-metadata timeout as fatal.","Ensure auth tokens are fresh before operations that chain multiple server round-trips.","Log the elapsed time and network state when the timeout fires to distinguish stalls from slowness."],"tags":["timeout","network","warp-drive","rust","agent-sdk"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}