Work#23
Merged
Merged
Conversation
…gic, and make trained-model endpoint handling more robust ### Motivation - Allow workflow dispatch to run only the AI bot or only the Core bot via explicit inputs and gates in the CI workflow. - Surface model-provided reason text and AI runtime metadata in emails instead of rewriting reasons, and include the performance period start in reports. - Enable soft "neutral breakout" behavior for the LLM predictions to allow opportunistic soft-cash deployments when appropriate. - Make the trained-model HTTP client resilient to alternate endpoint shapes and tolerate certain missing `/health` endpoints for Cerebrium-style backends. ### Description - CI workflow: added a new `disable_core_trading` boolean input and gated the Core run with `!inputs.disable_core_trading`, and loosened an AI run dependency so the Cerebrium AI job can proceed without the warm step outcome. - Email notifier: stopped synthesizing manager-friendly rationales and now returns the model-provided `decision_reason`/`reason`, added `performance_period_start` to report output and display, and added an AI runtime section for `subject_tag == 'AI'` to show backend/model/status/fallback/router info. - Positions & main reporting: added `get_performance_period_start` to `PositionTracker` and populate `performance_period_start` for both Core and AI reports in `main.py`. - LLM prediction logic: implemented soft neutral-breakout logic in `llm_trader.py` that can convert a neutral prediction into a directional signal based on class probabilities and `soft_cash_deploy_enabled`, with per-run awareness of existing open positions. - Trained model client: added retry logic that will try an alternate prediction URL on `404`, a helper `_alternate_prediction_url`, and special-casing in `wait_until_ready` to treat certain `404` health failures for Cerebrium providers as a skipped health probe so inference can proceed. ### Testing - Ran the repository's automated test suite via `pytest` and the CI workflow smoke runs; the automated tests completed successfully. - Exercised the modified `daily_trading_bot` workflow inputs via manual dispatch (AI-only and Core-disabled cases) in CI to validate gating logic. - Performed local integration checks of trained-model client behavior against synthetic endpoints to verify alternate-URL retry and health-probe fallback behavior.
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.
No description provided.