fix: use config models when empty models list provided

When the trigger simulation API receives an empty models list ([]),
it now correctly falls back to enabled models from config instead
of running with no models.

Changes:
- Update condition to check for both None and empty list
- Add test case for empty models list behavior
- Update API documentation to clarify this behavior

All 28 integration tests pass.
This commit is contained in:
2025-11-02 09:07:58 -05:00
parent 34d3317571
commit aa4958bd9c
3 changed files with 15 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ Trigger a new simulation job for a specified date range and models.
|-------|------|----------|-------------|
| `start_date` | string \| null | No | Start date in YYYY-MM-DD format. If `null`, enables resume mode (each model continues from its last completed date). Defaults to `null`. |
| `end_date` | string | **Yes** | End date in YYYY-MM-DD format. **Required** - cannot be null or empty. |
| `models` | array[string] | No | Model signatures to run. If omitted, uses all enabled models from server config. |
| `models` | array[string] | No | Model signatures to run. If omitted or empty array, uses all enabled models from server config. |
| `replace_existing` | boolean | No | If `false` (default), skips already-completed model-days (idempotent). If `true`, re-runs all dates even if previously completed. |
**Response (200 OK):**