Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Antigravity accounts: a sign-in closes once the account is read again; Add copies a working path; a hidden account's sign-in is dropped
laijsg120c4defd30c8
diff --git a/src/components/EngineAccounts.tsx b/src/components/EngineAccounts.tsxindex 9d846e59fd..7a33ff2fe5 100644--- a/src/components/EngineAccounts.tsx+++ b/src/components/EngineAccounts.tsx@@ -257,7 +257,7 @@ function AccountRow({ group, instance, several, signingIn, onSignIn, onSignInDon{t("accounts.signIn")}</button>)}- <AccountMenu group={group} instance={instance} signingIn={signingIn} onRename={() => setRenaming(true)} />+ <AccountMenu group={group} instance={instance} signingIn={signingIn && !setsUp} onRename={() => setRenaming(true)} /></>)}</div>@@ -367,6 +367,13 @@ export function AccountsCard({ group, accounts, advanced, bare = false }: { grouconst [signingIn, setSigningIn] = useState<readonly string[]>([]);const startSignIn = (instanceId: string) => setSigningIn((current) => group === "antigravity" ? [...current.filter((id) => id !== instanceId), instanceId] : [instanceId]);const endSignIn = (instanceId: string) => setSigningIn((current) => current.includes(instanceId) ? current.filter((id) => id !== instanceId) : current);+ const shown = accounts.map((instance) => instance.instanceId);+ const wereShown = useRef(shown);+ useEffect(() => {+ const gone = wereShown.current.filter((id) => !shown.includes(id));+ wereShown.current = shown;+ if (gone.length) setSigningIn((current) => current.filter((id) => !gone.includes(id)));+ });const primary = accounts[0]!;const listed = group === "antigravity" || accounts.some((instance) => instance.snapshot.state === "available");const policy = accounts.find((instance) => instance.policy)?.policy;@@ -390,7 +397,7 @@ export function AccountsCard({ group, accounts, advanced, bare = false }: { grou</ul>{!primary.snapshot.authenticationUnavailableReason && <><AddAccount label={t(COPY[group].add)} endpoint={`/api/instances/${group}-accounts`} folder={group === "claude"}- extra={group === "antigravity" ? { sourceInstanceId: primary.instanceId } : undefined}+ extra={group === "antigravity" ? { sourceInstanceId: (accounts.find((instance) => instance.snapshot.state === "available") ?? primary).instanceId } : undefined}describedBy={browserAccounts ? noteId : undefined} onAdded={startSignIn} />{browserAccounts && <p id={noteId} className="px-2 text-[12px] leading-relaxed text-ink-secondary">{t("accounts.addChatgptWorkspaceNote")}</p>}</>}diff --git a/src/components/EngineSetup.tsx b/src/components/EngineSetup.tsxindex 2127a938c0..24117b033b 100644--- a/src/components/EngineSetup.tsx+++ b/src/components/EngineSetup.tsx@@ -298,7 +298,6 @@ function ManagedEngineSetup({ instance, signInOnly, autoStart = false, onDone }:instance: InstanceInfo;signInOnly: boolean;autoStart?: boolean;- /** Signed in or cancelled; given, the panel offers Cancel. */onDone?: () => void;}) {const { state, refreshInstances, refreshModels } = useStore();@@ -327,9 +326,9 @@ function ManagedEngineSetup({ instance, signInOnly, autoStart = false, onDone }:if (!live || auth.phase === "waiting" || auth.phase === "verifying") return;if (auth.phase !== "succeeded") return ended(auth.phase === "expired" ? t("engineSetup.googleExpired") : auth.message ?? t("engineSetup.googleFailed"));if (done.current) {+ await refreshInstances().catch(() => {});ended(null);- done.current();- void refreshInstances().catch(() => {});+ done.current?.();void refreshModels(instance.instanceId).catch(() => {});return;}@@ -375,8 +374,8 @@ function ManagedEngineSetup({ instance, signInOnly, autoStart = false, onDone }:await refreshModels(instance.instanceId);return;}- done.current();- void refreshInstances().catch(() => {});+ await refreshInstances().catch(() => {});+ done.current?.();void refreshModels(instance.instanceId).catch(() => {});};@@ -532,7 +531,7 @@ function ManagedEngineSetup({ instance, signInOnly, autoStart = false, onDone }:{error && <p role="alert" className="text-[12px] text-danger">{error}</p>}{onDone && <button type="button" aria-disabled={busy === "complete" || cancelling || undefined} aria-busy={cancelling || undefined}onClick={busy === "complete" || cancelling ? undefined : () => void cancel()}- className="rounded-lg px-2.5 py-1.5 text-[12px] text-ink-secondary hover:bg-control aria-disabled:opacity-50">{t("common.cancel")}</button>}+ className="ui-button ui-button-md aria-disabled:opacity-50">{t("common.cancel")}</button>}</div>);}diff --git a/src/components/EnginesSettings.antigravity.dom.test.ts b/src/components/EnginesSettings.antigravity.dom.test.tsindex f9dced5ac9..f255dac8ac 100644--- a/src/components/EnginesSettings.antigravity.dom.test.ts+++ b/src/components/EnginesSettings.antigravity.dom.test.ts@@ -324,6 +324,50 @@ describe("Google Gemini (Antigravity) accounts share one card", () => {await act(async () => { send(); await fixture.completeGate; });});+ it("offers no second sign-in once a pasted redirect is accepted, while the account is read again", async () => {+ fixture.state.instances = [google("antigravity", "Personal", { authenticated: false })];+ await render();+ await click(buttons(row("antigravity"), "Sign in")[0]);+ await pasteRedirect("antigravity");+ const refresh = gate();+ fixture.refreshGate = refresh.promise;+ await click(buttons(row("antigravity"), "Send redirect")[0]);+ expect(usable(row("antigravity"))).not.toContain("Sign in");+ expect(usable(row("antigravity"))).not.toContain("Open Google sign-in again");+ await refresh.open();+ expect(row("antigravity").querySelector("[data-account-sign-in]")).toBeNull();+ });++ it("adds an account with the path of one that can run, when the first cannot", async () => {+ fixture.state.instances = [+ google("antigravity", "Personal", { state: "unavailable", authenticated: undefined, reason: "Not installed" }),+ google("antigravity-native", "Native", {}, { cli: "/opt/agy/antigravity" }),+ ];+ await render();+ await click(buttons(container, "Add Google account")[0]);+ const input = container.querySelector<HTMLInputElement>("form[data-add-account] input")!;+ await act(async () => {+ Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")!.set!.call(input, "Work");+ input.dispatchEvent(new Event("input", { bubbles: true }));+ });+ await click(buttons(container, "Add and sign in")[0]);+ expect(fixture.calls[0]?.body).toEqual({ displayName: "Work", sourceInstanceId: "antigravity-native" });+ });++ it("does not start a sign-in again for an account hidden while it waited and shown again", async () => {+ const work = google("antigravity-work", "Work", { authenticated: false });+ fixture.state.instances = [fixture.state.instances[0]!, work];+ await render();+ await click(buttons(row("antigravity-work"), "Sign in")[0]);+ fixture.state = { ...fixture.state, instances: [fixture.state.instances[0]!] };+ await render();+ fixture.state = { ...fixture.state, instances: [fixture.state.instances[0]!, work] };+ await render();+ expect(startCalls()).toEqual(["/api/instances/antigravity-work/auth/start"]);+ expect(row("antigravity-work").querySelector("[data-account-sign-in]")).toBeNull();+ expect(buttons(row("antigravity-work"), "Sign in")).toHaveLength(1);+ });+it("closes the panel of a sign-in the server accepted even when the models cannot be read yet", async () => {fixture.state.instances = [google("antigravity", "Personal", { authenticated: false })];fixture.modelsFail = true;