diff --git a/.agents/scripts/supervisor-archived/batch.sh b/.agents/scripts/supervisor-archived/batch.sh index 7eabe06c15..e9d43c9158 100755 --- a/.agents/scripts/supervisor-archived/batch.sh +++ b/.agents/scripts/supervisor-archived/batch.sh @@ -50,6 +50,11 @@ cmd_add() { log_error "--max-retries requires a value" return 1 } + # GH#3716: Validate max_retries is a non-negative integer before SQL interpolation + if ! [[ "$2" =~ ^[0-9]+$ ]]; then + log_error "--max-retries must be a non-negative integer, got: $2" + return 1 + fi max_retries="$2" shift 2 ;; @@ -240,6 +245,11 @@ cmd_batch() { log_error "--concurrency requires a value" return 1 } + # GH#3716: Validate concurrency is a positive integer before SQL interpolation + if ! [[ "$2" =~ ^[0-9]+$ ]] || [[ "$2" -eq 0 ]]; then + log_error "--concurrency must be a positive integer, got: $2" + return 1 + fi concurrency="$2" shift 2 ;; @@ -248,6 +258,11 @@ cmd_batch() { log_error "--max-concurrency requires a value" return 1 } + # GH#3716: Validate max_concurrency is a non-negative integer before SQL interpolation + if ! [[ "$2" =~ ^[0-9]+$ ]]; then + log_error "--max-concurrency must be a non-negative integer, got: $2" + return 1 + fi max_concurrency="$2" shift 2 ;; @@ -264,6 +279,11 @@ cmd_batch() { log_error "--max-load requires a value" return 1 } + # GH#3716: Validate max_load_factor is a non-negative integer before SQL interpolation + if ! [[ "$2" =~ ^[0-9]+$ ]]; then + log_error "--max-load must be a non-negative integer, got: $2" + return 1 + fi max_load_factor="$2" shift 2 ;; diff --git a/.agents/scripts/supervisor-archived/cron.sh b/.agents/scripts/supervisor-archived/cron.sh index f2ea0fbb97..cfa2a01995 100755 --- a/.agents/scripts/supervisor-archived/cron.sh +++ b/.agents/scripts/supervisor-archived/cron.sh @@ -34,6 +34,11 @@ cmd_cron() { log_error "--interval requires a value" return 1 } + # GH#3716: Validate interval is a positive integer before use in cron/launchd commands + if ! [[ "$2" =~ ^[0-9]+$ ]] || [[ "$2" -eq 0 ]]; then + log_error "--interval must be a positive integer (minutes), got: $2" + return 1 + fi interval="$2" shift 2 ;; diff --git a/.agents/scripts/supervisor-archived/database.sh b/.agents/scripts/supervisor-archived/database.sh index 0d53db8e88..0af9474ac0 100755 --- a/.agents/scripts/supervisor-archived/database.sh +++ b/.agents/scripts/supervisor-archived/database.sh @@ -415,10 +415,10 @@ CREATE TABLE tasks ( ); INSERT INTO tasks (id, repo, description, status, session_id, worktree, branch, log_file, retries, max_retries, model, error, pr_url, issue_url, diagnostic_of, - created_at, started_at, completed_at, updated_at) + triage_result, created_at, started_at, completed_at, updated_at) SELECT id, repo, description, status, session_id, worktree, branch, log_file, retries, max_retries, model, error, pr_url, issue_url, diagnostic_of, - created_at, started_at, completed_at, updated_at + triage_result, created_at, started_at, completed_at, updated_at FROM tasks_old_t148; DROP TABLE tasks_old_t148; CREATE INDEX IF NOT EXISTS idx_tasks_status ON tasks(status);