Skip to content

feat: retry llm execution when it fails - #1128

Closed
kstroobants wants to merge 5 commits into
mainfrom
kristof/dxp-12-retry-llm-execution-when-it-fails
Closed

kstroobants wants to merge 5 commits into
mainfrom
kristof/dxp-12-retry-llm-execution-when-it-fails

Conversation

@kstroobants

Copy link
Copy Markdown
Contributor

Fixes #DXP-12

What

  • Added retry logic in the just_in_backend function to handle cases where the llm call fails.

Why

  • To improve the robustness of backend calls by adding retry logic.

Testing done

  • Tested in the studio by making an llm call with wizard of coin and setting wrong API key.

Decisions made

  • I did not test failures due to network and timeouts.
  • Set the number of retries to 1.

Checks

  • I have tested this code
  • I have reviewed my own PR
  • I have created an issue for this PR
  • I have set a descriptive PR title compliant with conventional commits

Reviewing tips

  • Focus on the changes made to the lua script.

Depends on

This PR contains code from PR #1109.

User facing release notes

  • Improved backend call reliability by adding retry logic to handle llm failures.

@kstroobants
kstroobants requested a review from cristiam86 April 30, 2025 10:01
@kstroobants kstroobants self-assigned this Apr 30, 2025
@codecov

codecov Bot commented Apr 30, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 14.93%. Comparing base (d1f6963) to head (e23a85f).
Report is 17 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1128   +/-   ##
=======================================
  Coverage   14.93%   14.93%           
=======================================
  Files         123      123           
  Lines        7405     7405           
  Branches      254      254           
=======================================
  Hits         1106     1106           
  Misses       6235     6235           
  Partials       64       64           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kstroobants kstroobants changed the title Kristof/dxp 12 retry llm execution when it fails feat: retry llm execution when it fails Apr 30, 2025
@sonarqubecloud

sonarqubecloud Bot commented May 6, 2025

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
29.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@kstroobants

Copy link
Copy Markdown
Contributor Author

Same approach in #1109 with pcall.

@kstroobants kstroobants closed this Jun 2, 2025
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