fix: send session-alive signal immediately on socket connect to prevent initial offline flicker

This commit is contained in:
weishu
2026-01-15 22:21:03 +08:00
parent 9d2cbd949e
commit f33d142446
+5
View File
@@ -102,6 +102,11 @@ export class ApiSessionClient extends EventEmitter {
}
void this.backfillIfNeeded()
this.hasConnectedOnce = true
this.socket.emit('session-alive', {
sid: this.sessionId,
time: Date.now(),
thinking: false
})
})
this.socket.on('rpc-request', async (data: { method: string; params: string }, callback: (response: string) => void) => {