mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-05 07:41:39 +00:00
fix(cron): gracefully degrade when runtime profile is deleted
Instead of raising FileNotFoundError (which silently bricks the job), log a warning and fall back to the scheduler default home. Validates at create/update time still catches typos. Idea from PR #19958.
This commit is contained in:
parent
1d74d7f73a
commit
ef5fe8dfaf
2 changed files with 25 additions and 11 deletions
|
|
@ -175,7 +175,16 @@ def _job_profile_context(job_id: str, profile: Optional[str]):
|
|||
from hermes_constants import reset_hermes_home_override, set_hermes_home_override
|
||||
|
||||
normalized_profile = normalize_profile_name(raw_profile)
|
||||
profile_home = Path(resolve_profile_env(normalized_profile)).resolve()
|
||||
try:
|
||||
profile_home = Path(resolve_profile_env(normalized_profile)).resolve()
|
||||
except (FileNotFoundError, ValueError) as exc:
|
||||
logger.warning(
|
||||
"Job '%s': configured profile %r no longer valid (%s) — "
|
||||
"falling back to scheduler default",
|
||||
job_id, raw_profile, exc,
|
||||
)
|
||||
yield None
|
||||
return
|
||||
|
||||
override_token = None
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue