Skip to content

Delay core failure report until retry completes#81

Merged
Rohan5commit merged 2 commits into
mainfrom
codex/delay-core-failure-report
May 30, 2026
Merged

Delay core failure report until retry completes#81
Rohan5commit merged 2 commits into
mainfrom
codex/delay-core-failure-report

Conversation

@Rohan5commit
Copy link
Copy Markdown
Owner

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.

codex added 2 commits May 30, 2026 03:59
…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.
@Rohan5commit Rohan5commit merged commit f4df1f3 into main May 30, 2026
1 check passed
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.

2 participants