-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add StepFailed opcode #291
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: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds support for the StepFailed opcode to properly handle steps that have exhausted their retry attempts. The implementation distinguishes between retryable step errors and final failures.
- Adds StepFailed opcode and error code to handle final step failures
- Implements logic to check if maximum attempts are reached and raise StepFailed instead of StepError
- Extends server request context to include max_attempts field
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
step_sync.py | Adds logic to detect final attempt and raise StepFailed error with new opcode |
step_async.py | Mirror implementation of step failure logic for async operations |
execution_request.py | Adds max_attempts field to server request context |
consts.py | Defines new STEP_FAILED error code and opcode constants |
errors.py | Implements StepFailed error class as non-retryable StepError |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ff15101
to
9983290
Compare
9983290
to
4b8238c
Compare
self._stack = stack | ||
|
||
|
||
class StepFailedError(StepError): |
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.
Can delete this now!
SIGNING_KEY_UNSPECIFIED = "signing_key_unspecified" | ||
SIG_VERIFICATION_FAILED = "sig_verification_failed" | ||
STEP_ERRORED = "step_errored" | ||
STEP_FAILED = "step_failed" |
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.
Can delete this too
raise base.ResponseInterrupt( | ||
base.StepResponse(original_error=err, step=step_info) | ||
) |
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.
raise base.ResponseInterrupt( | |
base.StepResponse(original_error=err, step=step_info) | |
) |
Not needed since we're already raising below
EXE-255: Python SDK
Related To
inngest#2992