Skip to content

Persist duplicate live run heartbeat reports#77

Merged
Pigbibi merged 1 commit into
mainfrom
fix/duplicate-live-run-heartbeat-report
Jun 9, 2026
Merged

Persist duplicate live run heartbeat reports#77
Pigbibi merged 1 commit into
mainfrom
fix/duplicate-live-run-heartbeat-report

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • persist a duplicate-skip strategy run report when live monthly idempotency blocks a repeat run
  • keep duplicate runs from submitting orders while refreshing latest/history report timestamps
  • update duplicate live run tests to assert report persistence

Tests

  • .venv/bin/python -m pytest tests/test_rebalance_service.py -q -k 'duplicate_live_monthly or funding_block'
  • .venv/bin/python -m pytest -q

@Pigbibi Pigbibi merged commit 5a0867e into main Jun 9, 2026
1 check passed
@Pigbibi Pigbibi deleted the fix/duplicate-live-run-heartbeat-report branch June 9, 2026 05:16

@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: 8903fa03e5

ℹ️ 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".

strategy_run_persisted = False
strategy_run_persistence_error = None
duplicate_state = build_strategy_run_state(
stage=duplicate_stage,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a distinct history stage for duplicate runs

When a duplicate request is processed in the same second as the terminal run it is skipping, persisting it with the original duplicate_stage can overwrite the original history object: persist_strategy_run_state names history entries from run_period, stage, and a seconds-resolution timestamp. In that case the audit entry containing the actual submitted orders can be replaced by this duplicate payload with submitted_orders: [], leaving only the heartbeat in history; use a duplicate-specific stage/suffix or otherwise unique history key for skipped duplicates.

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