From b56501a1cf09e27d2b20cdebeadbaf83d7b01bf5 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 1 Aug 2026 13:27:41 +0000 Subject: [PATCH] no-mistakes(review): Guard infisical-token fallback read against OSError crashes --- scripts/agent-health-check.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/agent-health-check.py b/scripts/agent-health-check.py index 25261c2..f9c85d6 100755 --- a/scripts/agent-health-check.py +++ b/scripts/agent-health-check.py @@ -61,8 +61,11 @@ INFISICAL_API_URL = os.environ.get("INFISICAL_API_URL", "https://vault.sysloggh. if not INFISICAL_TOKEN: _token_path = os.path.expanduser("~/.infisical-token") if os.path.isfile(_token_path): - with open(_token_path) as _f: - INFISICAL_TOKEN = _f.read().strip() + try: + with open(_token_path) as _f: + INFISICAL_TOKEN = _f.read().strip() + except (OSError, UnicodeDecodeError): + pass # ── Helpers ──────────────────────────────────────────────────────────