Skip to content

feat(tasks): self cleaning tasks#5121

Draft
brunozoric wants to merge 13 commits intonextfrom
bruno/feat/tasks/self-cleaning-tasks
Draft

feat(tasks): self cleaning tasks#5121
brunozoric wants to merge 13 commits intonextfrom
bruno/feat/tasks/self-cleaning-tasks

Conversation

@brunozoric
Copy link
Copy Markdown
Contributor

@brunozoric brunozoric commented Apr 21, 2026

Changes

This PR gives a task to self-delete after it is done. If turned on, it will delete everything in the database related to that task: run, logs, child tasks, their logs....

It is configurable via the regular task definition.

How Has This Been Tested?

Jest and manually.

brunozoric and others added 12 commits April 21, 2026 08:40
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Implements recursive best-effort deletion of a task subtree (task +
descendants + their logs when databaseLogs=true), wired into
createTaskCrud as context.tasks.cleanupTaskSubtree(id).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… to ApiContext

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds 5 integration tests covering all selfCleanup scenarios (onSuccess, onError,
always, parent cascade, onAbort). Also fixes a bug in RunnableTaskDecorator
where selfCleanup was not forwarded to the SelfCleaningTaskDecorator, causing
cleanup to never trigger.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@brunozoric brunozoric self-assigned this Apr 21, 2026
@brunozoric brunozoric requested a review from Pavel910 April 21, 2026 07:47
@brunozoric brunozoric added this to the 6.3.0 milestone Apr 21, 2026
- Integration: onError cleanup, array form, user-hook ordering,
  3-level cascade, mixed databaseLogs in cascade, explicit never.
- Unit: cleanupTaskSubtree cycle guard.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant