fix(task): tolerate invalid default config in usage cache

This commit is contained in:
rayhpeng
2026-05-15 16:52:11 +08:00
parent eabd78ce4e
commit d7a2fff7e0
2 changed files with 4 additions and 3 deletions
@@ -35,7 +35,7 @@ def _token_usage_cache_enabled(app_config: "AppConfig | None") -> bool:
if app_config is None:
try:
app_config = get_app_config()
except FileNotFoundError:
except (FileNotFoundError, ValueError):
return False
return bool(getattr(getattr(app_config, "token_usage", None), "enabled", False))