mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-06 02:41:48 +00:00
fix(delegate): guard _load_config() against delegation: null in config.yaml
YAML parses `delegation: null` as Python None. `dict.get(key, {})`
only uses the default when the key is *missing*, not when it exists with
a None value, so `cfg.get("max_concurrent_children")` crashes with
`'NoneType' object has no attribute 'get'`.
Same pattern as fd9b692d (fix(tui): tolerate null top-level sections).
Use `dict.get(key) or {}` to handle both missing and None-valued keys.
Closes: delegation null config crash (same class as #7215, #7346)
This commit is contained in:
parent
2d3d1d9736
commit
d17eff29d5
1 changed files with 2 additions and 2 deletions
|
|
@ -2337,7 +2337,7 @@ def _load_config() -> dict:
|
|||
try:
|
||||
from cli import CLI_CONFIG
|
||||
|
||||
cfg = CLI_CONFIG.get("delegation", {})
|
||||
cfg = CLI_CONFIG.get("delegation") or {}
|
||||
if cfg:
|
||||
return cfg
|
||||
except Exception:
|
||||
|
|
@ -2346,7 +2346,7 @@ def _load_config() -> dict:
|
|||
from hermes_cli.config import load_config
|
||||
|
||||
full = load_config()
|
||||
return full.get("delegation", {})
|
||||
return full.get("delegation") or {}
|
||||
except Exception:
|
||||
return {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue