t3756: address PR #948 review feedback - stderr suppression and race conditions#4533
Conversation
… and race conditions (t3756) - Replace 2>/dev/null with 2>>"$SUPERVISOR_LOG" in write_proof_log and DB query calls to comply with style guide rule #50 (Gemini review feedback) - Add state re-check before marking task failed when cmd_transition to deployed fails after retries, preventing race condition where concurrent transition already moved the task out of deploying (CodeRabbit review feedback) - Add state re-check in Phase 4d pulse before force-deploying stuck tasks, preventing clobber of concurrent transitions to failed/blocked/cancelled - Fix test: replace false-pass on 'failed' outcome with skip when task is still in deploying (CodeRabbit nitpick - lenient assertion undermined test) - Fix test SUPERVISOR_SCRIPT path to point to supervisor-archived/ location Closes #3756
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Caution Review failedPull request was closed or merged during review WalkthroughThese changes enhance concurrency safety in deployment automation by adding guarded state re-checks before task transitions, improving error logging to supervisor logs, and preventing race conditions where concurrent operations could corrupt task state. Test paths and expectations are updated accordingly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Sat Mar 14 00:27:36 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Summary
Addresses all review feedback from PR #948 (auto-recovery for stuck deploying tasks) flagged by Gemini and CodeRabbit.
Closes #3756
Changes
supervisor-archived/deploy.sh2>/dev/null→2>>"$SUPERVISOR_LOG"onwrite_proof_logcall (Gemini medium: style guide rule docs: update branch creation to recommend worktrees for parallel sessions #50 — stderr suppression only acceptable when redirecting to log files)2>/dev/null→2>>"$SUPERVISOR_LOG"on DB query fordeploying_recovery_attempts(Gemini medium: same rule)elsebranch (CodeRabbit major): whencmd_transitiontodeployedfails after all retries, re-check current task state before markingfailed. If another process already moved the task out ofdeploying, skip thefailedtransition and log the observed state instead of clobbering it.supervisor-archived/pulse.shdeployedon any stuck task. Now re-checks current state before forcing — if the task was already transitioned tofailed/blocked/cancelledby a concurrent process, skip the force and log a warning.tests/test-supervisor-state-machine.shcmd_pr_lifecycleauto-recovery acceptedfailedas a passing outcome, which masked regressions. Now usesskipwhen the task is still indeploying(no real repo context available in test isolation), andfailfor any other unexpected state.SUPERVISOR_SCRIPTpath: updated to point tosupervisor-archived/supervisor-helper.sh(the file was moved during the supervisor refactor in refactor: replace 37K-line bash supervisor with 123-line AI pulse system #2291 but the test path was never updated).Verification
shellcheck .agents/scripts/supervisor-archived/deploy.sh— cleanshellcheck tests/test-supervisor-state-machine.sh— cleanshellcheck .agents/scripts/supervisor-archived/pulse.sh— hits memory watchdog on large file (pre-existing, not introduced by this PR)Summary by CodeRabbit
Release Notes
Bug Fixes
Chores