Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cron/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,13 +835,13 @@ def load_jobs() -> List[Dict[str, Any]]:
_strict_retry = False # track whether we used the strict=False fallback

try:
with open(jobs_file, 'r', encoding='utf-8') as f:
with open(jobs_file, 'r', encoding='utf-8-sig') as f:
data = json.load(f)
except json.JSONDecodeError:
# Retry with strict=False to handle bare control chars in string values
_strict_retry = True
try:
with open(jobs_file, 'r', encoding='utf-8') as f:
with open(jobs_file, 'r', encoding='utf-8-sig') as f:
data = json.loads(f.read(), strict=False)
except Exception as e:
logger.error("Failed to auto-repair jobs.json: %s", e)
Expand Down
2 changes: 1 addition & 1 deletion hermes_cli/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _cron_summary(hermes_home: Path) -> str:
if not jobs_file.exists():
return "0"
try:
with open(jobs_file, encoding="utf-8") as f:
with open(jobs_file, encoding="utf-8-sig") as f:
data = json.load(f)
jobs = data.get("jobs", [])
active = sum(1 for j in jobs if j.get("enabled", True))
Expand Down
2 changes: 1 addition & 1 deletion hermes_cli/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def _resolve_env(env_ref) -> str:
if jobs_file.exists():
import json
try:
with open(jobs_file, encoding="utf-8") as f:
with open(jobs_file, encoding="utf-8-sig") as f:
data = json.load(f)
jobs = data.get("jobs", [])
enabled_jobs = [j for j in jobs if j.get("enabled", True)]
Expand Down
Loading