Skip to content

Commit 6a0467b

Browse files
committed
fix: prevent duplicate console output in both TUI and non-TUI modes
- Add _ConsoleCapture detection in _stream_chain_records_console() - Avoid duplicate writes when stdout is already wrapped by _ConsoleCapture - Ensure console output only appears once regardless of --tui flag usage
1 parent 2d67edc commit 6a0467b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ucagent/util/log.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def _stream_chain_records_console(stream) -> bool:
7070
return True
7171
if current.__class__.__name__ == "PersistentConsoleMirror" and hasattr(current, "_vpdb"):
7272
return True
73-
# Do NOT check for _ConsoleCapture, as we want to sync to it
73+
if current.__class__.__name__ == "_ConsoleCapture":
74+
return True
7475
current = getattr(current, "_original", None)
7576
return False
7677

0 commit comments

Comments
 (0)