You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: stop retrying after successful payment signing is rejected by merchant (#492)
* fix: stop retrying after successful payment signing is rejected by server
Previously, when a signed payment was rejected (e.g., insufficient balance),
the plugin would store failure state and trigger interrupt-based retries.
This was unnecessary since a server-side rejection after successful signing
is not recoverable by retrying.
Changes:
- Add payment_signed_{toolUseId} flag to track successful signing
- After successful signing + retry, if server returns 402 again, stop immediately
- Signing failures still retry up to MAX_PAYMENT_RETRIES
- Move retry count increment to after successful signing attempt
- Remove _is_post_payment_failure (replaced by _has_successful_signing)
* fix: address review feedback
- Preserve interrupt behavior: post-payment failure stores state and
triggers interrupt so downstream consumers are notified
- Remove dead code: _extract_payment_error_message (unreachable)
- Remove TestExtractPaymentErrorMessage (tested removed method)
- Clarify comment on retry counter increment
- Add test: signing flag takes precedence over retry limit
- Remove emojis from new integration test logger output
* fix: address PR review feedback on retry-improvement
- plugin.py: drop redundant tool_input re-fetch (already bound at line 177)
- plugin.py: document that invocation_state markers are intentionally
per-invocation and do not need explicit cleanup
- test_plugin_integration.py: hoist unittest.mock and PaymentError imports
to module top, per project convention
- test_plugin_integration.py: clarify TestPostPaymentFailureFlow docstring
to flag it as mock-driven and credential-free
---------
Co-authored-by: Raju Ansari <ansraju@amazon.com>
Co-authored-by: Aidan Daly <aidandal@amazon.com>
Co-authored-by: Aidan Daly <99039782+aidandaly24@users.noreply.github.com>
0 commit comments