Skip to content

Fix mirror console.log corrupting the TUI - #75

Open
Elompenta wants to merge 1 commit into
deflating:mainfrom
Elompenta:fix-console-log-tui-corruption
Open

Fix mirror console.log corrupting the TUI#75
Elompenta wants to merge 1 commit into
deflating:mainfrom
Elompenta:fix-console-log-tui-corruption

Conversation

@Elompenta

Copy link
Copy Markdown
Contributor

Summary

  • Fixes Browser connect message in cli textbox #56: browser connect/disconnect and other mirror-server diagnostics were written via console.log/console.error, which race with Pi's own TUI redraw since the extension runs in-process. This left stray [Mirror] Browser client connected/disconnected text overwriting the prompt and other UI elements, making parallel use of the browser mirror and the TUI barely usable.
  • All 19 console.* calls in mirror-server.ts now go through a mirrorLog() helper that appends timestamped lines to ~/.pi/agent/tau-mirror.log instead of writing to the terminal. ctx.ui.notify(...) calls (the existing, correct channel for user-facing status like "Tau mirror server starting...") are unchanged.
  • Diagnostics are not gone, just moved: tail ~/.pi/agent/tau-mirror.log to watch mirror activity (e.g. Get-Content ~/.pi/agent/tau-mirror.log -Tail 20 -Wait on Windows, tail -f ~/.pi/agent/tau-mirror.log elsewhere).

Test plan

  • Linked this branch into a local Pi install via npm link and confirmed connecting/disconnecting a browser client, including a page refresh, no longer corrupts the TUI.
  • Confirmed ~/.pi/agent/tau-mirror.log receives the connect/disconnect lines instead.

Co-Authored-By: Claude claude-sonnet-5

Browser connect/disconnect and other mirror-server diagnostics were
written via console.log/console.error, which race with Pi's own TUI
redraw since the extension runs in-process. This left stray
"[Mirror] Browser client connected/disconnected" text overwriting the
prompt and other UI elements (deflating#56).

All 19 console.* calls now go through a mirrorLog() helper that
appends timestamped lines to ~/.pi/agent/tau-mirror.log instead.

Co-Authored-By: Claude claude-sonnet-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Browser connect message in cli textbox

1 participant