From 484e451cb5c261ff59d53a80f7599087550b4a74 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 31 Jul 2026 22:19:25 -0700 Subject: [PATCH] fix(tui): rebind extracted config handler to shared indicator constants The salvaged commit renamed server.py's private _INDICATOR_STYLES/_INDICATOR_DEFAULT to the shared hermes_constants imports, but methods_config.py (extracted after the original PR was authored) still referenced the old private names through the server-globals rebinding. Import the shared constants directly. --- tui_gateway/methods_config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tui_gateway/methods_config.py b/tui_gateway/methods_config.py index 2c343ca644510..9501237989c60 100644 --- a/tui_gateway/methods_config.py +++ b/tui_gateway/methods_config.py @@ -9,6 +9,8 @@ are rebound onto server.py's globals at install time — see method_ctx.py. from .method_ctx import HandlerRegistry +from hermes_constants import DEFAULT_INDICATOR_STYLE, INDICATOR_STYLES + _registry = HandlerRegistry() method = _registry.method _profile_scoped = _registry.profile_scoped @@ -198,13 +200,13 @@ def _(rid, params: dict) -> dict: # Normalize so a hand-edited config.yaml with stray casing or # an unknown value reads back the SAME value the TUI actually # rendered (frontend's `normalizeIndicatorStyle` falls back to - # `_INDICATOR_DEFAULT` for the same inputs). Otherwise + # `DEFAULT_INDICATOR_STYLE` for the same inputs). Otherwise # `/indicator` would print one thing while the UI shows another. raw = (_load_cfg().get("display") or {}).get("tui_status_indicator", "") norm = str(raw).strip().lower() return _ok( rid, - {"value": norm if norm in _INDICATOR_STYLES else _INDICATOR_DEFAULT}, + {"value": norm if norm in INDICATOR_STYLES else DEFAULT_INDICATOR_STYLE}, ) if key == "personality": return _ok(