fix(providers): add ProviderType.GEMINI to ProviderRegistry.FALLBACK_ORDER
CI / benchmark-publish (pull_request) Has been skipped
CI / push-validation (pull_request) Successful in 53s
CI / helm (pull_request) Successful in 1m1s
CI / build (pull_request) Successful in 1m17s
CI / lint (pull_request) Successful in 1m39s
CI / benchmark-regression (pull_request) Failing after 1m28s
CI / typecheck (pull_request) Successful in 1m43s
CI / security (pull_request) Successful in 1m44s
CI / quality (pull_request) Successful in 1m51s
CI / e2e_tests (pull_request) Successful in 4m32s
CI / integration_tests (pull_request) Failing after 7m42s
CI / unit_tests (pull_request) Failing after 9m8s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 3s

Add GEMINI to the provider fallback chain so Gemini-only users can get a
default provider via auto-discovery without setting GOOGLE_API_KEY. The
GEMINI enum value, capabilities, default model, and API key mapping were
already defined but the type was missing from both ProviderRegistry.FALLBACK_ORDER
and FallbackSelector.DEFAULT_FALLBACK_ORDER.

Also convert the TDD @tdd_expected_fail regression test to a permanent guard
by removing the inversion tag since the bug is fixed.

ISSUES CLOSED: #10906
This commit is contained in:
2026-05-06 08:59:58 +00:00
parent f2d1f4efe7
commit 51c22b69e2
6 changed files with 25 additions and 7 deletions
+14
View File
@@ -7,6 +7,20 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Fixed
- **ProviderType.GEMINI missing from ProviderRegistry.FALLBACK_ORDER** (#10906, #4750):
Added `ProviderType.GEMINI` to both `ProviderRegistry.FALLBACK_ORDER` (after
`ProviderType.GOOGLE`) and `FallbackSelector.DEFAULT_FALLBACK_ORDER` (after
`"google"`). The GEMINI enum value, capabilities, default model, and API key mapping
were already defined in the registry but Gemini-only users could not get a provider
via the fallback chain — `get_default_provider_type()` returned ``None`` when only
``GEMINI_API_KEY`` was set. Also removed the ``@tdd_expected_fail`` tag from the
Behave regression test (`features/tdd_gemini_fallback_order_4750.feature`) since the
bug is now resolved and the test must pass normally.
### Fixed
- **Cross-actor subgraph cycle detection reads actor_ref field** (#1431): Fixed
- **Cross-actor subgraph cycle detection reads actor_ref field** (#1431): Fixed
`_detect_subgraph_cycles()`, `_map_node()`, and the `compile_actor()` main loop
in `src/cleveragents/actor/compiler.py` to read `actor_ref` from the top-level
+1
View File
@@ -31,3 +31,4 @@ Below are some of the specific details of various contributions.
* HAL 9000 has contributed comprehensive milestone documentation for v3.6.0 (Advanced Concepts & Deferred Features) and v3.7.0 (TUI Implementation) (PR #9903): split into sub-documents covering context strategies, LLM backends, resource types, A2A rename, container tool execution, scope chain resolution, cost/safety budgets, E2E workflow tests, code review examples, plugin architecture, TUI layout, persona system, reference/command input, session management, configuration, and TuiMaterializer integration.
* HAL 9000 has contributed the LLMTraceRepository data-integrity fix (PR #8185 / issue #7505): replaced the unconditional `session.commit()` in `LLMTraceRepository.save()` with a dual-path implementation that respects the UnitOfWork pattern — flushing only when an external session is provided, and flushing + committing + closing when operating standalone. This eliminates premature transaction commits, loss of rollback capability, and a docstring/implementation mismatch.
* HAL 9000 has contributed the ACMS Index Data Model and File Traversal Engine (PR #9664 / issue #9579): foundational data structures for indexed context entries with hot/warm/cold/archive storage tier classification, tag system, and a timeout-safe chunked file traversal engine for large projects with 10,000+ files.
* HAL 9000 has contributed the ProviderType.GEMINI fallback order fix (PR #10906 / issue #4750): added GEMINI to both ProviderRegistry.FALLBACK_ORDER and FallbackSelector.DEFAULT_FALLBACK_ORDER so Gemini-only users can get a default provider via the fallback chain, and converted the TDD @tdd_expected_fail regression test to a permanent guard.
@@ -2,14 +2,15 @@
Issue: #4750 — ProviderType.GEMINI missing from ProviderRegistry.FALLBACK_ORDER
TDD Issue: #10896
Fixed by: PR #10906
This test captures the bug: when only GEMINI_API_KEY is set (without GOOGLE_API_KEY),
get_default_provider_type() returns None instead of ProviderType.GEMINI because
GEMINI is absent from FALLBACK_ORDER.
This test captures the regression that was fixed when ProviderType.GEMINI was added
to both ProviderRegistry.FALLBACK_ORDER and FallbackSelector.DEFAULT_FALLBACK_ORDER.
Previously, get_default_provider_type() returned None instead of ProviderType.GEMINI
when only GEMINI_API_KEY was set (without GOOGLE_API_KEY) because GEMINI was absent
from FALLBACK_ORDER.
The @tdd_expected_fail tag inverts the result so CI passes while the bug exists.
Once the fix is applied (adding ProviderType.GEMINI to FALLBACK_ORDER), the
@tdd_expected_fail tag must be removed and the test must pass normally.
The @tdd_expected_fail tag has been removed — this is now a permanent regression guard.
"""
from __future__ import annotations
@@ -3,7 +3,7 @@ Feature: TDD: ProviderType.GEMINI missing from ProviderRegistry.FALLBACK_ORDER
I want get_default_provider_type() to return ProviderType.GEMINI via the fallback chain
So that Gemini-only users can use auto-discovery without setting GOOGLE_API_KEY
@tdd_issue @tdd_issue_4750 @tdd_expected_fail
@tdd_issue @tdd_issue_4750
Scenario: Gemini-only user gets GEMINI as default provider via fallback order
Given a ProviderRegistry configured with only gemini_api_key set
And CLEVERAGENTS_DEFAULT_PROVIDER is not set for tdd test
@@ -64,6 +64,7 @@ class FallbackSelector:
"openai",
"anthropic",
"google",
"gemini",
"azure",
"openrouter",
"groq",
+1
View File
@@ -220,6 +220,7 @@ class ProviderRegistry:
ProviderType.OPENAI,
ProviderType.ANTHROPIC,
ProviderType.GOOGLE,
ProviderType.GEMINI,
ProviderType.AZURE,
ProviderType.OPENROUTER,
ProviderType.GROQ,