mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-24 05:41:40 +00:00
fix: guard resolve_profile_env against missing profile dirs
The _default_spawn HERMES_HOME injection (PR #23356) calls resolve_profile_env which raises FileNotFoundError when the profile dir doesn't exist. In production the profile always exists (workers are only dispatched for live profiles), but tests with isolated HERMES_HOME never create profile dirs. Catch FileNotFoundError and fall through — HERMES_PROFILE is still set below, so the worker CLI resolves the profile at startup.
This commit is contained in:
parent
7087702210
commit
5712483487
1 changed files with 8 additions and 1 deletions
|
|
@ -3941,7 +3941,14 @@ def _default_spawn(
|
||||||
# profile-specific config entirely. Fixes profile-scoped fallback_providers
|
# profile-specific config entirely. Fixes profile-scoped fallback_providers
|
||||||
# being invisible to kanban workers.
|
# being invisible to kanban workers.
|
||||||
from hermes_cli.profiles import resolve_profile_env
|
from hermes_cli.profiles import resolve_profile_env
|
||||||
env["HERMES_HOME"] = resolve_profile_env(profile_arg)
|
try:
|
||||||
|
env["HERMES_HOME"] = resolve_profile_env(profile_arg)
|
||||||
|
except FileNotFoundError:
|
||||||
|
# Profile dir doesn't exist — defer resolution to the CLI's
|
||||||
|
# _apply_profile_override() via HERMES_PROFILE (set below).
|
||||||
|
# This only happens in test fixtures where the isolated
|
||||||
|
# HERMES_HOME never had profiles created.
|
||||||
|
pass
|
||||||
if task.tenant:
|
if task.tenant:
|
||||||
env["HERMES_TENANT"] = task.tenant
|
env["HERMES_TENANT"] = task.tenant
|
||||||
env["HERMES_KANBAN_TASK"] = task.id
|
env["HERMES_KANBAN_TASK"] = task.id
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue