Fix mirror console.log corrupting the TUI - #75
Open
Elompenta wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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/disconnectedtext overwriting the prompt and other UI elements, making parallel use of the browser mirror and the TUI barely usable.console.*calls inmirror-server.tsnow go through amirrorLog()helper that appends timestamped lines to~/.pi/agent/tau-mirror.loginstead of writing to the terminal.ctx.ui.notify(...)calls (the existing, correct channel for user-facing status like "Tau mirror server starting...") are unchanged.~/.pi/agent/tau-mirror.logto watch mirror activity (e.g.Get-Content ~/.pi/agent/tau-mirror.log -Tail 20 -Waiton Windows,tail -f ~/.pi/agent/tau-mirror.logelsewhere).Test plan
npm linkand confirmed connecting/disconnecting a browser client, including a page refresh, no longer corrupts the TUI.~/.pi/agent/tau-mirror.logreceives the connect/disconnect lines instead.Co-Authored-By: Claude claude-sonnet-5