Repository navigation
Reuse a signed-in agy for Antigravity quota refresh without the desktop app #3161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,9 @@ public enum AntigravityProviderDescriptor { | |
| }), | ||
| fetchPlan: ProviderFetchPlan( | ||
| sourceModes: [.auto, .cli, .oauth], | ||
| pipeline: ProviderFetchPipeline(resolveStrategies: self.resolveStrategies)), | ||
| pipeline: ProviderFetchPipeline( | ||
| resolveStrategies: self.resolveStrategies, | ||
| resolveFallbackError: self.resolveFallbackError)), | ||
| cli: ProviderCLIConfig( | ||
| name: "antigravity", | ||
| versionDetector: nil)) | ||
|
|
@@ -205,6 +207,15 @@ public enum AntigravityProviderDescriptor { | |
| let fileURL = AntigravityOAuthCredentialsStore.defaultURL(home: homeURL) | ||
| return FileManager.default.fileExists(atPath: fileURL.path) | ||
| } | ||
|
|
||
| static func resolveFallbackError(_ previous: Error?, _ current: Error) -> Error { | ||
| if (previous as? AntigravityStatusProbeError) == .authenticationRequired, | ||
| (current as? AntigravityStatusProbeError) == .notRunning | ||
| { | ||
| return previous ?? current | ||
| } | ||
| return current | ||
| } | ||
| } | ||
|
|
||
| struct AntigravityStatusFetchStrategy: ProviderFetchStrategy { | ||
|
|
@@ -553,10 +564,10 @@ struct AntigravityCLIHTTPSFetchStrategy: ProviderFetchStrategy { | |
| // CodexBar must not manage its lifecycle, idle timeout, or | ||
| // `resetAfterFetch` teardown. Those apply only to processes CodexBar | ||
| // itself spawns on the fallback path below. | ||
| // Long-lived hosts already keep a managed session warm. Restrict external | ||
| // process reuse to one-shot CLI calls so app/server lifecycle accounting | ||
| // stays entirely inside AntigravityCLISession. | ||
| if resetAfterFetch, let warmSnapshot = try await Self.tryWarmAgyFetch( | ||
| // Persistent hosts also need the external path: a user-owned, signed-in | ||
| // `agy` may have credentials a newly spawned managed session cannot read. | ||
| // Owned pids remain excluded, so their lifecycle accounting is unchanged. | ||
| if let warmSnapshot = try await Self.tryWarmAgyFetch( | ||
| timeout: 2.0, | ||
| expectedBinaryPath: binary, | ||
|
Comment on lines
+570
to
572
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a user starts Useful? React with 👍 / 👎. |
||
| expectedAccountEmail: expectedAccountEmail, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the CLI emits one of the newly recognized signed-out messages and a tokenless Antigravity IDE process is also present, the subsequent IDE probe throws
.missingCSRFTokenrather than.notRunning. This resolver consequently replaces the actionable.authenticationRequiredresult and again tells the user to restart Antigravity instead of signing intoagy; treat IDE-unavailability errors such as.missingCSRFTokenthe same as.notRunningwhen an earlier CLI authentication failure exists.Useful? React with 👍 / 👎.