refactor(a2a): tools._load_config reads config through load_config_readonly
The 6-line try/except copy of "load_config() or {}" (also in doctor_live and
kanban_decompose, hermes_cli lane) took a full deepcopy per tool call for a
dict that is only read. load_config_readonly already degrades to the
last-known-good / defaults on a broken file, so the outer except was
defense-in-depth around a path that does not raise. Behavior change: none.
Tests already patch tools._load_config by name and continue to pass.
This commit is contained in:
@@ -24,11 +24,9 @@ _ORCHESTRATE_MAX_WORKERS = 6 # max parallel peers for fan-out
|
||||
|
||||
|
||||
def _load_config() -> dict:
|
||||
try:
|
||||
from hermes_cli.config import load_config
|
||||
return load_config() or {}
|
||||
except Exception:
|
||||
return {}
|
||||
"""Read-only view of config.yaml; peers are only read, never mutated (cache-safe)."""
|
||||
from hermes_cli.config import load_config_readonly
|
||||
return load_config_readonly() or {}
|
||||
|
||||
|
||||
def _configured_peers() -> dict:
|
||||
|
||||
Reference in New Issue
Block a user