Skip to content

fix(flare-workflow): honor RetryPolicy for StepMode::Loop iterations - #519

Merged
getappz merged 3 commits into
masterfrom
task/486-flare-workflow-execute-loop-silently-ign
Aug 16, 2026
Merged

fix(flare-workflow): honor RetryPolicy for StepMode::Loop iterations#519
getappz merged 3 commits into
masterfrom
task/486-flare-workflow-execute-loop-silently-ign

Conversation

@getappz

@getappz getappz commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • execute_loop (the code path StepMode::Loop steps like sdd_loop actually dispatch through) never consulted the step's RetryPolicy, hard-failing the whole loop on the first error even when a policy — including the crate's own default (max_attempts: 3) — configured multiple attempts.
  • Retries the current iteration in place (not advancing iter) up to the policy's max_attempts with backoff, reusing the same in-memory context across attempts so a partially-completed iteration isn't redone.
  • Scope: crates/flare-workflow/src/loops.rs only — sdd_loop is the only StepMode::Loop step in the codebase, confirmed via full-repo search.

Test plan

  • cargo test -p flare-workflow — all 43 tests pass, including 2 new ones (loop_iteration_retries_transient_failure_then_succeeds, loop_iteration_fails_after_exhausting_retries) and the existing crash-recovery loop test (no regression to loop durability)
  • cargo clippy -p flare-workflow --all-targets -- -A unsafe_code -A clippy::pedantic — clean

execute_loop dispatched from StepMode::Loop never consulted the step's
RetryPolicy, hard-failing the whole loop on the first error even when
a policy (including the crate default) configured multiple attempts.
sdd_loop's configured 3-attempt retry for malformed judge replies was
silently dead code as a result.

Retry the current iteration in place (not advancing iter) up to the
policy's max_attempts with backoff, reusing the same in-memory context
across attempts so a partially-completed iteration isn't redone.

Agentflare-Agent: claude-code_2-1-233_agent
Agentflare-Branch: task/486-flare-workflow-execute-loop-silently-ign
Agentflare-Item: 486
@coderabbitai

coderabbitai Bot commented Aug 16, 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: 2 minutes

Limit details: You’ve used all 1 included review currently available under your plan. You completed 72 included PR reviews in the past 7 days; at that activity level, included reviews refill at 1 review per hour.

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: bebd05a2-1f6b-4db2-b357-eab99a847619

📥 Commits

Reviewing files that changed from the base of the PR and between ad0244d and f5c97d4.

📒 Files selected for processing (2)
  • crates/flare-workflow/src/loops.rs
  • crates/flare-workflow/tests/semantics_test.rs

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

Agentflare-Agent: claude-code_2-1-233_agent
Agentflare-Branch: task/486-flare-workflow-execute-loop-silently-ign
Agentflare-Item: 486
Agentflare-Agent: claude-code_2-1-233_agent
Agentflare-Branch: task/486-flare-workflow-execute-loop-silently-ign
Agentflare-Item: 486
@getappz
getappz merged commit 9394575 into master Aug 16, 2026
16 checks passed
@getappz
getappz deleted the task/486-flare-workflow-execute-loop-silently-ign branch August 16, 2026 08:27
getappz added a commit that referenced this pull request Aug 21, 2026
#573)

Same architectural gap as skill-registry (#519/PR #572), which
gateway-registry's own doc comments say it mirrors: hand-rolled
apply_schema() with no user_version tracking. Audited the git history
(#104 -> #158 -> #347) -- the tools table's columns have never changed
since creation, so there's no live "no such column" bug today, but the
next column addition would hit the identical class of bug.

Migrates to agentflare-db-kit's open_file/open_memory with a real
migration list: 0001_initial replays the original (#104) narrow schema,
0002_fts_triggers unconditionally drops and recreates tools_fts as the
external-content shape with sync triggers plus a backfill. No ALTER
TABLE/migration hook needed here (unlike #519) since tools's columns
are stable -- DROP ... IF EXISTS before a fresh CREATE is correct
regardless of which pre-migration shape existed.

Added GatewayError::DbInit for db_kit::open::Error and its error_kind
match arm. All 60 gateway-registry unit tests pass, including the
existing legacy-standalone-FTS conversion test; clippy (with the CI
gate flags) and fmt are clean; the full agentflare binary compiles.

Agentflare-Agent: claude-code_2-1-237_agent
Agentflare-Branch: task/520-fix-gateway-registry-adopt-agentflare-db
Agentflare-Item: 520
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