fix(provider): preserve static error helper compatibility

This commit is contained in:
haosenwang1018
2026-04-13 09:37:31 +08:00
committed by Xubin Ren
parent c68b3edb9d
commit 3573109408
2 changed files with 15 additions and 6 deletions
+5 -1
View File
@@ -61,7 +61,11 @@ def test_local_provider_502_error_includes_reachability_hint() -> None:
with patch("nanobot.providers.openai_compat_provider.AsyncOpenAI"):
provider = OpenAICompatProvider(api_base="http://localhost:11434/v1", spec=spec)
result = provider._handle_error(Exception("Error code: 502"))
result = provider._handle_error(
Exception("Error code: 502"),
spec=spec,
api_base="http://localhost:11434/v1",
)
assert result.finish_reason == "error"
assert "local model endpoint" in result.content