{"record":{"id":"8f8dc7f9bb638ae9","repo":"warpdotdev/warp","slug":"cloud-follow-up-did-not-start-in-time","errorCode":null,"errorMessage":"Cloud follow-up did not start in time","messagePattern":"Cloud follow-up did not start in time","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/ai/ambient_agents/spawn.rs","lineNumber":285,"sourceCode":"                                //   alive indefinitely.\n                                skipped_stale_polls += 1;\n                                continue;\n                            }\n\n                            if last_state.as_ref() != Some(&task.state) {\n                                last_state = Some(task.state.clone());\n                                yield Ok(AmbientAgentEvent::StateChanged {\n                                    state: task.state.clone(),\n                                    status_message: task.status_message.clone(),\n                                });\n                            }\n\n                            if task.state.is_terminal() {\n                                if matches!(&mode, RunPollMode::Followup { .. }) {\n                                    let exhausted_stale_skips = !seen_working_state\n                                        && skipped_stale_polls >= MAX_STALE_POLLS_BEFORE_FAILURE;\n                                    let message = if exhausted_stale_skips {\n                                        \"Cloud follow-up did not start in time\".to_string()\n                                    } else {\n                                        task.status_message\n                                            .as_ref()\n                                            .map(|msg| msg.message.clone())\n                                            .unwrap_or_else(|| {\n                                                if task.state.is_failure_like() {\n                                                    \"Cloud agent failed\".to_string()\n                                                } else {\n                                                    \"Cloud follow-up finished before a new session became available\".to_string()\n                                                }\n                                            })\n                                    };\n                                    yield Err(anyhow!(message));\n                                }\n                                return;\n                            }\n\n                            if task.state == AmbientAgentTaskState::InProgress","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/ambient_agents/spawn.rs#L267-L303","documentation":"In monitor_spawned_task's poll loop with RunPollMode::Followup, polls that return a non-working, non-Cancelled state before any working state was observed are treated as the previous run's residual terminal state and skipped. After MAX_STALE_POLLS_BEFORE_FAILURE (10) such skips, if the task is terminal and no working state was ever seen, the stream ends with this error: the server never transitioned the follow-up into a running state.","triggerScenarios":"Polling get_ambient_agent_task for a follow-up run where the server keeps reporting the prior run's terminal state (state.is_working() false, not Cancelled) for 10+ consecutive polls and then reports a terminal state, with seen_working_state still false (spawn.rs:251-285).","commonSituations":"Cloud backend wedge where the follow-up task is stuck on the previous run's terminal state; backend start latency longer than 10 poll cycles; follow-up request accepted but the task record was never created/transitioned.","solutions":["Retry the follow-up run: spawn a new follow-up so the server creates a fresh task record","Inspect the run via get_ambient_agent_task or the cloud dashboard to confirm the server-side state","If backend start latency is legitimately high, raise MAX_STALE_POLLS_BEFORE_FAILURE or the poll interval","If it reproduces consistently, report it - a wedged server that never leaves the residual terminal state"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"while let Some(event) = stream.next().await {\n    match event {\n        Err(e) if e.to_string() == \"Cloud follow-up did not start in time\" => {\n            retry_followup_once().await; // server was wedged on residual state\n        }\n        other => handle(other),\n    }\n}","preventionTips":["Give follow-up starts a generous window: tune MAX_STALE_POLLS_BEFORE_FAILURE to backend start latency","Log run_id with every stale-skip so wedged servers can be traced from telemetry","Confirm the follow-up task record exists before entering the poll loop"],"tags":["rust","warp","cloud-agents","polling","timeout","ambient-agents"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}