Skip to content

fix: respect default retry limit - #3283

Open
DmitryAnansky wants to merge 4 commits into
mainfrom
fix/respect-default-retry-limit
Open

DmitryAnansky wants to merge 4 commits into
mainfrom
fix/respect-default-retry-limit

Conversation

@DmitryAnansky

@DmitryAnansky DmitryAnansky commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What/Why/How?

Fixed an issue where respect didn't retry a step when its retry failure action had no retryLimit.
As the Arazzo specification defines, such an action now retries the step once, after running the workflow or step that the action references.
When a step runs out of retries, respect now runs the next matching failure action, or ends the workflow if there is none.
A retry action that references a stepId also no longer retries without limit when that step has its own retry action.

Note: Previously, a workflow continued with the next step after a step had failed and used up its retries.
Now the workflow ends at that step unless a later failure action, such as goto, says otherwise.

Reference

Testing

Screenshots (optional)

Check yourself

  • This PR follows the contributing guide
  • All new/updated code is covered by tests
  • Core code changed? - Tested with other Redocly products (internal contributions only)
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update has been considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

Note

Medium Risk
Changes workflow control flow after failed steps (retries, goto, workflow termination), which can alter existing Respect/Arazzo runs that relied on the old post-retry behavior.

Overview
Fixes Respect onFailure retry handling so it matches Arazzo when retryLimit is omitted: the default is now 1 retry (was 0, so the step was never retried).

When retries are exhausted, the runner continues through the failure-action list instead of stopping early with shouldEnd: false, so the next matching action (e.g. goto) can run. Exhausted retries no longer implicitly advance to the next workflow step—the workflow ends at that step unless a later failure action says otherwise.

For retry actions that reference a stepId, the nested runStep now receives retriesLeft - 1, preventing a target step’s own retry action from starting a fresh retry budget.

Adds an e2e Respect fixture and snapshot coverage for retry-without-limit plus retry-then-goto and nested-step retry behavior; ships patch notes for @redocly/cli and @redocly/respect-core.

Reviewed by Cursor Bugbot for commit 008efc9. Configure here.

@DmitryAnansky DmitryAnansky self-assigned this Oct 21, 2026
@changeset-bot

changeset-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5f903dc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@redocly/cli Patch
@redocly/respect-core Patch
@redocly/openapi-core Patch
@redocly/recheck Patch
@redocly/reunite-integration Patch
@redocly/client-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

📝 Recheck Summary

ℹ️ No Markdown files changed under docs/ or cookbook/.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Performance Benchmark (Lower is Faster)

CLI Version Bundle Lint Check Config
latest ▓░░░░░░░░░░ 1.01x ± 0.01 ▓░░░░░░░░░░ 1.01x ± 0.01 ▓░░░░░░░░░░ 1.01x ± 0.01
next ▓░░░░░░░░░░ 1.00x ▓░░░░░░░░░░ 1.00x ▓░░░░░░░░░░ 1.00x

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 82.35% (🎯 80%) 20499 / 24891
🔵 Statements 81.87% (🎯 80%) 22134 / 27033
🔵 Functions 83.63% (🎯 80%) 3852 / 4606
🔵 Branches 75.01% (🎯 75%) 14994 / 19987
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/respect-core/src/types.ts 100% 100% 100% 100%
packages/respect-core/src/modules/flow-runner/run-step.ts 90.34% 81.48% 100% 90.14% 179, 187-189, 199-205, 327-328, 405-414, 418-420, 448, 451-453, 477
packages/respect-core/src/modules/flow-runner/runner.ts 88.88% 81.03% 94.11% 89.52% 100, 214, 224-225, 241-251, 262, 288-290, 333, 447
Generated in workflow #12779 for commit 5f903dc by the Vitest Coverage Report Action

@DmitryAnansky
DmitryAnansky marked this pull request as ready for review October 21, 2026 09:34
@DmitryAnansky
DmitryAnansky requested review from a team as code owners October 21, 2026 09:34

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 008efc9. Configure here.

Comment thread packages/respect-core/src/modules/flow-runner/run-step.ts
Comment thread packages/respect-core/src/modules/flow-runner/run-step.ts Outdated
Comment thread .changeset/respect-default-retry-limit.md

@kanoru3101 kanoru3101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, it looks good. Left a few minor improvements

Comment thread packages/respect-core/src/modules/flow-runner/run-step.ts Outdated
@DmitryAnansky
DmitryAnansky force-pushed the fix/respect-default-retry-limit branch from c58d499 to 84f98ba Compare October 21, 2026 15:10
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.

3 participants