Issue: Profile model configuration is ignored when using -p flag
Bug Description
When running Hermes with a specific profile (hermes -p <profile> chat), the model configured in that profile's config.yaml is not being used. Instead, Hermes falls back to the hardcoded default model (anthropic/claude-opus-4.6).
Environment
- Hermes version: 0.6.0 (2026.3.30)
- OS: Linux
- Python: 3.12.3
Reproduction Steps
- Create a profile with a specific model:
hermes profile create orchestrator
- Configure
~/.hermes/profiles/orchestrator/config.yaml:
model:
provider: fireworks
model: fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo
api_key: <your-key>
- Verify profile shows correct model:
$ hermes profile show orchestrator
Profile: orchestrator
Model: fireworks-ai/accounts/fireworks/routers/kimi-k2p5-turbo ✅
- Run with profile:
$ hermes -p orchestrator chat
⚕ claude-opus-4.6 · 0:05 ❌ Wrong model!
Expected Behavior
When running hermes -p orchestrator chat, the CLI should use the model from ~/.hermes/profiles/orchestrator/config.yaml.
Actual Behavior
The CLI uses the hardcoded default model claude-opus-4.6, ignoring the profile config.
Root Cause Analysis
The issue is a timing problem in the config loading sequence:
-
In cli.py line 465:
CLI_CONFIG = load_cli_config()
This is evaluated at module import time.
-
In hermes_cli/main.py:
_apply_profile_override() # Sets HERMES_HOME based on -p flag
# ...later...
from cli import HermesCLI # cli.py is imported AFTER profile override
BUT load_cli_config() at line 135 uses:
user_config_path = _hermes_home / "config.yaml"
Where _hermes_home is evaluated at module load time (line 76):
_hermes_home = get_hermes_home() # Cached before profile override
-
Result: CLI_CONFIG loads from the default ~/.hermes/config.yaml, not the profile's config.
Affected Code Locations
cli.py line 135:
user_config_path = _hermes_home / 'config.yaml' # Uses cached value
cli.py line 76:
_hermes_home = get_hermes_home() # Evaluated before profile override
cli.py line 1097-1099 (HermesCLI.__init__):
_model_config = CLI_CONFIG.get("model", {})
_config_model = (_model_config.get("default") or _model_config.get("model") or "")
self.model = model or _config_model or _DEFAULT_CONFIG_MODEL # Falls back to opus
Workaround
Until this is fixed, users must:
- Set the model in the root
~/.hermes/config.yaml instead of profile configs
- Or add
default: <model> to profile configs (in addition to model:)
Suggested Fix
Change cli.py line 135 to use get_hermes_home() directly instead of the cached _hermes_home:
- user_config_path = _hermes_home / 'config.yaml'
+ user_config_path = get_hermes_home() / 'config.yaml'
This ensures the current HERMES_HOME env var is read each time load_cli_config() is called.
Additional Context
This bug defeats the purpose of profile-based configurations. Users expect profiles to be self-contained, but currently the root config's defaults interfere with profile configs due to the merge behavior + hardcoded fallback.
Labels
- bug
- config
- profiles
- high-priority
Issue: Profile model configuration is ignored when using
-pflagBug Description
When running Hermes with a specific profile (
hermes -p <profile> chat), the model configured in that profile'sconfig.yamlis not being used. Instead, Hermes falls back to the hardcoded default model (anthropic/claude-opus-4.6).Environment
Reproduction Steps
~/.hermes/profiles/orchestrator/config.yaml:$ hermes -p orchestrator chat ⚕ claude-opus-4.6 · 0:05 ❌ Wrong model!Expected Behavior
When running
hermes -p orchestrator chat, the CLI should use the model from~/.hermes/profiles/orchestrator/config.yaml.Actual Behavior
The CLI uses the hardcoded default model
claude-opus-4.6, ignoring the profile config.Root Cause Analysis
The issue is a timing problem in the config loading sequence:
In
cli.pyline 465:This is evaluated at module import time.
In
hermes_cli/main.py:BUT
load_cli_config()at line 135 uses:Where
_hermes_homeis evaluated at module load time (line 76):Result:
CLI_CONFIGloads from the default~/.hermes/config.yaml, not the profile's config.Affected Code Locations
cli.pyline 135:cli.pyline 76:cli.pyline 1097-1099 (HermesCLI.__init__):Workaround
Until this is fixed, users must:
~/.hermes/config.yamlinstead of profile configsdefault: <model>to profile configs (in addition tomodel:)Suggested Fix
Change
cli.pyline 135 to useget_hermes_home()directly instead of the cached_hermes_home:This ensures the current
HERMES_HOMEenv var is read each timeload_cli_config()is called.Additional Context
This bug defeats the purpose of profile-based configurations. Users expect profiles to be self-contained, but currently the root config's defaults interfere with profile configs due to the merge behavior + hardcoded fallback.
Labels