Delay core failure report until retry completes#81
Merged
Conversation
…ion, and AI preflight retries ### Motivation - Reduce unintended scheduled executions by restricting the daily CI run to Tuesday through Saturday and ensure scheduled runs are explicitly gated at runtime. - Fail early when required SMTP configuration for AI report emails is missing to avoid late failures during AI steps. - Improve robustness of AI inference preflight checks by retrying transient failures and adding small backoff. ### Description - Changed the cron schedule in `.github/workflows/daily_trading_bot.yml` from `2-7` to `2-6` (Tue–Sat) and added an `Enforce schedule day guard (Tue-Sat only)` step to block any scheduled run outside the intended weekdays. - Normalized AI gating expressions across many workflow steps to use `((github.event_name != 'workflow_dispatch') || !inputs.disable_ai_trading)` so AI steps run when expected for scheduled runs and respect manual inputs, and replaced static `AI_EXPECTED: "false"` with a conditional expression to reflect the input/trigger state. - Added `Validate SMTP configuration for AI reports` workflow step to fail early if any of `SMTP_SERVER`, `SMTP_PORT`, `SENDER_EMAIL`, `SENDER_PASSWORD`, or `RECIPIENT_EMAIL` secrets are missing. - Improved `run_ai_daily_cerebrium.py` by adding retry/backoff logic to `_preflight_predict` (3 attempts, retries on transient HTTP statuses and network errors) and importing `time`, and removed the `ALLOW_MISSING_EMAIL` override; added small formatting/whitespace cleanup in `main.py`. ### Testing - Performed CI workflow file validation and basic linting of changed Python files with local checks, which passed. - Exercised the `run_ai_daily_cerebrium._preflight_predict` path via a local smoke run to verify retry and backoff behavior, which succeeded. - No new automated unit tests were added in this change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the Core failure-report email after the Core retry step so users do not receive false error emails while the retry is still running. This fixes the false Core [ERROR] email observed on run 26673263652.