nnnet
305ecac8b2
feat(providers): extend `enabled: false` gate to built-in resolution
...
The first commit's gate sat inside ``_get_named_custom_provider`` —
which only handles user-defined custom blocks. Built-in provider names
(``openai`` / ``anthropic`` / ``openrouter`` / ``gemini`` / ...) have
their own resolution paths in ``resolve_runtime_provider`` (pool /
explicit / generic / ``resolve_provider``) and bypass that gate.
So a user who flipped ``providers.openrouter.enabled: false`` would
still see OpenRouter resolved when something explicitly requested it
(e.g. a fallback chain entry). That defeats the point of the flag.
This commit moves the gate one level up: right after
``requested_provider`` is computed, before any custom / built-in /
Azure short-circuit. It now raises a typed ``ValueError`` referencing
the YAML path, so callers can recognise it and advance to the next
fallback instead of silently using a disabled provider.
3 new tests cover:
* disabled custom provider raises
* disabled built-in provider raises
* enabled provider doesn't hit the gate
All 20 tests in the providers suite pass.
2026-07-20 03:06:02 -07:00
..
2026-07-17 15:47:08 -07:00
2026-06-28 05:49:21 -07:00
2026-07-01 02:18:56 -07:00
2026-07-20 02:25:44 -07:00
2026-07-17 20:55:24 +00:00
2026-07-11 03:51:43 -07:00
2026-07-17 11:37:25 +05:30
2026-07-02 13:17:41 -07:00
2026-07-10 17:50:43 +05:30
2026-07-16 06:14:56 -07:00
2026-07-16 22:56:45 -04:00
2026-07-02 13:17:41 -07:00
2026-07-17 19:16:48 -04:00
2026-07-16 22:24:45 -07:00
2026-07-11 12:28:55 +05:30
2026-07-18 14:01:33 -07:00
2026-07-06 11:17:41 -07:00
2026-07-15 09:59:38 -07:00
2026-07-18 14:30:24 +05:30
2026-07-18 02:49:28 -07:00
2026-07-18 14:01:56 -07:00
2026-07-16 15:45:07 +00:00
2026-07-10 00:47:51 +05:30
2026-07-01 23:51:54 +05:30
2026-07-12 00:26:49 -07:00
2026-07-09 18:23:18 -07:00
2026-07-20 02:25:33 -07:00
2026-07-20 03:06:02 -07:00
2026-07-12 03:05:12 -07:00
2026-07-17 04:33:34 -07:00
2026-07-16 14:30:05 +10:00
2026-07-05 00:44:15 -07:00
2026-06-30 03:27:41 -07:00
2026-07-19 03:02:21 -07:00
2026-07-09 14:30:16 +05:30
2026-07-17 04:58:35 -07:00
2026-07-06 02:21:32 -07:00
2026-07-06 12:26:21 -07:00
2026-07-11 12:28:55 +05:30
2026-07-05 00:55:51 -07:00
2026-07-02 04:51:56 +05:30
2026-07-19 03:48:48 -07:00
2026-07-14 07:02:05 -07:00
2026-07-14 07:02:05 -07:00
2026-06-29 04:25:18 -07:00
2026-07-09 12:21:16 +05:30
2026-07-06 03:18:02 -07:00
2026-07-03 20:18:00 +05:30
2026-07-16 19:49:39 -04:00
2026-07-09 12:21:16 +05:30
2026-07-09 14:48:50 +05:30
2026-07-01 00:38:17 -07:00
2026-07-09 16:13:59 -05:00
2026-07-01 02:18:56 -07:00
2026-06-30 17:29:23 -07:00
2026-07-19 01:09:04 -07:00
2026-07-02 19:52:18 -05:00
2026-07-17 15:01:54 -04:00
2026-06-28 22:53:56 -07:00
2026-07-19 03:02:21 -07:00
2026-06-28 18:53:00 -07:00
2026-07-18 19:01:10 -04:00
2026-07-16 07:19:36 -07:00
2026-07-11 05:43:35 -07:00
2026-07-16 05:08:56 -07:00
2026-07-01 02:48:36 -07:00
2026-07-18 20:01:55 +05:30
2026-07-20 12:11:07 +05:30
2026-06-28 18:05:28 -05:00
2026-07-15 07:39:17 -07:00
2026-07-10 00:47:51 +05:30
2026-07-16 20:45:05 -04:00
2026-07-09 20:03:11 -07:00
2026-07-15 07:39:42 -07:00
2026-07-05 05:35:44 -07:00
2026-07-19 19:33:49 -04:00
2026-07-18 02:31:20 -07:00
2026-07-01 16:25:48 -05:00
2026-07-15 07:39:17 -07:00
2026-07-16 07:33:14 -07:00
2026-07-12 23:09:41 -07:00
2026-07-15 07:39:17 -07:00
2026-07-09 16:13:59 -05:00
2026-07-15 07:39:17 -07:00
2026-07-11 03:51:43 -07:00
2026-06-28 02:44:04 -07:00
2026-07-20 03:06:02 -07:00
2026-07-12 03:08:08 -07:00
2026-07-05 19:10:00 -07:00
2026-07-15 04:56:25 -07:00
2026-07-17 04:50:47 -07:00
2026-07-17 04:50:47 -07:00
2026-07-07 04:09:35 -07:00
2026-07-05 23:00:34 +05:30
2026-07-17 13:49:12 -07:00
2026-07-15 00:10:31 -07:00
2026-07-20 03:06:02 -07:00
2026-07-03 03:33:06 -07:00
2026-07-06 02:46:24 -07:00
2026-07-20 03:06:02 -07:00
2026-07-12 03:04:07 -07:00
2026-07-18 14:01:56 -07:00
2026-07-17 15:47:08 -07:00
2026-07-20 02:22:22 -07:00
2026-07-14 03:11:19 -07:00
2026-07-16 13:33:02 -07:00
2026-07-20 02:25:44 -07:00
2026-07-18 07:05:58 -07:00
2026-07-01 05:06:00 -07:00
2026-07-02 06:52:46 +00:00
2026-07-07 00:53:56 -07:00
2026-07-06 11:10:51 -07:00
2026-06-27 21:23:25 -07:00
2026-07-07 21:13:19 -07:00
2026-07-01 04:05:15 -07:00
2026-07-06 04:38:17 -07:00
2026-07-06 11:20:47 -07:00
2026-07-07 15:14:30 -07:00
2026-07-15 07:39:17 -07:00
2026-07-05 00:48:50 -07:00
2026-07-05 19:13:20 -07:00
2026-07-05 11:44:53 +05:30
2026-06-27 21:23:25 -07:00
2026-07-20 00:41:21 -07:00
2026-07-07 00:53:48 -07:00
2026-07-20 02:22:22 -07:00
2026-07-18 14:30:24 +05:30
2026-07-11 05:43:07 -07:00
2026-07-07 02:32:32 -07:00
2026-06-30 17:58:52 -05:00
2026-06-29 21:33:00 +10:00
2026-07-09 19:54:02 -07:00
2026-07-09 16:46:07 -07:00
2026-07-07 12:36:41 -07:00
2026-07-09 19:54:02 -07:00
2026-07-05 22:04:52 -07:00
2026-07-03 13:44:00 -07:00
2026-07-17 04:53:38 -07:00
2026-07-05 23:01:10 -07:00
2026-07-07 15:12:49 -07:00
2026-07-16 05:44:43 -07:00
2026-07-05 14:51:49 -07:00
2026-07-09 20:03:11 -07:00
2026-07-05 13:42:46 -07:00
2026-07-09 19:57:54 -07:00
2026-07-14 13:58:36 -07:00
2026-07-02 04:59:02 -07:00
2026-06-30 04:38:43 -07:00
2026-07-16 05:44:43 -07:00
2026-07-16 05:08:56 -07:00
2026-07-18 14:30:24 +05:30
2026-07-16 01:19:29 -07:00
2026-07-18 20:01:55 +05:30
2026-07-08 07:09:08 -07:00
2026-07-19 05:22:10 -07:00
2026-07-16 01:17:11 -07:00
2026-07-18 17:17:25 -04:00
2026-07-20 12:59:28 +05:30
2026-07-07 05:12:24 -07:00
2026-06-28 02:40:37 -07:00
2026-07-05 19:35:30 -07:00
2026-07-03 04:08:37 -07:00
2026-07-15 00:09:24 +05:30
2026-07-11 12:28:55 +05:30
2026-07-19 19:59:46 -04:00
2026-06-28 17:02:05 -05:00
2026-07-01 05:25:33 -07:00
2026-07-09 12:21:16 +05:30
2026-07-17 04:33:34 -07:00
2026-07-19 09:57:21 -07:00
2026-07-04 17:58:05 +05:30
2026-07-08 00:20:13 +00:00
2026-06-28 16:29:52 -05:00
2026-07-16 07:17:55 -07:00
2026-07-07 13:54:07 -07:00
2026-07-16 00:02:09 +05:30
2026-06-28 03:58:18 -07:00
2026-07-03 15:22:43 -05:00
2026-07-19 19:59:46 -04:00
2026-07-16 15:45:07 +00:00
2026-07-16 12:36:51 +05:30
2026-07-07 17:45:51 -07:00
2026-07-02 13:17:41 -07:00
2026-07-02 13:17:41 -07:00
2026-07-09 16:58:37 -07:00