Persist duplicate live run heartbeat reports#77
Conversation
There was a problem hiding this comment.
💡 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, |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Tests