fix(terminal): log disk warning check failures at debug level (salvage #2372) (#2394)

* fix(terminal): log disk warning check failures at debug level

* fix(terminal): guard _check_disk_usage_warning by moving scratch_dir into try

---------

Co-authored-by: aydnOktay <xaydinoktay@gmail.com>
This commit is contained in:
Teknium 2026-03-21 17:10:17 -07:00 committed by GitHub
parent 1d28b4699b
commit 0ea7d0ec80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View file

@ -75,9 +75,9 @@ DISK_USAGE_WARNING_THRESHOLD_GB = float(os.getenv("TERMINAL_DISK_WARNING_GB", "5
def _check_disk_usage_warning():
"""Check if total disk usage exceeds warning threshold."""
scratch_dir = _get_scratch_dir()
try:
scratch_dir = _get_scratch_dir()
# Get total size of hermes directories
total_bytes = 0
import glob
@ -98,6 +98,7 @@ def _check_disk_usage_warning():
return False
except Exception as e:
logger.debug("Disk usage warning check failed: %s", e, exc_info=True)
return False