fix: commit semantic repair changes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
# [DEF:backend.src.plugins.llm_analysis.__tests__.test_client_headers:Module]
|
||||
# [DEF:TestClientHeaders:Module]
|
||||
# @RELATION: BELONGS_TO -> SrcRoot
|
||||
# @COMPLEXITY: 3
|
||||
# @SEMANTICS: tests, llm-client, openrouter, headers
|
||||
# @PURPOSE: Verify OpenRouter client initialization includes provider-specific headers.
|
||||
@@ -8,6 +9,7 @@ from src.plugins.llm_analysis.service import LLMClient
|
||||
|
||||
|
||||
# [DEF:test_openrouter_client_includes_referer_and_title_headers:Function]
|
||||
# @RELATION: BINDS_TO -> TestClientHeaders
|
||||
# @PURPOSE: OpenRouter requests should carry site/app attribution headers for compatibility.
|
||||
# @PRE: Client is initialized for OPENROUTER provider.
|
||||
# @POST: Async client headers include Authorization, HTTP-Referer, and X-Title.
|
||||
@@ -27,4 +29,4 @@ def test_openrouter_client_includes_referer_and_title_headers(monkeypatch):
|
||||
assert headers["HTTP-Referer"] == "http://localhost:8000"
|
||||
assert headers["X-Title"] == "ss-tools-test"
|
||||
# [/DEF:test_openrouter_client_includes_referer_and_title_headers:Function]
|
||||
# [/DEF:backend.src.plugins.llm_analysis.__tests__.test_client_headers:Module]
|
||||
# [/DEF:TestClientHeaders:Module]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# [DEF:backend.src.plugins.llm_analysis.__tests__.test_service:Module]
|
||||
# [DEF:TestService:Module]
|
||||
# @RELATION: BELONGS_TO -> SrcRoot
|
||||
# @COMPLEXITY: 3
|
||||
# @SEMANTICS: tests, llm-analysis, fallback, provider-error, unknown-status
|
||||
# @PURPOSE: Verify LLM analysis transport/provider failures do not masquerade as dashboard FAIL results.
|
||||
@@ -10,6 +11,7 @@ from src.plugins.llm_analysis.service import LLMClient
|
||||
|
||||
|
||||
# [DEF:test_test_runtime_connection_uses_json_completion_transport:Function]
|
||||
# @RELATION: BINDS_TO -> TestService
|
||||
# @PURPOSE: Provider self-test must exercise the same chat completion transport as runtime analysis.
|
||||
# @PRE: get_json_completion is available on initialized client.
|
||||
# @POST: Self-test forwards a lightweight user message into get_json_completion and returns its payload.
|
||||
@@ -38,6 +40,7 @@ async def test_test_runtime_connection_uses_json_completion_transport(monkeypatc
|
||||
|
||||
|
||||
# [DEF:test_analyze_dashboard_provider_error_maps_to_unknown:Function]
|
||||
# @RELATION: BINDS_TO -> TestService
|
||||
# @PURPOSE: Infrastructure/provider failures must produce UNKNOWN analysis status rather than FAIL.
|
||||
# @PRE: LLMClient.get_json_completion raises provider/auth exception.
|
||||
# @POST: Returned payload uses status=UNKNOWN and issue severity UNKNOWN.
|
||||
@@ -64,4 +67,4 @@ async def test_analyze_dashboard_provider_error_maps_to_unknown(monkeypatch, tmp
|
||||
assert "Failed to get response from LLM" in result["summary"]
|
||||
assert result["issues"][0]["severity"] == "UNKNOWN"
|
||||
# [/DEF:test_analyze_dashboard_provider_error_maps_to_unknown:Function]
|
||||
# [/DEF:backend.src.plugins.llm_analysis.__tests__.test_service:Module]
|
||||
# [/DEF:TestService:Module]
|
||||
|
||||
Reference in New Issue
Block a user