Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Antigravity keeps Auto in the mode picker after a restart #40154

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/40154/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 99 additions and 28 deletions.

x
0 of 3 viewed, 3 left
30 additions and 0 deletionsapps/server/src/provider/Drivers/AntigravityDriver.tsModified
View file
@@ -3,8 +3,10 @@
AntigravitySettings,
ProviderDriverKind,
ProviderSetupError,
+ RuntimeMode,
settingsSecretLiteral,
} from "@t3tools/contracts";
+import { writeFileStringAtomically } from "@t3tools/shared/atomicWrite";
import * as HostProcess from "@t3tools/shared/HostProcess";
import { resolveSelfInvocation } from "@t3tools/shared/nodeRuntime";
import {
@@ -17,6 +19,7 @@
import * as Effect from "effect/Effect";
import * as Exit from "effect/Exit";
import * as Fiber from "effect/Fiber";
+import * as Option from "effect/Option";
import * as FileSystem from "effect/FileSystem";
import * as Path from "effect/Path";
import * as Schema from "effect/Schema";
@@ -86,6 +89,11 @@
const isAcpRequestError = Schema.is(AcpErrors.AcpRequestError);
const isProviderSetupError = Schema.is(ProviderSetupError);
const isAcpErrorDetails = Schema.is(Schema.Struct({ details: Schema.String }));
+const RememberedRuntimeModes = Schema.fromJsonString(
+ Schema.Struct({ authMethod: Schema.String, modes: Schema.Array(RuntimeMode) }),
+);
+const decodeRememberedRuntimeModes = Schema.decodeUnknownOption(RememberedRuntimeModes);
+const encodeRememberedRuntimeModes = Schema.encodeSync(RememberedRuntimeModes);