From b294c76719e39709002506044b2144844f48bb45 Mon Sep 17 00:00:00 2001 From: benzntech Date: Sat, 8 Aug 2026 19:04:07 +0530 Subject: [PATCH 1/3] feat(providers): add Cookie Editor fast-path to web session credential guide The 'How to get the session credential' instructions in the provider add-connection modal only described the manual DevTools flow. Add a fast-path step using the Cookie Editor extension (export as Cookie header, select all numbered session-token chunks) and demote the DevTools walkthrough to the manual alternative. New i18n keys (webSessionGuideStep2Fast, webSessionGuideStep3Manual) ship in en.json; other locales fall back to English until translated. --- .../[id]/components/WebSessionCredentialGuide.tsx | 10 +++++----- src/i18n/messages/en.json | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/(dashboard)/dashboard/providers/[id]/components/WebSessionCredentialGuide.tsx b/src/app/(dashboard)/dashboard/providers/[id]/components/WebSessionCredentialGuide.tsx index e3743acdfb..e104188844 100644 --- a/src/app/(dashboard)/dashboard/providers/[id]/components/WebSessionCredentialGuide.tsx +++ b/src/app/(dashboard)/dashboard/providers/[id]/components/WebSessionCredentialGuide.tsx @@ -111,16 +111,16 @@ export default function WebSessionCredentialGuide({
  • {providerText( t, - "webSessionGuideStep2", - "Open the browser developer tools and inspect a request made by the web app." + "webSessionGuideStep2Fast", + "Fast path: install the Cookie Editor extension (chromewebstore.google.com → Cookie Editor), open it on the {provider} tab, find {credential} (select all numbered chunks if split), and click Export → Copy with the export format set to “Cookie header”.", + { provider: providerName, credential: requirement.credentialName } )}
  • {providerText( t, - "webSessionGuideStep3", - "Copy the required credential from the provider's own domain. For cookies, copy only the Cookie header value and omit Cookie:.", - { credential: requirement.credentialName } + "webSessionGuideStep3Manual", + "Manual path: open the browser developer tools (F12 → Network), refresh the page, open an authenticated request, and copy the Cookie header value from Request Headers — omit the Cookie: prefix." )}
  • diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index 3d9bb9bc8e..3d10557f7a 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -5984,7 +5984,9 @@ "webTokenRequiredCredential": "Required token: {credential}", "webSessionGuideStep1": "Sign in to {provider} in your browser.", "webSessionGuideStep2": "Open the browser developer tools and inspect a request made by the web app.", + "webSessionGuideStep2Fast": "Fast path: install the Cookie Editor extension (chromewebstore.google.com → Cookie Editor), open it on the {provider} tab, find {credential} (select all numbered chunks if split), and click Export → Copy with the export format set to “Cookie header”.", "webSessionGuideStep3": "Copy the required credential from the provider's own domain. For cookies, copy only the Cookie header value and omit Cookie:.", + "webSessionGuideStep3Manual": "Manual path: open the browser developer tools (F12 → Network), refresh the page, open an authenticated request, and copy the Cookie header value from Request Headers — omit the Cookie: prefix.", "webSessionGuideStep4": "Paste it here and check the connection. If it stops working, sign in again and replace it with a fresh value.", "webSessionSecurityHint": "Treat this like a password: it may access your signed-in web account until it expires or is revoked.", "webNoAuthGuideTitle": "No credential required", From 14b6183693619ad0dafbcd47369fbbe5c1d39268 Mon Sep 17 00:00:00 2001 From: benzntech Date: Sun, 9 Aug 2026 16:20:54 -0300 Subject: [PATCH 2/3] test(providers): cover web session fast path Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --- .../ui/web-session-credential-guide.test.tsx | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/unit/ui/web-session-credential-guide.test.tsx diff --git a/tests/unit/ui/web-session-credential-guide.test.tsx b/tests/unit/ui/web-session-credential-guide.test.tsx new file mode 100644 index 0000000000..99339ea9a7 --- /dev/null +++ b/tests/unit/ui/web-session-credential-guide.test.tsx @@ -0,0 +1,50 @@ +// @vitest-environment jsdom +import React, { act } from "react"; +import { createRoot, type Root } from "react-dom/client"; +import { afterEach, describe, expect, it } from "vitest"; + +import WebSessionCredentialGuide, { + type WebSessionCredentialGuideProps, +} from "@/app/(dashboard)/dashboard/providers/[id]/components/WebSessionCredentialGuide"; + +globalThis.IS_REACT_ACT_ENVIRONMENT = true; + +describe("WebSessionCredentialGuide cookie acquisition paths", () => { + let container: HTMLDivElement | null = null; + let root: Root | null = null; + + afterEach(() => { + if (root) { + act(() => root?.unmount()); + root = null; + } + container?.remove(); + container = null; + }); + + it("renders the Cookie Editor fast path alongside the manual developer-tools path", () => { + container = document.createElement("div"); + document.body.appendChild(container); + root = createRoot(container); + + const t = ((key: string) => key) as WebSessionCredentialGuideProps["t"]; + act(() => { + root?.render( + + ); + }); + + expect(container?.textContent).toContain("Fast path: install the Cookie Editor extension"); + expect(container?.textContent).toContain("Manual path: open the browser developer tools"); + expect(container?.querySelectorAll("ol > li")).toHaveLength(4); + + const providerLink = container?.querySelector('a[href="https://example.ai/login"]'); + expect(providerLink?.getAttribute("target")).toBe("_blank"); + expect(providerLink?.getAttribute("rel")).toBe("noopener noreferrer"); + }); +}); From 70fca36f9dc1b33c0ae56210aec02bdeb6c219f9 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Sun, 9 Aug 2026 18:54:55 -0300 Subject: [PATCH 3/3] fix(i18n): complete web session guide translations Co-authored-by: benzntech <4044180+benzntech@users.noreply.github.com> --- src/i18n/messages/pt-BR.json | 4 +++- src/i18n/messages/vi.json | 16 +++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/i18n/messages/pt-BR.json b/src/i18n/messages/pt-BR.json index 7ba3d31af2..25f35a1048 100644 --- a/src/i18n/messages/pt-BR.json +++ b/src/i18n/messages/pt-BR.json @@ -6037,7 +6037,9 @@ "anonymousFallbackDesc": "Quando todas as conexões configuradas estiverem esgotadas (cota, créditos ou expiração), use temporariamente a camada sem chave deste provedor. Desative para ignorar este provedor em vez de enviar solicitações anônimas — recomendado quando a camada sem chave as rejeita (401).", "anonymousFallbackEnabled": "Fallback anônimo ativado para {provider}", "anonymousFallbackDisabled": "Fallback anônimo desativado para {provider} — conexões esgotadas ignorarão este provedor", - "anonymousFallbackUpdateFailed": "Falha ao atualizar a configuração de fallback anônimo" + "anonymousFallbackUpdateFailed": "Falha ao atualizar a configuração de fallback anônimo", + "webSessionGuideStep2Fast": "Caminho rápido: instale a extensão Cookie Editor (chromewebstore.google.com → Cookie Editor), abra-a na aba do {provider}, encontre {credential} (se estiver dividido, selecione todos os trechos numerados) e clique em Export → Copy com o formato de exportação definido como “Cookie header”.", + "webSessionGuideStep3Manual": "Caminho manual: abra as ferramentas do desenvolvedor do navegador (F12 → Network), atualize a página, abra uma requisição autenticada e copie o valor do cabeçalho Cookie em Request Headers — omita o prefixo Cookie:." }, "settings": { "title": "Configurações", diff --git a/src/i18n/messages/vi.json b/src/i18n/messages/vi.json index 5fceb0da18..2ecef814fc 100644 --- a/src/i18n/messages/vi.json +++ b/src/i18n/messages/vi.json @@ -2516,7 +2516,7 @@ "always": "Luôn bật" }, "ccDiscoveryInfoButton": "Cách bật khám phá mô hình trong Claude Code", - "ccDiscoveryInfoTooltip": "Quảng bá các mô hình không phải Claude dưới dạng id phản chiếu claude// để tính năng khám phá mô hình qua gateway của Claude Code có thể liệt kê chúng. Khi bật ở phạm vi toàn cục, số mục trong danh mục tăng gấp đôi với mọi client.", + "ccDiscoveryInfoTooltip": "Công bố các mô hình không phải Claude dưới dạng id phản chiếu claude/<provider>/<model> để tính năng khám phá mô hình qua gateway của Claude Code có thể liệt kê chúng. Khi bật ở phạm vi toàn cục, số mục trong danh mục tăng gấp đôi với mọi client.", "ccDiscoveryInfoLink": "Mở Feature Flags", "ccOnboardingTitle": "settings.json cho việc khám phá mô hình qua gateway", "ccOnboardingCopy": "Sao chép", @@ -2979,15 +2979,7 @@ "copilotPasteInto": "Dán vào:", "copilotReloadInstruction": "Sau đó tải lại VS Code và nhập khóa API khi được yêu cầu.", "wireApiChatCompletions": "Chat Completions (/chat/completions)", - "wireApiResponses": "Responses API (/responses)", - "ccDiscoveryInfoButton": "Cách bật khám phá mô hình trong Claude Code", - "ccDiscoveryInfoTooltip": "Công bố các mô hình không phải Claude dưới dạng id phản chiếu claude/<provider>/<model> để tính năng khám phá mô hình qua gateway của Claude Code có thể liệt kê chúng. Khi bật ở phạm vi toàn cục, số mục trong danh mục tăng gấp đôi với mọi client.", - "ccDiscoveryInfoLink": "Mở Feature Flags", - "ccOnboardingTitle": "settings.json cho việc khám phá mô hình qua gateway", - "ccOnboardingCopy": "Sao chép", - "ccOnboardingCopied": "Đã sao chép", - "ccOnboardingKeyPlaceholder": "", - "ccOnboardingWindowNote": "Claude Code mặc định coi mọi id mô hình mà nó không nhận ra là có cửa sổ ngữ cảnh 200K. Với mô hình có cửa sổ thực tế khác, hãy thêm CLAUDE_CODE_AUTO_COMPACT_WINDOW ngay bên dưới để việc nén ngữ cảnh tự động không kích hoạt quá sớm." + "wireApiResponses": "Responses API (/responses)" }, "combos": { "title": "Combo", @@ -6045,7 +6037,9 @@ "anonymousFallbackDisabled": "Đã tắt dự phòng ẩn danh cho {provider} — các kết nối đã cạn kiệt sẽ bỏ qua nhà cung cấp này", "anonymousFallbackUpdateFailed": "Không thể cập nhật cài đặt dự phòng ẩn danh", "getApiKey": "Lấy khóa API", - "getApiKeyDescription": "Đăng ký hoặc tạo tài khoản để nhận khóa API" + "getApiKeyDescription": "Đăng ký hoặc tạo tài khoản để nhận khóa API", + "webSessionGuideStep2Fast": "Cách nhanh: cài đặt tiện ích Cookie Editor (chromewebstore.google.com → Cookie Editor), mở tiện ích trong thẻ {provider}, tìm {credential} (chọn tất cả các phần được đánh số nếu bị chia nhỏ), rồi nhấp Export → Copy với định dạng xuất là “Cookie header”.", + "webSessionGuideStep3Manual": "Cách thủ công: mở công cụ dành cho nhà phát triển của trình duyệt (F12 → Network), tải lại trang, mở một yêu cầu đã xác thực và sao chép giá trị tiêu đề Cookie trong Request Headers — bỏ tiền tố Cookie:." }, "settings": { "title": "Cài đặt",