From a9d03c6cca95138b5694ac1aba2239ca8a46fdc8 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 5 Jun 2026 10:54:18 +0300 Subject: feat(taskwarrior): export +agent tasks to JSON history before cleanup --- fish/conf.d/taskwarrior.fish | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fish/conf.d/taskwarrior.fish b/fish/conf.d/taskwarrior.fish index fc2e637..603f0d8 100644 --- a/fish/conf.d/taskwarrior.fish +++ b/fish/conf.d/taskwarrior.fish @@ -150,7 +150,14 @@ end function taskwarrior::cleanup # Delete only tasks completed over 30 days ago test (task +random status:completed end.before:today-30days count) -gt 0; and yes | task +random status:completed end.before:today-30days delete &>/dev/null - test (task +agent status:completed end.before:today-30days count) -gt 0; and yes | task +agent status:completed end.before:today-30days delete &>/dev/null + + # Export +agent tasks to a JSON history file before deleting them + set -l agent_history_dir ~/Documents/Taskwarrior/AgentsHistory + if test (task +agent status:completed end.before:today-30days count) -gt 0 + test -d $agent_history_dir; or mkdir -p $agent_history_dir + task +agent status:completed end.before:today-30days export >"$agent_history_dir/tw-agent-export-"(date +%Y%m%d-%H%M%S)".json" + yes | task +agent status:completed end.before:today-30days delete &>/dev/null + end end function taskwarrior::unscheduled -- cgit v1.2.3