From 3bee76a2729af2fadcfcfb7ac6b16419f48d3df6 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sat, 12 Sep 2026 20:33:32 -0700 Subject: [PATCH] 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. --- plugins/platforms/a2a/tools.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/platforms/a2a/tools.py b/plugins/platforms/a2a/tools.py index 044d5153d6..c3c8512edb 100644 --- a/plugins/platforms/a2a/tools.py +++ b/plugins/platforms/a2a/tools.py @@ -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: