Skip to content

Mark Firstrade execution blockers as retryable#18

Merged
Pigbibi merged 1 commit into
mainfrom
codex/firstrade-execution-blocked-retry
May 24, 2026
Merged

Mark Firstrade execution blockers as retryable#18
Pigbibi merged 1 commit into
mainfrom
codex/firstrade-execution-blocked-retry

Conversation

@Pigbibi

@Pigbibi Pigbibi commented May 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • classify insufficient cash for one whole share as an execution blocker
  • mark blocked and partial live runs as non-terminal run states so later scheduler attempts can retry
  • surface execution blockers in Telegram summaries

Tests

  • .venv/bin/python -m pytest -q
  • .venv/bin/python -m py_compile application/execution_service.py application/rebalance_service.py notifications/telegram.py tests/test_execution_service.py tests/test_rebalance_service.py

@Pigbibi Pigbibi merged commit d320071 into main May 24, 2026
1 check passed
@Pigbibi Pigbibi deleted the codex/firstrade-execution-blocked-retry branch May 24, 2026 09:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +334 to +336
if execution_blocked and execution_result.action_done:
stage = "PARTIAL_SUBMITTED"
elif execution_blocked:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant