{"record":{"id":"b972c58ca842b9c2","repo":"warpdotdev/warp","slug":"schedule-not-found-b972c5","errorCode":null,"errorMessage":"Schedule not found","messagePattern":"Schedule not found","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src/ai/ambient_agents/scheduled.rs","lineNumber":247,"sourceCode":"\n                let update_future =\n                    UpdateManager::handle(ctx).update(ctx, |update_manager, ctx| {\n                        update_manager.update_scheduled_ambient_agent_online(\n                            updated_config,\n                            schedule_id,\n                            revision,\n                            ctx,\n                        )\n                    });\n\n                async move {\n                    update_future\n                        .await\n                        .map_err(|e| anyhow::anyhow!(\"{}: {}\", error_message, e))\n                }\n                .boxed()\n            }\n            None => async move { Err(anyhow::anyhow!(\"Schedule not found\")) }.boxed(),\n        }\n    }\n\n    /// Pause a scheduled ambient agent.\n    pub fn pause_schedule(\n        &mut self,\n        schedule_id: SyncId,\n        ctx: &mut ModelContext<Self>,\n    ) -> impl Future<Output = anyhow::Result<()>> + Send + 'static + use<> {\n        self.modify_schedule(\n            schedule_id,\n            \"Failed to pause schedule\",\n            |config| config.enabled = false,\n            ctx,\n        )\n    }\n\n    /// Unpause a scheduled ambient agent.","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/ambient_agents/scheduled.rs#L229-L265","documentation":"Thrown by ScheduledAgentManager::modify_schedule when CloudScheduledAmbientAgent::get_by_id(&schedule_id, ctx) returns None. pause_schedule and update_schedule both funnel through this helper, so any modify operation on a schedule that is not present in the local cloud-object snapshot fails immediately with this message before UpdateManager is ever involved.","triggerScenarios":"Calling pause_schedule(schedule_id, ctx), update_schedule(...), or any other modify_schedule wrapper with a SyncId whose CloudScheduledAmbientAgent object no longer exists locally (get_by_id -> None at scheduled.rs:221).","commonSituations":"Stale schedule list in the UI after the schedule was deleted from another device or by an already-synced pending delete; a race between a delete confirmation and a pause/resume click; a schedule id persisted from a previous app session that was since removed server-side.","solutions":["Refresh scheduled agents from the cloud and re-render the list, then retry with the current id","Guard the call: check CloudScheduledAmbientAgent::get_by_id(&schedule_id, ctx).is_some() before invoking pause/update","If the UI row is already gone, treat 'Schedule not found' as a benign no-op success","Check pending_deletes / pending_changes state to detect a concurrent delete before acting"],"exampleFix":"// before\nmanager.pause_schedule(schedule_id, ctx).await?;\n\n// after\nif CloudScheduledAmbientAgent::get_by_id(&schedule_id, ctx).is_some() {\n    manager.pause_schedule(schedule_id, ctx).await?;\n} else {\n    // schedule vanished locally: refresh from cloud instead of failing\n    refresh_schedules(ctx).await?;\n}","handlingStrategy":"validation","validationCode":"let exists = CloudScheduledAmbientAgent::get_by_id(&schedule_id, ctx).is_some();\nif !exists {\n    // stale id: refresh schedules from cloud / drop the UI row instead of calling modify\n}","typeGuard":"fn schedule_exists(id: &SyncId, ctx: &AppContext) -> bool {\n    CloudScheduledAmbientAgent::get_by_id(id, ctx).is_some()\n}","tryCatchPattern":"match manager.pause_schedule(id, ctx).await {\n    Ok(()) => {}\n    Err(e) if e.to_string() == \"Schedule not found\" => { /* benign: refresh list */ }\n    Err(e) => return Err(e),\n}","preventionTips":["Always resolve schedule ids from the freshly rendered list, never from persisted stale state","Drop or refresh UI rows as soon as deletion is confirmed so modify actions cannot target them","Treat 'Schedule not found' as idempotent success when the user's intent is already satisfied"],"tags":["rust","warp","cloud-sync","scheduling","ambient-agents"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}