Skip to content

fix(flare-workflow): SDD-loop judge-parse retries + item_done in_review no-op - #512

Merged
getappz merged 2 commits into
masterfrom
fix/sdd-workflow-retry-and-claim-heartbeat
Aug 15, 2026
Merged

fix(flare-workflow): SDD-loop judge-parse retries + item_done in_review no-op#512
getappz merged 2 commits into
masterfrom
fix/sdd-workflow-retry-and-claim-heartbeat

Conversation

@getappz

@getappz getappz commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • build_sdd_loop_step's judge-parse-failure branch returned Ok(StepResult::Failure), but flare-workflow's execute_step_with_retry hardcodes should_retry=false for that variant — only a real Err consults the step's RetryPolicy. Every dispatched work-item run was failing outright on the first malformed judge reply, with zero retries, despite the step's RetryPolicy { max_attempts: 3, .. }. Confirmed against a live ~/.agentflare/workflows.db: 8/8 recent sdd_loop failures were single-attempt (attempt: 1, journaled as the generic "Step failed"). Now returns WorkflowError::StepFailed, which the engine does retry.
  • item_done's in_review branch derived the response's status from a local bool instead of whether mark_in_review actually succeeded. mark_in_review silently 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's state_id/assignee_agent never updated, leaving it looking orphaned and eligible for re-dispatch despite already having an open PR. Now surfaces this as a hard error.
  • Added a throttled (5 min) claim heartbeat to run_or_resume_with_sender's poll loop — work-item jobs run up to WORK_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 build
  • cargo nextest run --bin agentflare work_item_pipeline (27/27 passed, including the updated judge_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::pedantic
  • cargo fmt --check

…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
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 33 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bcc5f972-dae5-4e88-9717-6fc3f420c0f9

📥 Commits

Reviewing files that changed from the base of the PR and between 7834aec and 7def449.

📒 Files selected for processing (2)
  • src/mcp_server/item.rs
  • src/work_item_pipeline.rs

Comment @coderabbitai help to get the list of available commands.

@getappz
getappz merged commit 05a5a78 into master Aug 15, 2026
16 checks passed
@getappz
getappz deleted the fix/sdd-workflow-retry-and-claim-heartbeat branch August 15, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant