From 3c42c9aac3b8ceaaa916d8516feb00d3162f8e92 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Mon, 4 May 2026 02:03:10 -0300 Subject: [PATCH] fix(providers): resolve ChatGPT Web authentication failure by aligning TLS fingerprint User-Agent strings (#1925) --- open-sse/executors/chatgpt-web.ts | 2 +- open-sse/services/chatgptTlsClient.ts | 2 +- src/lib/providers/validation.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/open-sse/executors/chatgpt-web.ts b/open-sse/executors/chatgpt-web.ts index d550a967e4..534b02bdf3 100644 --- a/open-sse/executors/chatgpt-web.ts +++ b/open-sse/executors/chatgpt-web.ts @@ -39,7 +39,7 @@ const CONV_URL = `${CHATGPT_BASE}/backend-api/f/conversation`; const USER_LAST_USED_MODEL_CONFIG_URL = `${CHATGPT_BASE}/backend-api/settings/user_last_used_model_config`; const CHATGPT_USER_AGENT = - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36"; + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:148.0) Gecko/20100101 Firefox/148.0"; // Captured from a real chatgpt.com browser session (April 2026). const OAI_CLIENT_VERSION = "prod-81e0c5cdf6140e8c5db714d613337f4aeab94029"; diff --git a/open-sse/services/chatgptTlsClient.ts b/open-sse/services/chatgptTlsClient.ts index 2869d8dd32..53caf8689d 100644 --- a/open-sse/services/chatgptTlsClient.ts +++ b/open-sse/services/chatgptTlsClient.ts @@ -20,7 +20,7 @@ import { randomUUID } from "node:crypto"; let clientPromise: Promise | null = null; let exitHookInstalled = false; -const CHATGPT_PROFILE = "firefox_148"; // matches the Firefox 150 UA we send +const CHATGPT_PROFILE = "firefox_148"; // matches the Firefox 148 UA we send const DEFAULT_TIMEOUT_MS = 60_000; // Grace period added to the binding's wire-level timeout before our JS-level // hard timeout fires. Under healthy operation `tls-client-node` honors diff --git a/src/lib/providers/validation.ts b/src/lib/providers/validation.ts index 4e7c48c210..7f6b5d0a77 100644 --- a/src/lib/providers/validation.ts +++ b/src/lib/providers/validation.ts @@ -2543,7 +2543,7 @@ async function validateChatGptWebProvider({ apiKey, providerSpecificData = {} }: "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "same-origin", "User-Agent": - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:150.0) Gecko/20100101 Firefox/150.0", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:148.0) Gecko/20100101 Firefox/148.0", }, providerSpecificData ),