Mark Firstrade execution blockers as retryable#18
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 05b587cf2c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if execution_blocked and execution_result.action_done: | ||
| stage = "PARTIAL_SUBMITTED" | ||
| elif execution_blocked: |
There was a problem hiding this comment.
Prevent partial retries from re-submitting prior orders
Persisting PARTIAL_SUBMITTED as a non-terminal stage means the same run_period is no longer idempotency-skipped on the next scheduler attempt, so a retry can execute the full plan again and submit symbols that were already submitted in the first attempt. This is especially risky when retries happen before previous orders are reflected in balances/positions, because there is no deduplication against prior submitted_orders or open orders, which can over-size live positions.
Useful? React with 👍 / 👎.
Summary
Tests