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: try:
from run_organism import get_console from run_organism import get_console
console = get_console() console = get_console()
except ImportError: except ImportError as e:
pass console = None
if console and hasattr(console, 'on_response'): if console is not None:
try: if hasattr(console, 'on_response'):
console.on_response("shouter", payload) try:
return # Success - don't fall through to print console.on_response("shouter", payload)
except Exception as e: return # Success - exit without fallback print
# Debug: show error but continue to fallback except Exception as e:
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) # Fallback only runs if console is None
print(f"\n\033[36m[response] {payload.message}\033[0m") # This should NOT print if TUI is running
return None return None