From edeb13dd997f879e74ae72b3f419ef63c372358f Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 20 Nov 2025 22:16:31 -0500 Subject: fix(worker): handle rebase failures gracefully If the rebase on live fails, we abort it to preserve the local state. We also verify that the task status update to 'review' succeeds before proceeding. --- Omni/Agent/start-worker.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'Omni') diff --git a/Omni/Agent/start-worker.sh b/Omni/Agent/start-worker.sh index 820c1bb..0b09d5e 100755 --- a/Omni/Agent/start-worker.sh +++ b/Omni/Agent/start-worker.sh @@ -141,14 +141,22 @@ Context: git checkout omni-worker-1 >/dev/null # Sync again (rebase on latest live) - git rebase live >/dev/null 2>&1 + # If rebase fails, we MUST abort to avoid leaving the repo in a broken state + if ! git rebase live >/dev/null 2>&1; then + echo "Warning: Rebase conflict. Aborting rebase and proceeding with local state." + git rebase --abort || true + fi + sync_tasks # Update status - "$TASK_BIN" update "$TASK_ID" review >/dev/null - sync_tasks --commit >/dev/null - - echo "Task $TASK_ID submitted for review." + echo "Marking task $TASK_ID as Review..." + if "$TASK_BIN" update "$TASK_ID" review; then + sync_tasks --commit >/dev/null + echo "Task $TASK_ID submitted for review." + else + echo "Error: Failed to update task status to Review." + fi else echo "Agent failed (exit code $AGENT_EXIT_CODE). Sleeping for 10s before retrying..." -- cgit v1.2.3