feat(providers): managed Antigravity and Codex installs can update past their pin #21249
MergedStiensWout(GitHub profile, opens in a new tab)merged 0 commits into
main fromrefs/pull/21249/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
- apps/server/src/provider/CodexInstallation.ts lines 340 to 341OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -273,0 +321,21 @@321+ const fileName = `codex-package-${asset.target}.tar.gz`;322+ const sha256 = parseChecksums(checksums).get(fileName);323+ if (!sha256) return null;324+ return {325+ version,326+ target: asset.target,327+ url: `${releaseUrl}/${fileName}`,328+ sha256,329+ archiveBytes: null,330+ } satisfies CodexReleaseAsset;331+ });332+ // A check already in flight covers concurrent subscribers, including when it fails.333+ const checkForUpdate = updateCheckGate334+ .withPermitsIfAvailable(1)(335+ Effect.gen(function* () {336+ const now = yield* Clock.currentTimeMillis;337+ if (upstreamCheckedAt !== null && now - upstreamCheckedAt < UPDATE_CHECK_INTERVAL_MS) {338+ return;339+ }340+ upstream = yield* lookupUpstream.pipe(Effect.timeout(UPDATE_CHECK_TIMEOUT));341+ upstreamCheckedAt = now;apps/server/src/provider/AntigravityInstallation.ts line 249OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -175,12 +231,19 @@231+175232 const state = yield* SubscriptionRef.make<ProviderInstallState>({176233 driver: DRIVER,177234 operationId: null,178235 phase: "idle",179236 downloadedBytes: 0,180- totalBytes: releaseAsset?.archiveBytes ?? null,181- version: releaseAsset?.version ?? null,237+ ...offer(null),182238 installedVersion: null,183239 canRemove: false,184240 message: null,185241 });186242243+ const lookupUpstream = Effect.gen(function* () {244+ const target = resolveAcpRegistryPlatformTarget(platform, arch);245+ if (!target) return null;246+ const response = yield* http247+ .execute(HttpClientRequest.get(ACP_REGISTRY_URL))248+ .pipe(Effect.flatMap(HttpClientResponse.filterStatusOk));249+ const index = yield* response.json.pipe(Effect.flatMap(decodeRegistryIndex));apps/server/src/provider/AntigravityInstallation.ts line 738OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -590,15 +723,16 @@590723 if (!entry) break;591- const expected = [asset.executable, asset.harness].find(592- (file) => file.name === entry.fileName,593- );724+ const expected = [executable, harness].find((file) => file.name === entry.fileName);725+ const expectedBytes = expected?.bytes ?? entry.uncompressedSize;594726 const unixType = (entry.externalFileAttributes >>> 16) & 0o170000;595727 if (596728 !expected ||597- seen.has(entry.fileName) ||729+ extracted.has(entry.fileName) ||598730 entry.fileName.includes("/") ||599731 entry.fileName.includes("\\") ||600732 (unixType !== 0 && unixType !== 0o100000) ||601733 (entry.externalFileAttributes & 0x10) !== 0 ||602734 (entry.generalPurposeBitFlag & 1) !== 0 ||603735 ![0, 8].includes(entry.compressionMethod) ||604- entry.uncompressedSize !== expected.bytes736+ entry.uncompressedSize !== expectedBytes ||737+ expectedBytes <= 0 ||738+ expectedBytes > UPSTREAM_MAX_MEMBER_BYTES
- apps/server/src/provider/CodexInstallation.ts line 800OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -574,7 +674,20 @@674+ executablePath: executable.executablePath,675+ message: null,676+ }) satisfies ProviderInstallState,677+ );678+ },679+ Effect.mapError(680+ wrapFailure(681+ "verify",682+ "The installed Codex runtime could not start. Remove it and reinstall.",683+ ),684+ ),685+ );574686 const start = gate575687 .withPermit(576688 Effect.gen(function* () {577689 const current = yield* SubscriptionRef.get(state);578690 if (isRunning(current)) return current;579691 if (yield* reuseLocal()) return yield* SubscriptionRef.get(state);580- if (!asset) {692+ const installedVersion = managedVersion(current);693+ const release = selectManagedRelease(installedVersion, asset, upstream);
- apps/server/src/provider/AntigravityInstallation.ts lines 904 to 911OutdatedResolvedby StiensWout(GitHub profile, opens in a new tab)@@ -710,6 +892,20 @@892+ wrapFailure(893+ "verify",894+ "The installed Antigravity runtime could not start. Remove it and reinstall.",895+ ),896+ ),897+ );898+710899 const start = gate711900 .withPermit(712901 Effect.gen(function* () {713902 const current = yield* SubscriptionRef.get(state);714903 if (isRunning(current)) return current;715- if (!releaseAsset) {904+ // The manifest may have withdrawn the cached upstream release since its lookup.905+ if (upstream && (yield* isWithdrawn(upstream.version))) upstream = null;906+ const release = selectManagedRelease<AntigravityRelease>(907+ current.installedVersion,908+ releaseAsset,909+ upstream,910+ );911+ if (!release && current.installedVersion === null) {apps/server/src/provider/CodexInstallation.ts lines 692 to 697OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -574,7 +678,20 @@678+ },679+ Effect.mapError(680+ wrapFailure(681+ "verify",682+ "The installed Codex runtime could not start. Remove it and reinstall.",683+ ),684+ ),685+ );574686 const start = gate575687 .withPermit(576688 Effect.gen(function* () {577689 const current = yield* SubscriptionRef.get(state);578690 if (isRunning(current)) return current;579691 if (yield* reuseLocal()) return yield* SubscriptionRef.get(state);580- if (!asset) {692+ const installedVersion = managedVersion(current);693+ // The manifest may have withdrawn the cached upstream release since its lookup.694+ if (upstream && (yield* compatibility(upstream.version))?.status !== "supported") {695+ upstream = null;696+ }697+ const release = selectManagedRelease(installedVersion, asset, upstream);docs/user/install.md lines 168 to 169OutdatedResolvedby StiensWout(GitHub profile, opens in a new tab)@@ -161,6 +161,9 @@161161 available version. **Update now** runs the installer that owns the CLI162162 (Homebrew, or a global npm, pnpm, Yarn, Bun, Volta, or Vite+ install), or the163163 CLI's own update command when T3 Code cannot tell. Update a CLI installed with164-mise through mise. Cursor and Antigravity update with T3 Code. Homebrew installs165-compare against the version Homebrew offers, which can trail the npm release by166-a few hours.164+mise through mise. Cursor updates with T3 Code. Homebrew installs compare against165+the version Homebrew offers, which can trail the npm release by a few hours.166+167+The managed runtimes for Antigravity and for Codex connected through ChatGPT168+first install the release T3 Code tested. When the provider publishes a newer169+one, their setup in **Settings → Providers** offers an update.
- apps/server/src/provider/AntigravityInstallation.ts line 267OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -186,0 +245,21 @@245+ // The model manifest can withdraw a bad upstream release without a T3 Code release.246+ const isWithdrawn = Effect.fn("AntigravityInstallation.isWithdrawn")(function* (version: string) {247+ const manifest = yield* manifestService.current;248+ const status = (249+ resolveProviderCompatibility(manifest.compatibility, DRIVER, version) ??250+ resolveProviderCompatibility(251+ ModelManifest.BUNDLED_MODEL_MANIFEST.compatibility,252+ DRIVER,253+ version,254+ )255+ )?.status;256+ return status === "broken" || status === "unsupported";257+ });258+259+ // Forgets what the manifest withdrew after it was seen. A withdrawn install260+ // is not kept either, so the pin replaces it rather than a re-check.261+ const keptInstall = Effect.fn("AntigravityInstallation.keptInstall")(function* (262+ installedVersion: string | null,263+ ) {264+ if (upstream && (yield* isWithdrawn(upstream.version))) upstream = null;265+ return installedVersion !== null && !(yield* isWithdrawn(installedVersion))
- apps/server/src/provider/AntigravityInstallation.ts lines 443 to 448OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -303,4 +436,11 @@303436 }304437 if (yield* fs.exists(activePath)) {305438 const active = yield* readRecord(activePath, ActiveRelease);306- return yield* completedRelease(active.releaseId);439+ const installed = yield* completedRelease(active.releaseId);440+ // Without this a withdrawn install keeps launching until its owner updates.441+ if (yield* isWithdrawn(installed.version)) {442+ return yield* installationError(443+ "resolve",444+ `Antigravity ${installed.version} no longer works with this T3 Code release. Update it in Antigravity setup.`,445+ );446+ }
maria-rcks closed this
maria-rcks reopened this
- apps/server/src/provider/CodexInstallation.ts line 772OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -641,3 +751,14 @@641751 ),642752 ),643753 );754+ // Nothing newer is known, so "reinstall" re-checks the active runtime rather755+ // than replacing it with an older pinned release.756+ const reverify = Effect.fn("CodexInstallation.reverify")(757+ function* () {758+ const active = yield* readRecord(activePath, ActiveRelease);759+ const executable = yield* completedRelease(active.version);760+ yield* validate(executable, executable.version).pipe(761+ Effect.scoped,762+ Effect.timeout("90 seconds"),763+ );764+ yield* SubscriptionRef.update(
- apps/server/src/provider/AntigravityInstallation.ts lines 287 to 294OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -188,0 +274,21 @@274+ if (!target) return null;275+ const response = yield* http276+ .execute(HttpClientRequest.get(ACP_REGISTRY_URL))277+ .pipe(Effect.flatMap(HttpClientResponse.filterStatusOk));278+ const body = yield* collectUint8StreamText({279+ stream: response.stream,280+ maxBytes: MAX_REGISTRY_BYTES + 1,281+ });282+ if (body.truncated || body.bytes > MAX_REGISTRY_BYTES || body.invalidUtf8) return null;283+ const index = yield* decodeRegistryIndex(body.text);284+ const entry = index.agents.find(isUpstreamAgent);285+ if (!entry) return null;286+ const agent = yield* decodeRegistryAgent(entry);287+ // Checked after normalization so an encoded `..` cannot leave the releases path.288+ const archive = agent.distribution.binary?.[target]?.archive;289+ const url = archive === undefined ? undefined : URL.parse(archive)?.href;290+ if (!/^\d+\.\d+\.\d+$/u.test(agent.version) || !url?.startsWith(UPSTREAM_DOWNLOAD_PREFIX)) {291+ return null;292+ }293+ if (yield* isWithdrawn(agent.version)) return null;294+ return { version: agent.version, url } satisfies AntigravityUpstreamRelease;
tanstack-source added labelsfeature
t3dotgg(GitHub profile, opens in a new tab) closed this
Yash-Singh1(GitHub profile, opens in a new tab) reopened this
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Yash-Singh1(GitHub profile, opens in a new tab) approved these changes
Yash-Singh1(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.




macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed