From d17eff29d5fe6a09e0a0cef49df999d4a70eb073 Mon Sep 17 00:00:00 2001 From: ideathinklab01-source Date: Mon, 27 Apr 2026 11:48:01 +0800 Subject: [PATCH] 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) --- tools/delegate_tool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/delegate_tool.py b/tools/delegate_tool.py index d987385252..5655631662 100644 --- a/tools/delegate_tool.py +++ b/tools/delegate_tool.py @@ -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 {}