Repository navigation
Description
Expected Behavior
When the service rejects a checkpoint call with InvalidParameterValueException because the checkpoint token is stale (a newer invocation superseded this one), the SDK should classify the error as an invocation failure (retryable). The current invocation ends, and the service starts a fresh invocation with a fresh token. The execution itself continues.
Actual Behavior
The SDK classifies the error as an execution failure (non-retryable). So a stale checkpoint token fails the whole durable execution every time.
Root Cause
The classifier matches the error message with a case-sensitive prefix check against "Invalid Checkpoint Token". The service emits "Invalid checkpoint token" (lowercase c and t). The prefix check never matches. The error falls through to the generic 4xx branch, which is classified as an execution failure.
SDK constant (packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python/exceptions.py):
Line 16 in 8742ad9
| INVALID_CHECKPOINT_TOKEN_PREFIX: str = "Invalid Checkpoint Token" |
INVALID_CHECKPOINT_TOKEN_PREFIX: str = "Invalid Checkpoint Token"Used by _classify_error_category() via (error.get("Message") or "").startswith(INVALID_CHECKPOINT_TOKEN_PREFIX).
Test that encodes the wrong string: tests/exceptions_test.py ("Invalid Checkpoint Token: token expired").
Steps to Reproduce
- Have the service return a 4xx
InvalidParameterValueExceptionwhose message starts withInvalid checkpoint token(the real service message). - Pass it through the SDK error classifier.
- Observe it is classified as an execution (non-retryable) error rather than an invocation (retryable) error.
The existing unit tests do not catch this. They construct the error with the message "Invalid Checkpoint Token: token expired", which matches the SDK constant rather than the service constant.
Proposed Fix
- Change the SDK constant to
"Invalid checkpoint token"so it matches the service. - Consider a case-insensitive comparison to protect against future drift.
- Update the unit tests to use the real service message.
Related
Same defect exists in all three SDKs; each gets its own issue.
- JS: aws/aws-durable-execution-sdk-js
- Python: aws/aws-durable-execution-sdk-python
- Java: aws/aws-durable-execution-sdk-java
SDK Version
main (8742ad9)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn progress
Activity
yaythomas commentedon Sep 12, 2026
Sibling issues (same bug, one per SDK):
hln33 commentedon Sep 15, 2026
External contributor PR to address this - #723
fix(sdk): match invalid checkpoint token casing (aws#723)