debug: logs T2 live — diagnostic Gemini WS (open, setup, message, close, error)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
20aeda86aa
commit
fb506a954f
1 changed files with 12 additions and 3 deletions
|
|
@ -38,7 +38,7 @@ export interface WebSocketLike {
|
||||||
send(data: unknown): void
|
send(data: unknown): void
|
||||||
close(code?: number, reason?: string): void
|
close(code?: number, reason?: string): void
|
||||||
on(event: 'message', listener: (data: unknown) => void): void
|
on(event: 'message', listener: (data: unknown) => void): void
|
||||||
on(event: 'close', listener: () => void): void
|
on(event: 'close', listener: (code?: number, reason?: unknown) => void): void
|
||||||
on(event: 'error', listener: (err: unknown) => void): void
|
on(event: 'error', listener: (err: unknown) => void): void
|
||||||
on(event: 'open', listener: () => void): void
|
on(event: 'open', listener: () => void): void
|
||||||
}
|
}
|
||||||
|
|
@ -109,14 +109,17 @@ export function openGeminiLiveSession(
|
||||||
}
|
}
|
||||||
|
|
||||||
geminiWs.on('open', () => {
|
geminiWs.on('open', () => {
|
||||||
|
console.log('[T2] Gemini WS opened')
|
||||||
try {
|
try {
|
||||||
geminiWs.send(buildSetupFrame())
|
geminiWs.send(buildSetupFrame())
|
||||||
|
console.log('[T2] Setup frame sent')
|
||||||
} catch {
|
} catch {
|
||||||
closeBoth(1011, 'SETUP_FAILED')
|
closeBoth(1011, 'SETUP_FAILED')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
geminiWs.on('message', (data) => {
|
geminiWs.on('message', (data) => {
|
||||||
|
console.log('[T2] Gemini message received, type:', typeof data)
|
||||||
try {
|
try {
|
||||||
clientWs.send(data)
|
clientWs.send(data)
|
||||||
} catch {
|
} catch {
|
||||||
|
|
@ -132,9 +135,15 @@ export function openGeminiLiveSession(
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
geminiWs.on('close', () => closeBoth(1000))
|
geminiWs.on('close', (code, reason) => {
|
||||||
|
console.log('[T2] Gemini closed, code:', code, 'reason:', reason)
|
||||||
|
closeBoth(1000)
|
||||||
|
})
|
||||||
clientWs.on('close', () => closeBoth(1000))
|
clientWs.on('close', () => closeBoth(1000))
|
||||||
|
|
||||||
geminiWs.on('error', () => closeBoth(1011, 'GEMINI_ERROR'))
|
geminiWs.on('error', (err) => {
|
||||||
|
console.log('[T2] Gemini error:', (err as Error)?.message)
|
||||||
|
closeBoth(1011, 'GEMINI_ERROR')
|
||||||
|
})
|
||||||
clientWs.on('error', () => closeBoth(1011, 'CLIENT_ERROR'))
|
clientWs.on('error', () => closeBoth(1011, 'CLIENT_ERROR'))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue