{"record":{"id":"f33507278ae2b512","repo":"warpdotdev/warp","slug":"schedule-schedule-id-not-found","errorCode":null,"errorMessage":"Schedule {schedule_id} not found","messagePattern":"Schedule (.+?) not found","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src/ai/ambient_agents/scheduled.rs","lineNumber":367,"sourceCode":"        )\n    }\n\n    /// Delete a scheduled ambient agent.\n    pub fn delete_schedule(\n        &mut self,\n        schedule_id: SyncId,\n        ctx: &mut ModelContext<Self>,\n    ) -> impl Future<Output = anyhow::Result<()>> + Send + 'static + use<> {\n        let id_and_type = CloudObjectTypeAndId::GenericStringObject {\n            object_type: GenericStringObjectFormat::Json(JsonObjectType::ScheduledAmbientAgent),\n            id: schedule_id,\n        };\n\n        let (tx, rx) = oneshot::channel();\n\n        match CloudModel::as_ref(ctx).get_by_uid(&schedule_id.uid()) {\n            None => {\n                let _ = tx.send(Err(anyhow::anyhow!(\"Schedule {schedule_id} not found\")));\n            }\n            Some(schedule) => {\n                if schedule.metadata().has_pending_online_only_change()\n                    || schedule.metadata().pending_changes_statuses.pending_delete\n                {\n                    let _ = tx.send(Err(anyhow::anyhow!(\n                        \"Cannot delete schedule with pending changes\"\n                    )));\n                } else {\n                    self.pending_deletes.insert(schedule_id, tx);\n                    UpdateManager::handle(ctx).update(ctx, |update_manager, ctx| {\n                        update_manager.delete_object_by_user(id_and_type, ctx);\n                    });\n                }\n            }\n        }\n\n        async move {","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/ambient_agents/scheduled.rs#L349-L385","documentation":"delete_schedule creates a oneshot result channel and looks the schedule up via CloudModel::as_ref(ctx).get_by_uid(&schedule_id.uid()). If the uid is absent it immediately completes the channel with this error, so the returned future resolves to it and UpdateManager::delete_object_by_user is never called.","triggerScenarios":"Invoking ScheduledAgentManager::delete_schedule with a SyncId whose uid is not present in the local CloudModel snapshot (the None arm at scheduled.rs:368).","commonSituations":"Double-delete from UI (first delete removed the object, second resolves to this error); schedule deleted on another machine and the local snapshot is stale; object evicted before sync completed after re-login or workspace switch.","solutions":["Re-sync cloud objects (or re-open the schedules surface) and retry with a live id","Pre-validate with CloudModel::as_ref(ctx).get_by_uid(&schedule_id.uid()) before deleting","If the goal is only that the schedule be gone, treat this error as idempotent success"],"exampleFix":"// before\nmanager.delete_schedule(schedule_id, ctx).await?;\n\n// after\nlet gone = CloudModel::as_ref(ctx)\n    .get_by_uid(&schedule_id.uid())\n    .is_none();\nif gone {\n    return Ok(()); // already deleted: idempotent no-op\n}\nmanager.delete_schedule(schedule_id, ctx).await?;","handlingStrategy":"validation","validationCode":"if CloudModel::as_ref(ctx).get_by_uid(&schedule_id.uid()).is_none() {\n    return Ok(()); // already gone: treat delete as idempotent\n}","typeGuard":"fn schedule_present(id: &SyncId, ctx: &AppContext) -> bool {\n    CloudModel::as_ref(ctx).get_by_uid(&id.uid()).is_some()\n}","tryCatchPattern":"match manager.delete_schedule(id, ctx).await {\n    Err(e) if e.to_string().contains(\"not found\") => Ok(()), // idempotent delete\n    other => other,\n}","preventionTips":["Disable delete buttons for rows already marked deleted/pending to avoid double-delete","Re-sync the CloudModel snapshot before acting on ids older than the last mutation","Log the schedule_id whenever this fires to trace which client removed the object"],"tags":["rust","warp","cloud-sync","scheduling","idempotency"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}