debug: upgrade logging levels for fallback diagnostics
CI / push-validation (pull_request) Successful in 20s
CI / helm (pull_request) Successful in 24s
CI / lint (pull_request) Successful in 27s
CI / security (pull_request) Successful in 1m0s
CI / build (pull_request) Successful in 3m21s
CI / typecheck (pull_request) Successful in 3m59s
CI / quality (pull_request) Successful in 4m5s
CI / e2e_tests (pull_request) Successful in 4m52s
CI / integration_tests (pull_request) Successful in 9m51s
CI / unit_tests (pull_request) Successful in 10m57s
CI / docker (pull_request) Successful in 1m31s
CI / coverage (pull_request) Successful in 10m57s
CI / status-check (pull_request) Successful in 2s
CI / benchmark-regression (push) Failing after 0s
CI / benchmark-publish (push) Failing after 0s
CI / build (push) Successful in 17s
CI / push-validation (push) Successful in 17s
CI / quality (push) Successful in 32s
CI / helm (push) Successful in 35s
CI / security (push) Successful in 58s
CI / unit_tests (push) Successful in 3m13s
CI / lint (push) Successful in 3m17s
CI / typecheck (push) Successful in 3m56s
CI / integration_tests (push) Successful in 4m15s
CI / docker (push) Successful in 1m41s
CI / e2e_tests (push) Successful in 7m30s
CI / coverage (push) Successful in 14m4s
CI / status-check (push) Successful in 2s

Change fallback LLM creation and invocation logs from DEBUG to WARNING level
so they appear in Robot Framework test output. Also enhance error message to
clearly show which provider failed and why.

This change makes it possible to diagnose why the fallback is not working
by seeing the actual logs in test output instead of having them filtered
as DEBUG level messages.

Logs now include:
- 'Creating fallback LLM instance: anthropic/claude-sonnet-4-20250514'
- 'Fallback LLM created, attempting invocation'
- 'Using cached fallback LLM, attempting invocation'
- 'FALLBACK PROVIDER FAILED: anthropic/claude-sonnet-4-20250514 returned error: [error details]'

This will help diagnose why E2E tests fail with 'both providers exhausted'
when Anthropic should have available credits.
This commit was merged in pull request #10043.
This commit is contained in:
2026-04-16 23:06:53 +00:00
committed by Forgejo
parent f5712787e0
commit 51472c0b37
@@ -587,29 +587,29 @@ class StrategyActor:
try:
# Create or reuse cached fallback LLM
if self._fallback_llm is None:
self._logger.debug(
"Creating fallback LLM instance",
self._logger.warning(
"Creating fallback LLM instance: %s/%s",
_FALLBACK_PROVIDER,
_FALLBACK_MODEL,
plan_id=plan_id,
fallback_provider=_FALLBACK_PROVIDER,
fallback_model=_FALLBACK_MODEL,
)
self._fallback_llm = self._registry.create_llm(
provider_type=_FALLBACK_PROVIDER,
model_id=_FALLBACK_MODEL,
)
self._logger.debug(
"Fallback LLM instance created successfully",
self._logger.warning(
"Fallback LLM created, attempting invocation",
plan_id=plan_id,
)
else:
self._logger.debug(
"Reusing cached fallback LLM instance",
self._logger.warning(
"Using cached fallback LLM, attempting invocation",
plan_id=plan_id,
)
content = self._invoke_llm_with_retry(
self._fallback_llm, messages, plan_id
)
self._logger.info(
self._logger.warning(
"Quota error recovery successful with fallback provider",
plan_id=plan_id,
fallback_provider=_FALLBACK_PROVIDER,
@@ -618,12 +618,12 @@ class StrategyActor:
except Exception as fallback_exc:
# Log the actual fallback error with full context
self._logger.error(
"Fallback provider invocation failed",
"FALLBACK PROVIDER FAILED: %s/%s returned error: %s [%s]",
_FALLBACK_PROVIDER,
_FALLBACK_MODEL,
str(fallback_exc),
type(fallback_exc).__name__,
plan_id=plan_id,
fallback_provider=_FALLBACK_PROVIDER,
fallback_model=_FALLBACK_MODEL,
fallback_error=str(fallback_exc),
fallback_error_type=type(fallback_exc).__name__,
exc_info=True,
)
# Re-raise the original exception to let the caller handle it