mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
fix: send appVersion in probe client hello and update it on session resume
buildClientConfig in test-daemon-connection.ts never set appVersion, so probe clients (which become the live client) sent hello without it. The daemon's version gate then hid Pi/Copilot from all these sessions. Also update appVersion on the Session when a client reconnects with a newer version, so stale sessions don't stay gated forever.
This commit is contained in:
@@ -2,6 +2,7 @@ import { DaemonClient } from "@server/client/daemon-client";
|
||||
import type { DaemonClientConfig } from "@server/client/daemon-client";
|
||||
import type { HostConnection } from "@/types/host-connection";
|
||||
import { getOrCreateClientId } from "./client-id";
|
||||
import { resolveAppVersion } from "./app-version";
|
||||
import { buildDaemonWebSocketUrl, buildRelayWebSocketUrl } from "./daemon-endpoints";
|
||||
import {
|
||||
buildLocalDaemonTransportUrl,
|
||||
@@ -53,6 +54,7 @@ export async function buildClientConfig(
|
||||
const base = {
|
||||
clientId,
|
||||
clientType: "mobile" as const,
|
||||
appVersion: resolveAppVersion() ?? undefined,
|
||||
suppressSendErrors: true,
|
||||
reconnect: { enabled: false },
|
||||
...(connection.type === "directSocket" || connection.type === "directPipe"
|
||||
|
||||
@@ -529,7 +529,7 @@ function toAgentPersistenceHandle(
|
||||
*/
|
||||
export class Session {
|
||||
private readonly clientId: string;
|
||||
private readonly appVersion: string | null;
|
||||
private appVersion: string | null;
|
||||
private readonly sessionId: string;
|
||||
private readonly onMessage: (msg: SessionOutboundMessage) => void;
|
||||
private readonly onBinaryMessage: ((frame: Uint8Array) => void) | null;
|
||||
@@ -714,6 +714,12 @@ export class Session {
|
||||
this.sessionLogger.trace("Session created");
|
||||
}
|
||||
|
||||
updateAppVersion(appVersion: string | null): void {
|
||||
if (appVersion && appVersion !== this.appVersion) {
|
||||
this.appVersion = appVersion;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the client's current activity state
|
||||
*/
|
||||
|
||||
@@ -745,6 +745,11 @@ export class VoiceAssistantWebSocketServer {
|
||||
clearTimeout(existing.externalDisconnectCleanupTimeout);
|
||||
existing.externalDisconnectCleanupTimeout = null;
|
||||
}
|
||||
const newAppVersion = message.appVersion ?? null;
|
||||
if (newAppVersion && newAppVersion !== existing.appVersion) {
|
||||
existing.appVersion = newAppVersion;
|
||||
existing.session.updateAppVersion(newAppVersion);
|
||||
}
|
||||
existing.sockets.add(ws);
|
||||
this.sessions.set(ws, existing);
|
||||
this.sendToClient(ws, this.createServerInfoMessage());
|
||||
|
||||
Reference in New Issue
Block a user