From 6ff67a57d72317360cacd4b41560395ded117d20 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sun, 15 Mar 2026 03:39:49 +0000 Subject: feat: fix task failures via sandbox improvements and display commits in Web UI - Fix ephemeral sandbox deletion issue by passing $CLAUDOMATOR_PROJECT_DIR to agents and using it for subtask project_dir. - Implement sandbox autocommit in teardown to prevent task failures from uncommitted work. - Track git commits created during executions and persist them in the DB. - Display git commits and changestats badges in the Web UI execution history. - Add badge counts to Web UI tabs for Interrupted, Ready, and Running states. - Improve scripts/next-task to handle QUEUED tasks and configurable DB path. --- scripts/next-task | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/next-task b/scripts/next-task index e74ca26..9df09f0 100755 --- a/scripts/next-task +++ b/scripts/next-task @@ -11,7 +11,7 @@ # Usage: next_id=$(scripts/next-task) # Example: scripts/start-next-task -DB_PATH="/site/doot.terst.org/data/claudomator.db" +DB_PATH="${DB_PATH:-/site/doot.terst.org/data/claudomator.db}" # 1. Fetch the most recently updated COMPLETED or READY task target=$(sqlite3 "$DB_PATH" "SELECT id, state, parent_task_id FROM tasks WHERE state IN ('COMPLETED', 'READY') ORDER BY updated_at DESC LIMIT 1;") @@ -32,7 +32,7 @@ fi if [ -z "$next_task" ]; then # 4. No child/sibling found: fall back to highest-priority oldest PENDING task - next_task=$(sqlite3 "$DB_PATH" "SELECT id FROM tasks WHERE state = 'PENDING' AND id != '$id' + FALLBACK_SQL="SELECT id FROM tasks WHERE state IN ('PENDING', 'QUEUED') AND id != '$id' ORDER BY CASE priority WHEN 'critical' THEN 4 @@ -42,7 +42,8 @@ if [ -z "$next_task" ]; then ELSE 0 END DESC, created_at ASC - LIMIT 1;") + LIMIT 1;" + next_task=$(sqlite3 "$DB_PATH" "$FALLBACK_SQL") fi echo "$next_task" -- cgit v1.2.3