From 96f5dd71fe4fccbd59ef0299d39edad43a98b5a9 Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Tue, 1 Sep 2026 10:38:34 +0000 Subject: [PATCH] fix(site): allow Antigravity IDE token substitution (#28784) Allow `antigravity-ide:` app URLs so Coder substitutes the generated session token before launching Antigravity IDE. Refs coder/registry#1079. (cherry picked from commit d58b38b64a2875a50f481b5ae9248669c88a3a4c) --- site/src/modules/apps/apps.test.ts | 18 ++++++++++++++++++ site/src/modules/apps/apps.ts | 1 + 2 files changed, 19 insertions(+) diff --git a/site/src/modules/apps/apps.test.ts b/site/src/modules/apps/apps.test.ts index 7012b3ab472..9698b928f01 100644 --- a/site/src/modules/apps/apps.test.ts +++ b/site/src/modules/apps/apps.test.ts @@ -97,6 +97,24 @@ describe("getAppHref", () => { expect(href).toBe("vscode://example.com?token=user-session-token"); }); + it("replaces the session token for Antigravity IDE URLs", () => { + const externalApp = { + ...MockWorkspaceApp, + external: true, + url: `antigravity-ide://coder.coder-remote/open?token=${SESSION_TOKEN_PLACEHOLDER}`, + }; + const href = getAppHref(externalApp, { + host: "*.apps-host.tld", + path: "/path-base", + agent: MockWorkspaceAgent, + workspace: MockWorkspace, + token: "user-session-token", + }); + expect(href).toBe( + "antigravity-ide://coder.coder-remote/open?token=user-session-token", + ); + }); + it("doesn't return the URL with the session token replaced when using the HTTP protocol", () => { const externalApp = { ...MockWorkspaceApp, diff --git a/site/src/modules/apps/apps.ts b/site/src/modules/apps/apps.ts index e822eb961a8..235c37c2c66 100644 --- a/site/src/modules/apps/apps.ts +++ b/site/src/modules/apps/apps.ts @@ -27,6 +27,7 @@ const ALLOWED_EXTERNAL_APP_PROTOCOLS = [ "kiro:", "positron:", "antigravity:", + "antigravity-ide:", ]; type GetVSCodeHrefParams = {