fix(profiles): skip 'default' in named profiles scan to prevent duplicates

When ~/.hermes/profiles/default/ exists as a directory, list_profiles()
returns 'default' twice: once as the built-in default profile (~/.hermes)
and once from the directory scan (~/.hermes/profiles/default).

This causes the cron dashboard API (profile=all) to read the same
jobs.json twice, showing every default-profile job duplicated in the UI.

Fix: skip name=='default' in the named profiles loop, since it's already
added as the built-in default at the top of the function.

Fixes #39346
This commit is contained in:
islam666 2026-06-05 05:59:16 +00:00 committed by Teknium
parent 9513793ad7
commit f1d3afb151

View file

@ -683,6 +683,8 @@ def list_profiles() -> List[ProfileInfo]:
if not entry.is_dir():
continue
name = entry.name
if name == "default":
continue # already added as the built-in default above
if not _PROFILE_ID_RE.match(name):
continue
model, provider = _read_config_model(entry)