Scheduled tasks: run history cannot be pruned — no delete, no retention policy, and runs aren't even enumerable
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
context:daily recurring cloud scheduled task (one run per day, a news digest).
- Run entries accumulate with no way to remove them. Every firing creates a
session entry under "Scheduled runs". The only documented deletion path is
deleting the entire scheduled task, which also stops all future runs. There is
no way to remove a single past run while keeping the schedule alive.
- Run history is not enumerable via the API. The trigger object exposes only
last_run (a single most-recent record). There is no endpoint to list past
runs. This means a self-managed cleanup step inside the scheduled prompt is
impossible: the task cannot obtain the IDs of its own prior runs, and even if
it could, no delete-run operation exists.
- No retention policy. There is no per-task setting such as "keep the last N
runs" or "auto-delete runs older than N days".
Impact
For recurring tasks whose output is inherently ephemeral — news digests,
monitoring checks, status polls — every run's transcript is retained forever,
each holding a full stale copy of that day's output. The list grows without
bound and there is no pruning path, manual or programmatic.
Current workaround (partial)
Write the real payload to a single fixed destination that is overwritten each run
(a project doc), and deliberately keep the chat reply minimal so transcripts stay
small. This reduces the stored payload per run but does not stop the entry count
from growing, and the transcripts still retain whatever the reply contained.
Proposed Solution
- Delete an individual scheduled-task run (UI + API).
- Per-task retention setting (keep last N runs / auto-delete after N days).
- Run-history enumeration in the API (ids, timestamps, status), so cleanup can at
least be self-managed.
- Optionally, a per-task "do not persist a session for this run" mode, for tasks
that deliver their output elsewhere (document, notification, webhook).
Alternative Solutions
_No response_
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
_No response_
Additional Context
Plan-tier limits on scheduled tasks are also undocumented — see #40124 and #41402.