[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-07-29 05:34:19 +00:00
commit 1ec30c54d1
2 changed files with 3 additions and 3 deletions

View file

@ -1039,7 +1039,6 @@ class TestEndpointAwareOfflineDetection:
)
def test_endpoint_host_parsing(self, monkeypatch, endpoint, expected):
from core.inference.llama_cpp import _hf_endpoint_host
monkeypatch.setenv("HF_ENDPOINT", endpoint)
assert _hf_endpoint_host() == expected
@ -1147,7 +1146,6 @@ class TestHfUnreachableProbe:
"""Stale either way is a bug: a stale 'reachable' hides the plug being pulled,
a stale 'unreachable' fails a download after the user reconnects."""
import utils.utils as uu
assert uu._HF_REACHABILITY_TTL_S <= 10.0
def test_verdict_expires_so_a_disconnect_is_noticed(self, monkeypatch, clean_offline_env):

View file

@ -90,7 +90,9 @@ def hf_endpoint_unreachable(timeout: int = 3, *, gateway_errors_offline: bool =
# the hub itself is down, which callers scoping offline to one operation want
# to treat as offline; callers setting a lifetime flag pass
# gateway_errors_offline=False so a momentary 503 can't strand the process.
result["online"] = True if not gateway_errors_offline else exc.code not in (502, 503, 504)
result["online"] = (
True if not gateway_errors_offline else exc.code not in (502, 503, 504)
)
except urllib.error.URLError as exc:
# A TLS/cert failure means we DID reach the server; treat as reachable so the real
# load surfaces it (consistent with _is_offline_related_error not retrying TLS).