Improve AI runtime validation/retries, reporting, and data ingestion robustness#42
Merged
Rohan5commit merged 2 commits intoMay 19, 2026
Conversation
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.
Motivation
Description
.github/workflows/daily_trading_bot.yml: addeddisable_core_tradinginput, added retry steps for Core and AI runs, added AI runtime planning/validation steps that considerTRAINED_MODEL_INFERENCE_URL, added a preflight predict verification step, added environment tuning (TRAINED_MODEL_MAX_RETRIES, backoff, batch size), improved distilled-fallback and retry logic, and added an "Ensure Daily Email Coverage" guard and updated final status evaluation to include retry outcomes.trained_model_client.py: recognize alternate provider names, includeTRAINED_MODEL_INFERENCE_URLin candidate envs, add alternate-prediction-url handling (retrying on 404), tolerate missing/healthby short-circuiting readiness for some Cerebrium shapes, and improve retry/backoff/error reporting.llm_trader.py: add soft-cash neutral-breakout logic to allow converting strong neutral probabilities into directional signals when configured and there are no open positions.email_notifier.pyandmain.py: preserve and display model-provideddecision_reasonfor AI entries/exits instead of rewriting, includeperformance_period_startin Core and AI reports, and surface AI runtime/backend/model details in AI emails and in the ai_insight summary.positions.py: addedget_performance_period_start()to report the earliest entry date since last reset for a table.ingest_prices.py: make Stooq fetch resilient by iterating candidate ticker shapes, skipping bad CSV lines, validating required columns, and logging attempt-level warnings instead of failing the whole loop.quant_platform/scripts/plan_ai_runtime.py: includeTRAINED_MODEL_INFERENCE_URLas an acceptable Cerebrium URL source.Testing
pytest -q; existing automated tests passed.Codex Task