fix: fail closed when LLM provider is unavailable - #291
Conversation
Signed-off-by: tuodijihua <[email protected]>
|
@tuodijihua - Please resolve merge conflicts |
…navailable-provider Signed-off-by: tuodijihua <[email protected]> # Conflicts: # src/skillspector/nodes/report.py
808a7c7 to
8712ca6
Compare
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Approved. A requested deep scan now fails closed when provider unavailability is corroborated by recorded runtime failure, without changing score/severity or over-flooring clean runs. The focused regression and required CI are green.
rng1995
left a comment
There was a problem hiding this comment.
Updated-head re-review: the fail-closed guard remains narrowly scoped to requested LLM analysis with both provider unavailability and a recorded call failure. It only floors SAFE to CAUTION; score, severity, stronger verdicts, no-LLM scans, and clean deep scans remain unchanged. Fresh CI on head 1f70515 is the merge gate.
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.