diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-15 03:39:49 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-15 03:39:49 +0000 |
| commit | 6ff67a57d72317360cacd4b41560395ded117d20 (patch) | |
| tree | 39fdc413f3c985dcf13424bbca01eb152d80e3c5 /scripts/next-task | |
| parent | 43440200facf9f7c51ba4f4638e69e7d651dd50d (diff) | |
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.
Diffstat (limited to 'scripts/next-task')
| -rwxr-xr-x | scripts/next-task | 7 |
1 files changed, 4 insertions, 3 deletions
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" |
