From e7bfb94c05f913e2b77e97c2860d2e8227b0ab1f Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sun, 7 Jun 2026 17:12:31 -0400 Subject: [PATCH] =?UTF-8?q?fix(gui=5F2):=20coerce=20None=20=E2=86=92=20""?= =?UTF-8?q?=20for=20input=5Ftext=20value=20in=20render=5Fcontext=5Fpresets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sloppy.py crashed in render_context_presets at line 3469 with TypeError: input_text(): incompatible function arguments. The second arg getattr(app, "ui_new_context_preset_name", "") returned None because the attribute EXISTS but is None — the default "" only fires for missing attributes. The App's __setattr__ delegates to the AppController when the controller has the attribute. The controller's init can leave ui_new_context_preset_name as None (via setattr from a plugin or a config flush). The defensive getattr doesn't help in that case. Fix: append `or ""` to coerce None and empty-string to "" so imgui.input_text always gets a valid str. Verified by the previously-failing batched tests (test_command_palette_sim, test_auto_switch_sim, test_live_warmup_canaries_endpoint, test_conductor_api_hook_integration): all 12 now pass. --- src/gui_2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui_2.py b/src/gui_2.py index bcc51b93..a77a9852 100644 --- a/src/gui_2.py +++ b/src/gui_2.py @@ -3466,7 +3466,7 @@ def render_context_presets(app: App) -> None: imgui.table_next_row() imgui.table_next_column() imgui.set_next_item_width(-1) - changed, new_name = imgui.input_text("##new_preset", getattr(app, "ui_new_context_preset_name", "")) + changed, new_name = imgui.input_text("##new_preset", getattr(app, "ui_new_context_preset_name", "") or "") if changed: app.ui_new_context_preset_name = new_name imgui.table_next_column()