fix(server): Antigravity helper processes run in an auth-only profile #43075
OpenTom-R-Main(GitHub profile, opens in a new tab)wants to merge 5 commits into
main fromrefs/pull/43075/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- @@ -546,0 +679,21 @@679+ );680+ } else {681+ const existingLink = targetStat?.isSymbolicLink()682+ ? yield* fs.readLink(targetPath).pipe(683+ Effect.map((value) => path.resolve(path.dirname(targetPath), value)),684+ Effect.orElseSucceed((): string | undefined => undefined),685+ )686+ : undefined;687+ if (existingLink !== sourcePath) {688+ if (targetStat !== undefined) {689+ yield* fs690+ .remove(targetPath, { force: true })691+ .pipe(692+ Effect.mapError(() =>693+ authSupportError("The Antigravity helper auth file could not be replaced."),694+ ),695+ );696+ }697+ yield* Effect.tryPromise({698+ try: () => NodeFSP.symlink(sourcePath, targetPath, "file"),699+ catch: () => authSupportError("The Antigravity helper auth file could not be linked."),
Pushed649b908
- @@ -546,0 +597,21 @@597+ readonly runtimeExecutablePath?: string;598+ readonly platform?: NodeJS.Platform;599+ readonly auth?: AntigravityAuthConfig;600+ readonly tempDirectory?: string;601+ }) {602+ const auth = input.auth ?? ANTIGRAVITY_PERSONAL_AUTH;603+ const fs = yield* FileSystem.FileSystem;604+ const path = yield* Path.Path;605+ const helperDirectory = resolveAntigravityHelperProfileDirectory(path, input.profileDirectory);606+ const { profile, platform, realAcpDirectory } = yield* prepareAntigravityProfileBase({607+ ...input,608+ geminiHome: helperDirectory,609+ });610+ const helperConfigDirectory = path.join(helperDirectory, "config");611+ const helperAcpDirectory = profile.acpDirectory;612+613+ // Migrate any earlier directory symlink to a real directory so helper runs never touch real plugin_data/ or mcp/.614+ const existingAcpStat = yield* lstatOrUndefined(helperAcpDirectory);615+ if (existingAcpStat?.isSymbolicLink()) {616+ yield* fs617+ .remove(helperAcpDirectory, { force: true })
Pushed0dca381
Pushed32f0153
- @@ -395,3 +396,16 @@395396 .map((request) => request.params?.mcpServers),396397 ).toEqual([[], []]);397398 yield* h.assertClosed;399+ // User MCPs/hooks in the real profile must not disable or run inside the isolated helper.400+ const profileConfigDir = h.path.join(h.profileDirectory, "config");401+ yield* h.fs.makeDirectory(profileConfigDir, { recursive: true });402+ yield* h.fs.writeFileString(403+ h.path.join(profileConfigDir, "mcp_config.json"),404+ '{"mcpServers":{"notion":{"url":"https://mcp.notion.com/mcp"}}}',405+ );406+ yield* h.fs.writeFileString(407+ h.path.join(profileConfigDir, "hooks.json"),408+ '{"default":{"PreInvocation":[{"command":"echo nope"}]}}',409+ );410+ const snapshotWithProfileConfig = yield* h.instance.snapshot.getSnapshot;411+ expect(snapshotWithProfileConfig.supportsTextGeneration).toBe(true);
github-actions[bot](GitHub profile, opens in a new tab) added labelsneeds-rebase
Sign in to join this conversation.
Codex Review Summary: ❌ Failed
This comment shows the latest Codex review activity on this pull request.
We couldn’t complete this review. Comment
@codex reviewto try again.0c70d75ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.