Remove fallback print from response handler to debug TUI output
This commit is contained in:
parent
ad507cd54a
commit
01598bd708
1 changed files with 12 additions and 11 deletions
|
|
@ -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:
|
||||||
|
if hasattr(console, 'on_response'):
|
||||||
try:
|
try:
|
||||||
console.on_response("shouter", payload)
|
console.on_response("shouter", payload)
|
||||||
return # Success - don't fall through to print
|
return # Success - exit without fallback print
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Debug: show error but continue to fallback
|
pass # Fall through to fallback
|
||||||
print(f"\n\033[31m[console error] {e}\033[0m")
|
# 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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue