fix(flare-workflow): SDD-loop judge-parse retries + item_done in_review no-op - #512
Conversation
…ew no-op Two bugs in the new work-item flare-workflow pipeline that made dispatched items fail/churn instead of converging: 1. build_sdd_loop_step returned Ok(StepResult::Failure) on a malformed judge reply, but flare-workflow's execute_step_with_retry (crates/flare-workflow/src/engine.rs) hardcodes should_retry=false for Ok(StepResult::Failure) -- only a real Err consults the step's RetryPolicy. So the attached RetryPolicy (3 attempts) never actually applied, and every run failed outright on the first bad judge reply. Confirmed against ~/.agentflare/workflows.db: 8/8 recent sdd_loop failures were single-attempt, journaled as generic "Step failed". Now returns a real WorkflowError::StepFailed, which the engine does retry. 2. item_done's in_review branch computed the response's status purely from the local `in_review` bool, not from whether mark_in_review actually succeeded. mark_in_review silently no-ops (Ok(false)) when its ownership check fails (claim lost/reclaimed), so a lost claim after a successful push+PR was reported back as a clean "in_review" success -- the item's state_id/assignee_agent never actually updated, leaving it looking orphaned and eligible for another dispatch despite already having an open PR. Now surfaces this as a hard error instead. Also added a throttled (5 min) claim heartbeat to run_or_resume_with_sender's poll loop: work-item jobs are allowed to run up to WORK_JOB_TIMEOUT_SECS (~6h05m) but the claim lease TTL defaults to 30 minutes with nothing previously re-heartbeating it during a long SDD run, so a multi-task/ fix-round run could let its own lease go stale mid-flight. Agentflare-Agent: claude-code Agentflare-Branch: fix/sdd-workflow-retry-and-claim-heartbeat
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 33 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Comment |
Summary
build_sdd_loop_step's judge-parse-failure branch returnedOk(StepResult::Failure), butflare-workflow'sexecute_step_with_retryhardcodesshould_retry=falsefor that variant — only a realErrconsults the step'sRetryPolicy. Every dispatched work-item run was failing outright on the first malformed judge reply, with zero retries, despite the step'sRetryPolicy { max_attempts: 3, .. }. Confirmed against a live~/.agentflare/workflows.db: 8/8 recentsdd_loopfailures were single-attempt (attempt: 1, journaled as the generic"Step failed"). Now returnsWorkflowError::StepFailed, which the engine does retry.item_done'sin_reviewbranch derived the response'sstatusfrom a local bool instead of whethermark_in_reviewactually succeeded.mark_in_reviewsilently no-ops (Ok(false)) on an ownership mismatch (claim lost/reclaimed), so a lost claim right after a successful push+PR was reported back as a clean"in_review"success — the item'sstate_id/assignee_agentnever updated, leaving it looking orphaned and eligible for re-dispatch despite already having an open PR. Now surfaces this as a hard error.run_or_resume_with_sender's poll loop — work-item jobs run up toWORK_JOB_TIMEOUT_SECS(~6h05m) but the claim TTL defaults to 30 minutes with nothing previously re-heartbeating it during a long SDD run.Test plan
cargo build --lib/ full binary buildcargo nextest run --bin agentflare work_item_pipeline(27/27 passed, including the updatedjudge_parse_failure_is_retryable_step_error)cargo nextest run --bin agentflare item_done(10/10 passed, incl.item_done_with_a_resulting_pr_moves_to_in_review_not_completed)cargo clippy --all-targets --all-features -- -D warnings -A unsafe_code -A clippy::pedanticcargo fmt --check