summaryrefslogtreecommitdiff
path: root/Omni/Agent
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-11-20 22:16:31 -0500
committerBen Sima <ben@bsima.me>2025-11-20 22:16:31 -0500
commitedeb13dd997f879e74ae72b3f419ef63c372358f (patch)
treed5a069a490fcdd32739f51dc8c74065aa7cc8d71 /Omni/Agent
parent408281ffd369be3a2ca8e09de5185f24516ae6af (diff)
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.
Diffstat (limited to 'Omni/Agent')
-rwxr-xr-xOmni/Agent/start-worker.sh18
1 files changed, 13 insertions, 5 deletions
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..."