Remove fallback print from response handler to debug TUI output

This commit is contained in:
dullfig 2026-01-11 14:33:29 -08:00
parent ad507cd54a
commit 01598bd708

View file

@ -130,17 +130,18 @@ async def handle_response_print(payload: ShoutedResponse, metadata: HandlerMetad
try:
from run_organism import get_console
console = get_console()
except ImportError:
pass
except ImportError as e:
console = None
if console and hasattr(console, 'on_response'):
if console is not None:
if hasattr(console, 'on_response'):
try:
console.on_response("shouter", payload)
return # Success - don't fall through to print
return # Success - exit without fallback print
except Exception as e:
# Debug: show error but continue to fallback
print(f"\n\033[31m[console error] {e}\033[0m")
pass # Fall through to fallback
# Console exists but no on_response - shouldn't happen
# Fallback: print to stdout (only if console not available or failed)
print(f"\n\033[36m[response] {payload.message}\033[0m")
# Fallback only runs if console is None
# This should NOT print if TUI is running
return None