fix: load credentials from HERMES_HOME .env in trajectory_compressor

This commit is contained in:
Dusk1e 2026-04-14 14:49:57 +03:00 committed by Teknium
parent 8a002d4efc
commit 4b47856f90
2 changed files with 24 additions and 4 deletions

View file

@ -43,12 +43,15 @@ from datetime import datetime
import fire
from rich.progress import Progress, SpinnerColumn, TextColumn, BarColumn, TaskProgressColumn, TimeElapsedColumn, TimeRemainingColumn
from rich.console import Console
from hermes_constants import OPENROUTER_BASE_URL
from hermes_constants import OPENROUTER_BASE_URL, get_hermes_home
from agent.retry_utils import jittered_backoff
# Load environment variables
from dotenv import load_dotenv
load_dotenv()
# Load .env from HERMES_HOME first, then project root as a dev fallback.
from hermes_cli.env_loader import load_hermes_dotenv
_hermes_home = get_hermes_home()
_project_env = Path(__file__).parent / ".env"
load_hermes_dotenv(hermes_home=_hermes_home, project_env=_project_env)
@dataclass