From e5dd9550b73eb809a02cf933bbb766e8c17e2c5f Mon Sep 17 00:00:00 2001 From: LEGSTECH Optimizer Date: Mon, 13 Apr 2026 21:31:06 +0000 Subject: [PATCH] fix: resolve Pydantic Literal error preventing pipeline execution The Run model used a strict Literal['baseline', 'explore', 'validate', 'wfv', 'oos'] for the phase field, but the new pipeline emits phases like 'phase1', 'phase2', etc. This resulted in a silent validation failure inside the pipeline loop before MT5 was launched, causing the optimizer to appear 'stuck' without ever opening MT5. Fixed by relaxing the phase field to 'str'. --- data/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/models.py b/data/models.py index 26f4ff2..b374fff 100644 --- a/data/models.py +++ b/data/models.py @@ -100,7 +100,7 @@ class Run(BaseModel): period_start: str period_end: str params: dict[str, Any] # snapshot of all EA inputs used - phase: Literal["baseline", "explore", "validate", "wfv", "oos"] + phase: str hypothesis_id: Optional[str] = None tester_model: int = 0 # 0=Every Tick ini_snapshot: Optional[str] = None # full .ini content for reproducibility