{"record":{"id":"c3ad654afbedc3e5","repo":"warpdotdev/warp","slug":"timed-out-sending-orchestration-message","errorCode":null,"errorMessage":"Timed out sending orchestration message{}","messagePattern":"Timed out sending orchestration message(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/ai/blocklist/action_model/execute/send_message.rs","lineNumber":94,"sourceCode":") -> anyhow::Result<SendAgentMessageResponse, anyhow::Error> {\n    let task_id_for_timeout = task_id.map(|task_id| task_id.to_string());\n    let send_message = async move {\n        match task_id {\n            Some(task_id) => {\n                server_api\n                    .send_agent_message_for_task(&task_id, request)\n                    .await\n            }\n            None => ai_client.send_agent_message(request).await,\n        }\n    };\n    let timeout = Timer::after(SEND_AGENT_MESSAGE_TIMEOUT);\n    futures::pin_mut!(send_message);\n    futures::pin_mut!(timeout);\n\n    match futures::future::select(send_message, timeout).await {\n        Either::Left((result, _)) => result,\n        Either::Right(_) => Err(anyhow!(\n            \"Timed out sending orchestration message{}\",\n            task_id_for_timeout\n                .map(|task_id| format!(\" for task {task_id}\"))\n                .unwrap_or_default()\n        )),\n    }\n}\n\n#[cfg(target_family = \"wasm\")]\nasync fn send_agent_message_with_timeout(\n    server_api: std::sync::Arc<crate::server::server_api::ServerApi>,\n    ai_client: std::sync::Arc<dyn crate::server::server_api::ai::AIClient>,\n    task_id: Option<AmbientAgentTaskId>,\n    request: SendAgentMessageRequest,\n) -> anyhow::Result<SendAgentMessageResponse, anyhow::Error> {\n    match task_id {\n        Some(task_id) => {\n            server_api","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/blocklist/action_model/execute/send_message.rs#L76-L112","documentation":"Raised by `send_agent_message_with_timeout` (native builds only; the WASM variant has no timeout) when an inter-agent orchestration send — `server_api.send_agent_message_for_task(&task_id, request)` or `ai_client.send_agent_message(request)` — does not complete within SEND_AGENT_MESSAGE_TIMEOUT (15 seconds). `futures::future::select` races the send against `Timer::after`; the timer winning produces this error, with the task id appended when one is known.","triggerScenarios":"A team/ambient agent sends an orchestration message (task-id-routed or plain) and the server API future hangs or exceeds 15s: stalled network, slow server-side ack, backlogged GraphQL v2 WebSocket, or a half-open connection after suspend/resume that never errors on its own.","commonSituations":"Multi-agent orchestration on a poor network; warp-server backend slow to acknowledge; proxy/firewall stalling the WebSocket endpoint; machine sleep/wake leaving the client connection dead but not failed.","solutions":["Check network/WS_SERVER_URL health and retry the send — the timeout is a fixed 15s client ceiling, so transient slowness is the most common cause","Verify the client is still authenticated and the GraphQL v2 WebSocket is connected before blaming payload size","If it reproduces consistently, measure server-side latency of send_agent_message; 15s is hard-coded in SEND_AGENT_MESSAGE_TIMEOUT and cannot be tuned per call","Keep sends task-id-routed so a timed-out message can be correlated and safely re-sent"],"exampleFix":"// before\nmatch futures::future::select(send_message, timeout).await {\n    Either::Left((result, _)) => result,\n    Either::Right(_) => Err(anyhow!(\"Timed out sending orchestration message{}\", ..)),\n}\n\n// after: classify the timeout as retryable and retry once with backoff\nlet result = match futures::future::select(send_message, Timer::after(SEND_AGENT_MESSAGE_TIMEOUT)).await {\n    Either::Left((result, _)) => result,\n    Either::Right(_) => Err(anyhow!(\"Timed out sending orchestration message (retryable)\")),\n};\nresult.or_else(|e| async { /* backoff, rebuild request, resend */ Err(e) }).await","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match send_agent_message_with_timeout(server_api, ai_client, task_id, request).await {\n    Ok(resp) => resp,\n    Err(e) if e.to_string().contains(\"Timed out\") => {\n        // transient: back off and retry once before reporting TeamAgentCommunicationFailed\n        std::thread::sleep(Duration::from_millis(500));\n        send_agent_message_with_timeout(server_api, ai_client, task_id, request).await?\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep orchestration messages small and idempotent so a 15s timeout can be retried safely","Verify the GraphQL v2 WebSocket is connected before starting multi-agent runs","Always route sends through a task id so timed-out messages can be correlated and reconciled server-side"],"tags":["timeout","network","orchestration","agent","async"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}