[eric] windows: fix UA-spoof leak onto recreated main window + add diag logs across preload, createWindow, recreateMainWindow, resumeSession, launchAndSendFirstMessage, AgentChat, WebSocketManager so packaged-build stderr captures the chat-spawn crash trail

This commit is contained in:
Eric
2026-05-25 16:06:58 -07:00
parent e7a09c9568
commit d27f289cea
7 changed files with 50 additions and 5 deletions
@@ -192,6 +192,8 @@ class WebSocketManager {
const token = _getAuthTokenSafe();
const sep = this.url.includes('?') ? '&' : '?';
const urlWithToken = token ? `${this.url}${sep}token=${encodeURIComponent(token)}` : this.url;
// eslint-disable-next-line no-console
console.log('[diag][ws] connect', this.url, 'sessionId=', this.options.sessionId, 'hasToken=', !!token);
this.ws = new WebSocket(urlWithToken);
this.ws.onopen = () => {