-
Notifications
You must be signed in to change notification settings - Fork 986
Add stop policy to worker retry loop #1568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
Claude finished @creatorrr's task —— View job Changelog Bot AnalysisTodo List:
Analysis:
Decision: No changelog entry needed. This is an internal infrastructure change that improves worker resilience but doesn't affect user-facing functionality. Users don't directly interact with the worker retry mechanism - this is purely an operational improvement for system stability. Result: No action taken - exiting without writing, committing, or making changes as per changelog bot rules for non-user-visible changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed everything up to 6e9c489 in 57 seconds. Click for details.
- Reviewed
26lines of code in1files - Skipped
0files when reviewing. - Skipped posting
3draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/agents-api/agents_api/worker/__main__.py:11
- Draft comment:
Good: Added stop_after_attempt import to limit retries. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. src/agents-api/agents_api/worker/__main__.py:25
- Draft comment:
AIDEV-NOTE clarifies retry rationale. Consider removing or adjusting internal notes in production. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
3. src/agents-api/agents_api/worker/__main__.py:30
- Draft comment:
Using stop_after_attempt(5) appropriately limits retries. Confirm that catching only RuntimeError is intended. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_yF95vU8rD09UVuWN
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
Code Review for PR #1568: Add stop policy to worker retry loopOverall AssessmentThis is a good improvement that adds necessary bounds to the retry logic in the worker's main function. The change prevents infinite retry loops while maintaining reasonable resilience against transient failures. Strengths
Observations & Suggestions
No Critical Issues Found
Test Coverage NoteWhile no direct tests for main.py were found (which is common for entry point files), the retry behavior could be valuable to verify in integration tests, especially to ensure the worker properly fails after exhausting retries. ApprovalThis change improves the robustness of the worker service by preventing infinite retry loops while maintaining reasonable resilience. The implementation is clean and well-documented. Recommendation: Ready to merge after considering the optional suggestions above. |
User description
Summary
Testing
https://chatgpt.com/codex/tasks/task_b_68cb0221656483219bea456acd286bfa
PR Type
Enhancement
Description
Add retry limit to worker main function
Import
stop_after_attemptfrom tenacity libraryCap retries at 5 attempts with explanatory comment
Diagram Walkthrough
File Walkthrough
__main__.py
Add retry limit to worker retry decoratorsrc/agents-api/agents_api/worker/main.py
stop_after_attemptfrom tenacity librarystop=stop_after_attempt(5)to retry decoratorImportant
Adds a retry stop policy to the worker's main function in
__main__.py, limiting retries to five attempts usingstop_after_attempt.stop_after_attempt(5)to the@retrydecorator in__main__.pyto limit retries to five attempts (~100 seconds total).stop_after_attemptfromtenacityin__main__.py.This description was created by
for 6e9c489. You can customize this summary. It will automatically update as commits are pushed.