[Bug]: Completed one-off automations accumulate in scheduled task lists
Before submitting
- [x] Searched existing issues; did not find a duplicate of completed one-off tasks accumulating.
- [x] Included reproduction steps and source findings.
Area
apps/server; visible in apps/web and apps/desktop.
Problem
One-off automations remain saved and visible after their scheduled run has been used up. In projects where agents create many one-off follow-ups, Settings → Scheduled tasks and the thread's Automations panel accumulate obsolete entries. Users must delete each task manually.
This reports the accumulation problem for triage. Automatic deletion below is the requested behaviour change, not an assertion that maintainers have already approved it.
Steps to reproduce
- Create a one-time scheduled task bound to a thread.
- Allow its scheduled time to arrive and its triggered agent turn to complete.
- Open Settings → Scheduled tasks and the thread's Automations panel.
- Repeat with several one-time follow-ups.
Expected behaviour
A one-off automation should be deleted automatically once its scheduled agent turn completes successfully. Its conversation and results should remain available.
Actual behaviour
The task's next run is cleared, but its stored record remains and both lists continue displaying it. Completed one-offs accumulate alongside pending, recurring and webhook tasks.
Impact
Minor bug or occasional failure: repeated manual cleanup and difficulty distinguishing active automations from exhausted one-offs.
Version or commit
Source inspected: main @ fa2f4ff2a2. Exact installed desktop build in the original report was not captured.
Environment
Reported in the macOS desktop client, viewing a project hosted by the remote desktop-shetland environment. Source investigation only; no live schedules were changed.
Investigation
apps/server/src/scheduledTasks/ScheduledTaskService.tsrecords run status and clearsnextRunAtfor an exhausted one-time schedule, without deleting it.apps/server/src/scheduledTasks/ScheduledTaskService.interval.test.tsexplicitly checks that the task remains listed withnextRunAt: null.apps/web/src/components/chat/ThreadAutomationsPanel.tsxfilters by thread, without excluding exhausted one-offs.- Existing deletion paths include explicit task deletion and cleanup when its bound thread is deleted.
Important distinction: the current succeeded run status records successful dispatch/launch, not successful completion of the agent's work. Related: #17889. Deleting on that status alone could remove an automation whose agent turn later fails.
Proposed scope for discussion
- Delete an exhausted one-time automation after its triggered agent turn succeeds, rather than immediately after dispatch.
- Keep failed or interrupted runs visible for inspection, retry or explicit deletion.
- Preserve the existing behaviour where manually running a task before its scheduled time does not consume the future scheduled run.
- Leave recurring and webhook automations unchanged.
- Preserve conversation history and results.
- Make completion cleanup safe across server restarts and concurrent edits. A finishing run must not delete a task that was rescheduled or replaced.
- Apply cleanup on the owning server so local and remote clients observe the same result.
“Done” here means the triggered agent turn successfully finished; it does not prove an external job started by that turn has finished.
Existing completed tasks
Treat retrospective cleanup as a separate decision. Existing succeeded records alone do not establish successful agent-turn completion, so they should not be bulk-deleted on that basis.
Workaround
Delete exhausted tasks individually from Scheduled tasks.
Supporting evidence
Two user-provided screenshots show several one-off follow-ups retained in both lists. Screenshots are not attached because they include unrelated private project content.
Implementation status
No implementation or PR yet. Seeking triage of the problem and agreement on completion semantics before implementation.
+1, running into this too. Finished one-time tasks pile up in the list and I end up deleting them by hand. Auto-removing them after a successful run (while keeping failed ones visible) would be great.