Fix forward-compatible provider handling for old app clients
AgentProviderSchema was z.enum() which caused old clients to reject session messages containing unknown providers (pi, copilot), breaking the entire session. Changed to z.string() for future clients. For currently deployed clients (<0.1.45), the daemon now filters out unknown providers based on the appVersion sent in the WebSocket hello message. Clients that don't send appVersion only see claude/codex/opencode.
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
type HostProfile,
|
||||
} from "@/types/host-connection";
|
||||
import { decodeOfferFragmentPayload, normalizeHostPort } from "@/utils/daemon-endpoints";
|
||||
import { resolveAppVersion } from "@/utils/app-version";
|
||||
import { ConnectionOfferSchema, type ConnectionOffer } from "@server/shared/connection-offer";
|
||||
import {
|
||||
shouldUseDesktopDaemon,
|
||||
@@ -422,6 +423,7 @@ function createDefaultDeps(): HostRuntimeControllerDeps {
|
||||
suppressSendErrors: true,
|
||||
clientId,
|
||||
clientType: "mobile" as const,
|
||||
appVersion: resolveAppVersion() ?? undefined,
|
||||
runtimeGeneration,
|
||||
};
|
||||
if (connection.type === "directSocket" || connection.type === "directPipe") {
|
||||
|
||||
Reference in New Issue
Block a user