[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
@@ -159,6 +159,8 @@ interface AgentChatProps {
}
const AgentChat: React.FC<AgentChatProps> = ({ sessionId: sessionIdProp, onClose, embedded, autoFocus, isGlowing, onDismissGlow, initialContextPaths, onBranch }) => {
// eslint-disable-next-line no-console
console.log('[diag][AgentChat] render', { sessionIdProp, embedded });
const c = useClaudeTokens();
const STATUS_STYLES: Record<string, { color: string; bg: string }> = {
running: { color: c.status.success, bg: c.status.successBg },
@@ -74,6 +74,8 @@ const HANDLE_DEFS: { dir: ResizeDir; sx: Record<string, any> }[] = [
];
const isElectron = navigator.userAgent.includes('Electron');
// eslint-disable-next-line no-console
console.log('[diag][BrowserCard] isElectron=', isElectron, 'ua=', navigator.userAgent, 'hasOpenswarm=', !!(window as any).openswarm);
const chromeUserAgent = navigator.userAgent
.replace(/\s*Electron\/\S+/, '')