fix: fail closed when LLM provider is unavailable#291
Draft
tuodijihua wants to merge 1 commit into
Draft
Conversation
Signed-off-by: tuodijihua <158809980+tuodijihua@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevent a requested deep scan from returning
SAFEwhen the configured LLM provider is unavailable but analyzer nodes record mixed success/failure telemetry.When this condition is detected, the report now:
SAFErecommendation toCAUTIONFixes #290.
Root cause
report()previously inferred degradation only from aggregate call-log counts. Some analyzer nodes can catch a provider exception and still record successful fallback work, so the log may contain both successes and failures even thoughis_llm_available()is false. That prevented the existing all-calls-failed degradation path from activating.This change combines the provider availability check with evidence of at least one real LLM call failure. The guard is intentionally narrow: it only applies when deep scanning was requested, the provider is unavailable, and the call log contains a failure.
User impact
Without this guard, automation can treat a static-only result as a successful deep scan and allow installation based on a
SAFErecommendation. The newCAUTIONfloor makes the degradation visible to callers without overridingDANGERorBLOCKresults.Validation
uv run pytest tests/nodes/test_report.py -q— 61 passeduv run ruff check src/skillspector/nodes/report.py tests/nodes/test_report.py— passedgit diff origin/main...HEAD --check— passedScope
This patch does not attempt to redesign analyzer telemetry. It adds a report-layer fail-closed guard and a regression test for the mixed-telemetry case.