diff options
Diffstat (limited to 'Omni')
| -rwxr-xr-x | Omni/Agent/start-worker.sh | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Omni/Agent/start-worker.sh b/Omni/Agent/start-worker.sh index ad519a0..2f81686 100755 --- a/Omni/Agent/start-worker.sh +++ b/Omni/Agent/start-worker.sh @@ -56,7 +56,7 @@ while true; do # A. Sync with Live # We use 'git rebase' to keep history linear # Force checkout to clean up any untracked files from previous runs - git checkout -f omni-worker-1 >/dev/null 2>&1 + git checkout -f "$TARGET" >/dev/null 2>&1 # Rebase directly on local live branch (shared repo) if ! git rebase live >/dev/null 2>&1; then @@ -113,8 +113,9 @@ while true; do # that may have been generated by sync tools but are tracked in the branch. git checkout -f "$BRANCH_NAME" >/dev/null else - echo "Creating new branch $BRANCH_NAME" - git checkout -b "$BRANCH_NAME" >/dev/null + echo "Creating new branch $BRANCH_NAME from origin/live" + git fetch origin live >/dev/null 2>&1 + git checkout -b "$BRANCH_NAME" origin/live >/dev/null fi # F. Execute Agent @@ -149,6 +150,10 @@ Context: if [ $AGENT_EXIT_CODE -eq 0 ]; then echo "Agent finished successfully." + # Update status to review (bundled in commit) + echo "Marking task $TASK_ID as Review..." + "$TASK_BIN" update "$TASK_ID" review + # G. Submit Work if [ -n "$(git status --porcelain)" ]; then echo "Committing changes..." @@ -160,7 +165,7 @@ Context: echo "Submitting for review..." # Switch back to base - git checkout omni-worker-1 >/dev/null + git checkout "$TARGET" >/dev/null # Sync again (rebase on latest live) # If rebase fails, we MUST abort to avoid leaving the repo in a broken state @@ -171,8 +176,7 @@ Context: sync_tasks - # Update status - echo "Marking task $TASK_ID as Review..." + # Update status again for signaling if "$TASK_BIN" update "$TASK_ID" review; then sync_tasks --commit >/dev/null echo "Task $TASK_ID submitted for review." |
