Skip to content

🙌 OpenHands: AI-Driven Development

Clarify OpenHands backend login host (#423)

Xingyao Wang4f4659846019
diff --git a/.github/workflows/pr-artifacts.yml b/.github/workflows/pr-artifacts.yml
index 5b8416b8a8..d833d90562 100644
--- a/.github/workflows/pr-artifacts.yml
+++ b/.github/workflows/pr-artifacts.yml
@@ -227,4 +227,3 @@ jobs:
else
echo "Branch '${BRANCH}' did not exist — nothing to clean up."
fi
-
diff --git a/__tests__/components/backends/add-backend-modal.test.tsx b/__tests__/components/backends/add-backend-modal.test.tsx
index 932b174fba..99bbb1a061 100644
--- a/__tests__/components/backends/add-backend-modal.test.tsx
+++ b/__tests__/components/backends/add-backend-modal.test.tsx
@@ -1,6 +1,6 @@
import React from "react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
-import { fireEvent, render, screen } from "@testing-library/react";
+import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { __resetActiveStoreForTests } from "#/api/backend-registry/active-store";
@@ -28,28 +28,31 @@ afterEach(() => {
__resetActiveStoreForTests();
});
-describe("AddBackendModal", () => {
- it("places Cancel before Save in the footer so the dominant action is the last focusable button", () => {
- // Arrange: render the modal so both footer buttons are mounted.
+describe("AddBackendModal – two-column layout", () => {
+ it("renders a two-column layout with manual and cloud sections", () => {
renderWithProviders(<AddBackendModal onClose={vi.fn()} />);
- // Act: locate the two footer buttons.
- const cancel = screen.getByTestId("add-backend-cancel");
- const submit = screen.getByTestId("add-backend-submit");
+ expect(screen.getByTestId("add-backend-name")).toBeInTheDocument();
+ expect(screen.getByTestId("add-backend-host")).toBeInTheDocument();
+ expect(screen.getByTestId("add-backend-host-helper")).toBeInTheDocument();
+ expect(screen.getByTestId("add-backend-api-key")).toBeInTheDocument();
+ expect(screen.getByTestId("add-backend-submit")).toBeInTheDocument();
- // Assert: Cancel precedes Save in DOM order — this is what governs
- // tab order and screen-reader reading order, so the dominant Save
- // action is the rightmost / last-reached button.
- // eslint-disable-next-line no-bitwise
+ expect(screen.getByTestId("add-backend-cloud-title")).toBeInTheDocument();
+ expect(screen.getByTestId("add-backend-login-button")).toBeInTheDocument();
expect(
- cancel.compareDocumentPosition(submit) &
- Node.DOCUMENT_POSITION_FOLLOWING,
- ).toBeTruthy();
+ screen.getByTestId("add-backend-advanced-toggle"),
+ ).toBeInTheDocument();
});
- it("disables submit until all fields are filled", async () => {
- const onClose = vi.fn();
- renderWithProviders(<AddBackendModal onClose={onClose} />);
+ it("starts with an empty host field (no prefilled value)", () => {
+ renderWithProviders(<AddBackendModal onClose={vi.fn()} />);
+
+ expect(screen.getByTestId("add-backend-host")).toHaveValue("");
+ });
+
+ it("disables Connect until name and host are filled (local backend)", async () => {
+ renderWithProviders(<AddBackendModal onClose={vi.fn()} />);
const submit = screen.getByTestId(
"add-backend-submit",
@@ -57,37 +60,17 @@ describe("AddBackendModal", () => {
expect(submit).toBeDisabled();
const user = userEvent.setup();
- await user.type(screen.getByTestId("add-backend-name"), "Production");
+ await user.type(screen.getByTestId("add-backend-name"), "My Server");
expect(submit).toBeDisabled();
+ // A localhost host infers "local" kind → no API key required
await user.type(
screen.getByTestId("add-backend-host"),
- "https://app.all-hands.dev",
+ "http://localhost:8000",
);
- expect(submit).toBeDisabled();
-
- await user.type(screen.getByTestId("add-backend-api-key"), "secret-key");
expect(submit).not.toBeDisabled();
});
- it("infers cloud kind from an all-hands.dev host", async () => {
- renderWithProviders(<AddBackendModal onClose={vi.fn()} />);
-
- const cloudRadio = screen.getByTestId(
- "add-backend-kind-cloud",
- ) as HTMLInputElement;
- const localRadio = screen.getByTestId(
- "add-backend-kind-local",
- ) as HTMLInputElement;
-
- fireEvent.change(screen.getByTestId("add-backend-host"), {
- target: { value: "https://app.all-hands.dev" },
- });
-
- expect(cloudRadio.checked).toBe(true);
- expect(localRadio.checked).toBe(false);
- });
-
it("allows submitting a local backend with a blank API key", async () => {
const onClose = vi.fn();
renderWithProviders(<AddBackendModal onClose={onClose} />);
@@ -98,15 +81,12 @@ describe("AddBackendModal", () => {
screen.getByTestId("add-backend-host"),
"http://127.0.0.1:18002",
);
- // No API key entered; kind auto-infers to "local" from the host.
await user.click(screen.getByTestId("add-backend-submit"));
const stored = JSON.parse(
window.localStorage.getItem("openhands-backends") ?? "[]",
);
- // The seeded default ("Local") is in the list alongside the new
- // entry. Find the user-added one to assert its shape.
const added = stored.find(
(b: { name: string }) => b.name === "Local Extra",
);
@@ -118,7 +98,7 @@ describe("AddBackendModal", () => {
});
});
- it("keeps submit disabled for cloud backends until an API key is entered", async () => {
+ it("requires API key when host infers cloud kind", async () => {
renderWithProviders(<AddBackendModal onClose={vi.fn()} />);
const submit = screen.getByTestId(
@@ -129,8 +109,9 @@ describe("AddBackendModal", () => {
await user.type(screen.getByTestId("add-backend-name"), "Cloud");
await user.type(
screen.getByTestId("add-backend-host"),
- "https://app.all-hands.dev",
+ "https://app.openhands.dev",
);
+ // Cloud host without API key → submit should be disabled
expect(submit).toBeDisabled();
await user.type(screen.getByTestId("add-backend-api-key"), "token");
@@ -148,7 +129,6 @@ describe("AddBackendModal", () => {
"http://localhost:9000",
);
await user.type(screen.getByTestId("add-backend-api-key"), "k");
- await user.click(screen.getByTestId("add-backend-kind-local"));
await user.click(screen.getByTestId("add-backend-submit"));
@@ -157,8 +137,6 @@ describe("AddBackendModal", () => {
const stored = JSON.parse(
window.localStorage.getItem("openhands-backends") ?? "[]",
);
- // The seeded default ("Local") is in the list alongside the new
- // entry. Find the user-added one to assert its shape.
expect(stored).toHaveLength(2);
const added = stored.find((b: { name: string }) => b.name === "Local 1");
expect(added).toMatchObject({
@@ -168,9 +146,14 @@ describe("AddBackendModal", () => {
kind: "local",
});
- // Adding a backend must NOT change the active selection. Auto-switch
- // would write `(backendId, null)` for a cloud backend, which the
- // dropdown can't render once orgs load — UI/API would drift.
+ // Adding a backend must NOT change the active selection.
expect(window.localStorage.getItem("openhands-active-backend")).toBeNull();
});
+
+ it("shows the close button", () => {
+ const onClose = vi.fn();
+ renderWithProviders(<AddBackendModal onClose={onClose} />);
+
+ expect(screen.getByTestId("add-backend-close")).toBeInTheDocument();
+ });
});
diff --git a/__tests__/components/backends/backend-selector.test.tsx b/__tests__/components/backends/backend-selector.test.tsx
index 19e1e292b7..fe7b497b27 100644
--- a/__tests__/components/backends/backend-selector.test.tsx
+++ b/__tests__/components/backends/backend-selector.test.tsx
@@ -533,7 +533,7 @@ describe("BackendSelector", () => {
await user.click(screen.getByTestId("add-backend-menu-item"));
expect(await screen.findByTestId("add-backend-modal")).toBeInTheDocument();
- await user.click(screen.getByTestId("add-backend-cancel"));
+ await user.click(screen.getByTestId("add-backend-close"));
await waitFor(() => {
expect(screen.queryByTestId("add-backend-modal")).not.toBeInTheDocument();
});
diff --git a/src/components/features/backends/backend-form-modal.tsx b/src/components/features/backends/backend-form-modal.tsx
index d0d5309667..e07c3a851e 100644
--- a/src/components/features/backends/backend-form-modal.tsx
+++ b/src/components/features/backends/backend-form-modal.tsx
@@ -2,6 +2,7 @@ import React from "react";
import { useQuery } from "@tanstack/react-query";
import { useTranslation } from "react-i18next";
import { ServerClient } from "@openhands/typescript-client/clients";
+import OpenHandsLogoWhite from "#/assets/branding/openhands-logo-white.svg?react";
import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";
import { BrandButton } from "#/components/features/settings/brand-button";
import { SettingsInput } from "#/components/features/settings/settings-input";
@@ -103,6 +104,8 @@ function isValidHostUrl(host: string): boolean {
}
}
+const DEFAULT_OPENHANDS_CLOUD_HOST = "https://app.all-hands.dev";
+
/**
* Live status row for the edit form: shows a connection dot, a
* "Local"/"Cloud" label, and the agent server's reported version when
@@ -249,27 +252,16 @@ export function BackendForm({
const { t } = useTranslation("openhands");
const { addBackend, updateBackend } = useActiveBackendContext();
- const initialKind: BackendKind =
- backend?.kind ?? (mode === "edit" ? "local" : "cloud");
-
const [name, setName] = React.useState(backend?.name ?? "");
const [host, setHost] = React.useState(backend?.host ?? "");
const [apiKey, setApiKey] = React.useState(backend?.apiKey ?? "");
- const [kind, setKind] = React.useState<BackendKind>(initialKind);
- // In add mode, infer the kind from the host; in edit mode, the user
- // already chose one, so don't re-infer over their choice.
- const [touchedKind, setTouchedKind] = React.useState(mode === "edit");
// Inline validation: only show errors after the user has left a field.
const [nameTouched, setNameTouched] = React.useState(false);
const [hostTouched, setHostTouched] = React.useState(false);
- // Auto-infer kind from host when user hasn't explicitly selected a kind via radio
- React.useEffect(() => {
- if (!touchedKind && host) {
- setKind(inferKindFromHost(host));
- }
- }, [host, touchedKind]);
+ // Kind is inferred from the host on every change.
+ const kind: BackendKind = inferKindFromHost(host);
const testIdRoot =
explicitTestIdRoot ?? (mode === "edit" ? "edit-backend" : "add-backend");
@@ -310,12 +302,6 @@ export function BackendForm({
if (mode === "edit" && backend) {
updateBackend(backend.id, payload);
} else {
- // Adding a backend is a pure save — we do NOT auto-switch the
- // active selection. The user picks the new backend from the
- // dropdown when they're ready. Auto-switching would write
- // `(backendId, null)` for a cloud backend, which the dropdown
- // can't render once orgs load and therefore drifts from the API
- // layer.
addBackend(payload);
}
@@ -350,113 +336,25 @@ export function BackendForm({
value={host}
onChange={setHost}
onBlur={() => setHostTouched(true)}
- placeholder="https://app.all-hands.dev"
+ placeholder={DEFAULT_OPENHANDS_CLOUD_HOST}
className="w-full"
showRequiredTag
error={hostError}
/>
- {/* Device Flow auth for cloud backends in add mode - always visible */}
- {mode === "add" && kind === "cloud" && (
- <div className="flex flex-col gap-3">
- <DeviceFlowAuth
- host={host}
- onSuccess={setApiKey}
- testIdRoot={testIdRoot}
- isDisabled={!name.trim() || !isValidHostUrl(host)}
- />
-
- {/* Divider with "or" */}
- <div className="flex items-center gap-3">
- <div className="flex-1 border-t border-[var(--oh-border)]" />
- <span className="text-xs text-[var(--oh-text-subtle)] uppercase">
- {t(I18nKey.BACKEND$LOGIN_OR)}
- </span>
- <div className="flex-1 border-t border-[var(--oh-border)]" />
- </div>
-
- {/* Manual API key section */}
- <div className="flex flex-col gap-2">
- <SettingsInput
- testId={`${testIdRoot}-api-key`}
- name={`${testIdRoot}-api-key`}
- type="password"
- label={t(I18nKey.BACKEND$KEY_LABEL)}
- value={apiKey}
- onChange={setApiKey}
- placeholder=""
- className="w-full"
- />
- <p className="text-xs text-[var(--oh-muted)]">
- {t(I18nKey.BACKEND$KEY_DOCS_HINT)}{" "}
- <a
- href="https://docs.openhands.dev/openhands/usage/settings/api-keys-settings"
- target="_blank"
- rel="noopener noreferrer"
- className="text-blue-400 hover:underline"
- >
- {t(I18nKey.BACKEND$KEY_DOCS_LINK)}
- </a>
- </p>
- </div>
- </div>
- )}
-
- {/* Regular API key input for non-cloud or edit mode */}
- {(mode === "edit" || kind !== "cloud") && (
- <SettingsInput
- testId={`${testIdRoot}-api-key`}
- name={`${testIdRoot}-api-key`}
- type="password"
- label={t(I18nKey.BACKEND$KEY_LABEL)}
- value={apiKey}
- onChange={setApiKey}
- placeholder=""
- className="w-full"
- />
- )}
+ <SettingsInput
+ testId={`${testIdRoot}-api-key`}
+ name={`${testIdRoot}-api-key`}
+ type="password"
+ label={t(I18nKey.BACKEND$KEY_LABEL)}
+ value={apiKey}
+ onChange={setApiKey}
+ placeholder=""
+ className="w-full"
+ />
- {mode === "edit" && backend ? (
+ {mode === "edit" && backend && (
<BackendStatusBadge backend={backend} testIdRoot={testIdRoot} />
- ) : (
- <fieldset className="flex flex-col">
- <legend className="text-sm mb-3">
- {t(I18nKey.BACKEND$KIND_LABEL)}
- </legend>
- <div className="flex gap-6">
- <label className="flex items-center gap-2 text-sm">
- <input
- type="radio"
- name={`${testIdRoot}-kind`}
- checked={kind === "local"}
- onChange={() => {
- setKind("local");
- setTouchedKind(true);
- }}
- data-testid={`${testIdRoot}-kind-local`}
- />
- {t(I18nKey.BACKEND$KIND_LOCAL)}
- </label>
- <label className="flex items-center gap-2 text-sm">
- <input
- type="radio"
- name={`${testIdRoot}-kind`}
- checked={kind === "cloud"}
- onChange={() => {
- setKind("cloud");
- setTouchedKind(true);
- }}
- data-testid={`${testIdRoot}-kind-cloud`}
- />
- {t(I18nKey.BACKEND$KIND_CLOUD)}
- </label>
- </div>
- <p className="text-xs text-[var(--oh-muted)] mt-3">
- {kind === "cloud"
- ? t(I18nKey.BACKEND$KEY_HELPER_CLOUD)
- : t(I18nKey.BACKEND$KEY_HELPER_LOCAL)}
- </p>
- </fieldset>
)}
{renderActions ? (
@@ -485,10 +383,186 @@ export function BackendForm({
);
}
+// ── Add-mode two-column layout ──────────────────────────────────────
+
/**
- * Modal wrapper around `BackendForm`. Used by both the dropdown's
- * "Add backend" trigger and the manage-backends modal's edit /
- * add-inline buttons.
+ * Left column of the "Add a Backend" modal: manual connection via
+ * Host + API Key. Designed for self-hosted agent servers and
+ * self-hosted OpenHands Cloud with API key auth.
+ */
+function ManualConnectionColumn({ onClose }: { onClose: () => void }) {
+ const { t } = useTranslation("openhands");
+ const { addBackend } = useActiveBackendContext();
+
+ const [name, setName] = React.useState("");
+ const [host, setHost] = React.useState("");
+ const [apiKey, setApiKey] = React.useState("");
+
+ const kind: BackendKind = inferKindFromHost(host);
+ const canSubmit =
+ name.trim().length > 0 &&
+ isValidHostUrl(host) &&
+ (kind === "local" || apiKey.trim().length > 0);
+
+ const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
+ e.preventDefault();
+ if (!canSubmit) return;
+ addBackend({
+ name: name.trim(),
+ host: normalizeHost(host),
+ apiKey: apiKey.trim(),
+ kind,
+ });
+ onClose();
+ };
+
+ return (
+ <form
+ data-testid="add-backend-form"
+ onSubmit={handleSubmit}
+ className="flex flex-col gap-4 flex-1 min-w-0"
+ >
+ <div className="flex flex-col gap-1">
+ <SettingsInput
+ testId="add-backend-name"
+ name="add-backend-name"
+ type="text"
+ label={t(I18nKey.BACKEND$NAME_LABEL)}
+ value={name}
+ onChange={setName}
+ placeholder="e.g. My Server"
+ className="w-full"
+ />
+ <p className="text-xs text-gray-500">
+ {t(I18nKey.BACKEND$NAME_HELPER)}
+ </p>
+ </div>
+
+ <div className="flex flex-col gap-1">
+ <SettingsInput
+ testId="add-backend-host"
+ name="add-backend-host"
+ type="text"
+ label={t(I18nKey.BACKEND$HOST_LABEL)}
+ value={host}
+ onChange={setHost}
+ placeholder="http://localhost:8000"
+ className="w-full"
+ />
+ <p
+ className="text-xs text-gray-500"
+ data-testid="add-backend-host-helper"
+ >
+ {t(I18nKey.BACKEND$HOST_HELPER)}
+ </p>
+ </div>
+
+ <SettingsInput
+ testId="add-backend-api-key"
+ name="add-backend-api-key"
+ type="password"
+ label={t(I18nKey.BACKEND$KEY_LABEL)}
+ value={apiKey}
+ onChange={setApiKey}
+ placeholder="sk-••••••••••"
+ className="w-full"
+ />
+
+ <BrandButton
+ type="submit"
+ variant="secondary"
+ isDisabled={!canSubmit}
+ testId="add-backend-submit"
+ className="w-full text-center"
+ >
+ {t(I18nKey.BACKEND$CONNECT)}
+ </BrandButton>
+ </form>
+ );
+}
+
+/**
+ * Right column of the "Add a Backend" modal: one-click OAuth login
+ * with OpenHands Cloud. Includes an "Advanced" disclosure for
+ * users who self-host OpenHands Cloud and need to override the host.
+ */
+function CloudLoginColumn({ onClose }: { onClose: () => void }) {
+ const { t } = useTranslation("openhands");
+ const { addBackend } = useActiveBackendContext();
+
+ const [advancedOpen, setAdvancedOpen] = React.useState(false);
+ const [customHost, setCustomHost] = React.useState("");
+
+ const effectiveHost = customHost.trim() || DEFAULT_OPENHANDS_CLOUD_HOST;
+
+ const handleLoginSuccess = (apiKey: string) => {
+ addBackend({
+ name: "OpenHands Cloud",
+ host: normalizeHost(effectiveHost),
+ apiKey,
+ kind: "cloud",
+ });
+ onClose();
+ };
+
+ return (
+ <div className="flex flex-col items-center justify-center gap-4 flex-1 min-w-0 px-4">
+ <OpenHandsLogoWhite width={56} height={56} aria-hidden />
+
+ <h4
+ className="text-lg font-bold text-white"
+ data-testid="add-backend-cloud-title"
+ >
+ {t(I18nKey.BACKEND$CLOUD_TITLE)}
+ </h4>
+
+ <p className="text-sm text-gray-400 text-center leading-relaxed">
+ {t(I18nKey.BACKEND$CLOUD_DESCRIPTION)}
+ </p>
+
+ <DeviceFlowAuth
+ host={effectiveHost}
+ onSuccess={handleLoginSuccess}
+ testIdRoot="add-backend"
+ />
+
+ <details
+ className="w-full"
+ open={advancedOpen}
+ onToggle={(e) => setAdvancedOpen((e.target as HTMLDetailsElement).open)}
+ >
+ <summary
+ className="text-xs text-gray-400 cursor-pointer select-none text-center hover:text-gray-300"
+ data-testid="add-backend-advanced-toggle"
+ >
+ {t(I18nKey.BACKEND$ADVANCED)}
+ </summary>
+ <div className="mt-3">
+ <SettingsInput
+ testId="add-backend-cloud-host"
+ name="add-backend-cloud-host"
+ type="text"
+ label={t(I18nKey.BACKEND$HOST_LABEL)}
+ value={customHost}
+ onChange={setCustomHost}
+ placeholder={DEFAULT_OPENHANDS_CLOUD_HOST}
+ className="w-full"
+ />
+ <p className="text-xs text-gray-500 mt-1">
+ {t(I18nKey.BACKEND$LOGIN_CLOUD_HINT)}
+ </p>
+ </div>
+ </details>
+ </div>
+ );
+}
+
+// ── Modal wrappers ──────────────────────────────────────────────────
+
+/**
+ * Modal wrapper. In **add** mode it renders a two-column layout
+ * (manual connection | OR | Cloud login). In **edit** mode it wraps
+ * the standard `BackendForm`.
*/
export function BackendFormModal({
mode,
@@ -497,32 +571,76 @@ export function BackendFormModal({
}: BackendFormModalProps) {
const { t } = useTranslation("openhands");
- const titleKey =
- mode === "edit" ? I18nKey.BACKEND$EDIT_TITLE : I18nKey.BACKEND$ADD_TITLE;
- const testIdRoot = mode === "edit" ? "edit-backend" : "add-backend";
+ if (mode === "add") {
+ return (
+ <ModalBackdrop
+ onClose={onClose}
+ closeOnEscape={false}
+ aria-label={t(I18nKey.BACKEND$ADD_TITLE)}
+ >
+ <div
+ data-testid="add-backend-modal"
+ className="bg-base-secondary rounded-xl border border-tertiary"
+ style={{ width: "720px" }}
+ >
+ {/* Header */}
+ <div className="flex items-center justify-between px-6 pt-6 pb-2">
+ <h3 className="text-xl font-bold">
+ {t(I18nKey.BACKEND$ADD_TITLE)}
+ </h3>
+ <button
+ type="button"
+ onClick={onClose}
+ className="text-gray-400 hover:text-white text-xl leading-none cursor-pointer"
+ data-testid="add-backend-close"
+ aria-label="Close"
+ >
+ {"✕"}
+ </button>
+ </div>
+
+ {/* Two-column body */}
+ <div className="flex px-6 pb-6 pt-2">
+ {/* Left: manual connection */}
+ <div className="flex-1 min-w-0 pr-6">
+ <ManualConnectionColumn onClose={onClose} />
+ </div>
+
+ {/* Vertical OR divider */}
+ <div className="flex flex-col items-center mx-2 shrink-0">
+ <div className="flex-1 w-px bg-gray-600" />
+ <span className="text-xs text-gray-500 uppercase py-3">
+ {t(I18nKey.BACKEND$LOGIN_OR)}
+ </span>
+ <div className="flex-1 w-px bg-gray-600" />
+ </div>
+
+ {/* Right: cloud login */}
+ <div className="flex-1 min-w-0 pl-6">
+ <CloudLoginColumn onClose={onClose} />
+ </div>
+ </div>
+ </div>
+ </ModalBackdrop>
+ );
+ }
+ // Edit mode — single-column form (unchanged)
+ const testIdRoot = "edit-backend";
return (
<ModalBackdrop
onClose={onClose}
closeOnEscape={false}
- aria-label={t(titleKey)}
+ aria-label={t(I18nKey.BACKEND$EDIT_TITLE)}
>
<div
data-testid={`${testIdRoot}-modal`}
className="bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]"
style={{ width: "480px" }}
>
- <div className="flex flex-col gap-1">
- <h3 className="text-xl font-bold">{t(titleKey)}</h3>
- {mode === "add" ? (
- <p className="text-xs text-[var(--oh-muted)]">
- {t(I18nKey.BACKEND$ADD_SUBTITLE)}
- </p>
- ) : null}
- </div>
-
+ <h3 className="text-xl font-bold">{t(I18nKey.BACKEND$EDIT_TITLE)}</h3>
<BackendForm
- mode={mode}
+ mode="edit"
backend={backend}
onSubmitted={onClose}
testIdRoot={testIdRoot}
diff --git a/src/components/features/backends/device-flow-auth.tsx b/src/components/features/backends/device-flow-auth.tsx
index 492501c4da..555b6a96b4 100644
--- a/src/components/features/backends/device-flow-auth.tsx
+++ b/src/components/features/backends/device-flow-auth.tsx
@@ -18,7 +18,7 @@ interface DeviceFlowAuthProps {
/**
* Device Flow authentication UI component.
*
- * Shows a "Login with OpenHands" button that initiates OAuth 2.0 Device Flow
+ * Shows a "Login with OpenHands Cloud" button that initiates OAuth 2.0 Device Flow
* authentication. Displays status during the auth process and auto-opens
* the browser for user authorization.
*/
diff --git a/src/i18n/translation.json b/src/i18n/translation.json
index 71dd767cf7..f41b84d94c 100644
--- a/src/i18n/translation.json
+++ b/src/i18n/translation.json
@@ -23850,6 +23850,40 @@
"uk": "Хост",
"ca": "Host"
},
+ "BACKEND$HOST_HELPER": {
+ "en": "URL of your agent server",
+ "ja": "エージェントサーバーのURL",
+ "zh-CN": "Agent Server 的 URL",
+ "zh-TW": "Agent Server 的 URL",
+ "ko-KR": "에이전트 서버 URL",
+ "no": "URL-en til agentserveren din",
+ "it": "URL del tuo server agent",
+ "pt": "URL do seu servidor de agente",
+ "es": "URL de su servidor de agente",
+ "ar": "عنوان URL لخادم الوكيل الخاص بك",
+ "fr": "URL de votre serveur agent",
+ "tr": "Ajan sunucunuzun URL'si",
+ "de": "URL Ihres Agent-Servers",
+ "uk": "URL-адреса вашого сервера агентів",
+ "ca": "URL del vostre servidor d'agent"
+ },
+ "BACKEND$SELF_HOSTED_CLOUD_LINK": {
+ "en": "self-hosted OpenHands Cloud",
+ "ja": "セルフホスト型 OpenHands Cloud",
+ "zh-CN": "自托管 OpenHands Cloud",
+ "zh-TW": "自託管 OpenHands Cloud",
+ "ko-KR": "자체 호스팅 OpenHands Cloud",
+ "no": "selvhostet OpenHands Cloud",
+ "it": "OpenHands Cloud self-hosted",
+ "pt": "OpenHands Cloud auto-hospedado",
+ "es": "OpenHands Cloud autoalojado",
+ "ar": "OpenHands Cloud المستضاف ذاتيًا",
+ "fr": "OpenHands Cloud auto-hébergé",
+ "tr": "kendi barındırdığınız OpenHands Cloud",
+ "de": "selbst gehostetem OpenHands Cloud",
+ "uk": "самостійно розміщений OpenHands Cloud",
+ "ca": "OpenHands Cloud autoallotjat"
+ },
"BACKEND$KEY_LABEL": {
"en": "API Key",
"ja": "APIキー",
@@ -24174,21 +24208,123 @@
"ca": "Canviant a {{environment}}"
},
"BACKEND$LOGIN_WITH_OPENHANDS": {
- "en": "Login with OpenHands",
- "ja": "OpenHandsでログイン",
- "zh-CN": "使用 OpenHands 登录",
- "zh-TW": "使用 OpenHands 登入",
- "ko-KR": "OpenHands로 로그인",
- "no": "Logg inn med OpenHands",
- "it": "Accedi con OpenHands",
- "pt": "Entrar com OpenHands",
- "es": "Iniciar sesión con OpenHands",
- "ar": "تسجيل الدخول باستخدام OpenHands",
- "fr": "Se connecter avec OpenHands",
- "tr": "OpenHands ile giriş yap",
- "de": "Mit OpenHands anmelden",
- "uk": "Увійти через OpenHands",
- "ca": "Inicia sessió amb OpenHands"
+ "en": "Login with OpenHands Cloud",
+ "ja": "OpenHands Cloudでログイン",
+ "zh-CN": "使用 OpenHands Cloud 登录",
+ "zh-TW": "使用 OpenHands Cloud 登入",
+ "ko-KR": "OpenHands Cloud로 로그인",
+ "no": "Logg inn med OpenHands Cloud",
+ "it": "Accedi con OpenHands Cloud",
+ "pt": "Entrar com OpenHands Cloud",
+ "es": "Iniciar sesión con OpenHands Cloud",
+ "ar": "تسجيل الدخول باستخدام OpenHands Cloud",
+ "fr": "Se connecter avec OpenHands Cloud",
+ "tr": "OpenHands Cloud ile giriş yap",
+ "de": "Mit OpenHands Cloud anmelden",
+ "uk": "Увійти через OpenHands Cloud",
+ "ca": "Inicia sessió amb OpenHands Cloud"
+ },
+ "BACKEND$LOGIN_CLOUD_HINT": {
+ "en": "Works with OpenHands Cloud or your self-hosted OpenHands Cloud deployment.",
+ "ja": "OpenHands Cloud またはセルフホスト型 OpenHands Cloud デプロイメントで使用できます。",
+ "zh-CN": "适用于 OpenHands Cloud 或您的自托管 OpenHands Cloud 部署。",
+ "zh-TW": "適用於 OpenHands Cloud 或您的自託管 OpenHands Cloud 部署。",
+ "ko-KR": "OpenHands Cloud 또는 자체 호스팅 OpenHands Cloud 배포에서 사용할 수 있습니다.",
+ "no": "Fungerer med OpenHands Cloud eller din selvhostede OpenHands Cloud-distribusjon.",
+ "it": "Funziona con OpenHands Cloud o la tua distribuzione self-hosted di OpenHands Cloud.",
+ "pt": "Funciona com o OpenHands Cloud ou sua implantação auto-hospedada do OpenHands Cloud.",
+ "es": "Funciona con OpenHands Cloud o su implementación autoalojada de OpenHands Cloud.",
+ "ar": "يعمل مع OpenHands Cloud أو نشر OpenHands Cloud المستضاف ذاتيًا.",
+ "fr": "Fonctionne avec OpenHands Cloud ou votre déploiement auto-hébergé d'OpenHands Cloud.",
+ "tr": "OpenHands Cloud veya kendi barındırdığınız OpenHands Cloud dağıtımınızla çalışır.",
+ "de": "Funktioniert mit OpenHands Cloud oder Ihrer selbst gehosteten OpenHands Cloud-Installation.",
+ "uk": "Працює з OpenHands Cloud або вашим самостійно розміщеним розгортанням OpenHands Cloud.",
+ "ca": "Funciona amb OpenHands Cloud o el vostre desplegament autoallotjat d'OpenHands Cloud."
+ },
+ "BACKEND$CLOUD_TITLE": {
+ "en": "OpenHands Cloud",
+ "ja": "OpenHands Cloud",
+ "zh-CN": "OpenHands Cloud",
+ "zh-TW": "OpenHands Cloud",
+ "ko-KR": "OpenHands Cloud",
+ "no": "OpenHands Cloud",
+ "it": "OpenHands Cloud",
+ "pt": "OpenHands Cloud",
+ "es": "OpenHands Cloud",
+ "ar": "OpenHands Cloud",
+ "fr": "OpenHands Cloud",
+ "tr": "OpenHands Cloud",
+ "de": "OpenHands Cloud",
+ "uk": "OpenHands Cloud",
+ "ca": "OpenHands Cloud"
+ },
+ "BACKEND$CLOUD_DESCRIPTION": {
+ "en": "Skip the setup — connect instantly with your OpenHands Cloud account.",
+ "ja": "セットアップをスキップ — OpenHands Cloud アカウントですぐに接続できます。",
+ "zh-CN": "跳过设置 — 使用您的 OpenHands Cloud 帐户即时连接。",
+ "zh-TW": "跳過設定 — 使用您的 OpenHands Cloud 帳戶即時連線。",
+ "ko-KR": "설정을 건너뛰고 OpenHands Cloud 계정으로 바로 연결하세요.",
+ "no": "Hopp over oppsettet — koble til umiddelbart med OpenHands Cloud-kontoen din.",
+ "it": "Salta la configurazione — connettiti istantaneamente con il tuo account OpenHands Cloud.",
+ "pt": "Pule a configuração — conecte-se instantaneamente com sua conta OpenHands Cloud.",
+ "es": "Omita la configuración — conéctese instantáneamente con su cuenta de OpenHands Cloud.",
+ "ar": "تخطَّ الإعداد — اتصل فورًا بحسابك في OpenHands Cloud.",
+ "fr": "Passez la configuration — connectez-vous instantanément avec votre compte OpenHands Cloud.",
+ "tr": "Kurulumu atlayın — OpenHands Cloud hesabınızla anında bağlanın.",
+ "de": "Überspringen Sie die Einrichtung — verbinden Sie sich sofort mit Ihrem OpenHands Cloud-Konto.",
+ "uk": "Пропустіть налаштування — підключіться миттєво за допомогою облікового запису OpenHands Cloud.",
+ "ca": "Ometeu la configuració — connecteu-vos instantàniament amb el vostre compte d'OpenHands Cloud."
+ },
+ "BACKEND$CONNECT": {
+ "en": "Connect",
+ "ja": "接続",
+ "zh-CN": "连接",
+ "zh-TW": "連線",
+ "ko-KR": "연결",
+ "no": "Koble til",
+ "it": "Connetti",
+ "pt": "Conectar",
+ "es": "Conectar",
+ "ar": "اتصال",
+ "fr": "Connecter",
+ "tr": "Bağlan",
+ "de": "Verbinden",
+ "uk": "Підключити",
+ "ca": "Connecta"
+ },
+ "BACKEND$ADVANCED": {
+ "en": "Advanced",
+ "ja": "詳細設定",
+ "zh-CN": "高级",
+ "zh-TW": "進階",
+ "ko-KR": "고급",
+ "no": "Avansert",
+ "it": "Avanzate",
+ "pt": "Avançado",
+ "es": "Avanzado",
+ "ar": "متقدم",
+ "fr": "Avancé",
+ "tr": "Gelişmiş",
+ "de": "Erweitert",
+ "uk": "Розширені",
+ "ca": "Avançat"
+ },
+ "BACKEND$NAME_HELPER": {
+ "en": "A friendly label for this backend",
+ "ja": "このバックエンドのわかりやすいラベル",
+ "zh-CN": "此后端的友好标签",
+ "zh-TW": "此後端的友善標籤",
+ "ko-KR": "이 백엔드의 친숙한 라벨",
+ "no": "En vennlig etikett for denne backend-en",
+ "it": "Un'etichetta descrittiva per questo backend",
+ "pt": "Um rótulo amigável para este backend",
+ "es": "Una etiqueta descriptiva para este backend",
+ "ar": "تسمية ودية لهذا الخادم الخلفي",
+ "fr": "Un libellé descriptif pour ce backend",
+ "tr": "Bu arka uç için açıklayıcı bir etiket",
+ "de": "Ein beschreibender Name für dieses Backend",
+ "uk": "Зрозуміла назва для цього бекенду",
+ "ca": "Una etiqueta descriptiva per a aquest backend"
},
"BACKEND$LOGIN_OR_MANUAL": {
"en": "or enter API key manually",
diff --git a/tests/e2e/__snapshots__/snapshots/settings-page.snapshot.spec.ts/chromium/add-backend-modal.png b/tests/e2e/__snapshots__/snapshots/settings-page.snapshot.spec.ts/chromium/add-backend-modal.png
new file mode 100644
index 0000000000..11c22acaca
Binary files /dev/null and b/tests/e2e/__snapshots__/snapshots/settings-page.snapshot.spec.ts/chromium/add-backend-modal.png differ
diff --git a/tests/e2e/snapshots/settings-page.snapshot.spec.ts b/tests/e2e/snapshots/settings-page.snapshot.spec.ts
index 85805ae8bd..8190066e22 100644
--- a/tests/e2e/snapshots/settings-page.snapshot.spec.ts
+++ b/tests/e2e/snapshots/settings-page.snapshot.spec.ts
@@ -200,4 +200,40 @@ test.describe("UI Visual Snapshots", () => {
animations: "disabled",
});
});
+
+ test("Add backend modal renders correctly", async ({ page }) => {
+ await setupMocks(page, false);
+
+ // Mock the server-info health-check endpoint. Without this, the
+ // periodic health poll may prevent networkidle or cause hangs.
+ await page.route("**/server_info", async (route) => {
+ await route.fulfill({
+ status: 200,
+ contentType: "application/json",
+ body: JSON.stringify({ version: "mock" }),
+ });
+ });
+
+ await page.goto("/conversations");
+ await dismissConsentModal(page);
+
+ const homeScreen = page.getByTestId("home-screen");
+ await expect(homeScreen).toBeVisible();
+
+ // The backend selector uses openOnHover, so hovering opens the
+ // dropdown. Clicking the toggle would close it again, so we hover
+ // to open and then click the menu item directly.
+ const backendSelector = page.getByTestId("backend-selector");
+ await expect(backendSelector).toBeVisible({ timeout: 15_000 });
+ await backendSelector.hover();
+ await page.getByTestId("add-backend-menu-item").click();
+
+ const addBackendModal = page.getByTestId("add-backend-modal");
+ await expect(addBackendModal).toBeVisible();
+
+ await expect(addBackendModal).toHaveScreenshot("add-backend-modal.png", {
+ maxDiffPixelRatio: 0.01,
+ animations: "disabled",
+ });
+ });
});