Repository navigation
feat(gemini-cli): add custom projectId support (UI, DB, executor) #1991
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 all commits
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 |
|---|---|---|
|
|
@@ -6012,6 +6012,7 @@ function EditConnectionModal({ isOpen, connection, onSave, onClose }: EditConnec | |
| codexOpenaiStoreEnabled: false, | ||
| consoleApiKey: "", | ||
| ccCompatibleContext1m: false, | ||
| geminiProjectId: "", | ||
| blockExtraUsage: | ||
| connection?.provider === "claude" | ||
| ? isClaudeExtraUsageBlockEnabled(connection?.provider, connection?.providerSpecificData) | ||
|
|
@@ -6037,6 +6038,7 @@ function EditConnectionModal({ isOpen, connection, onSave, onClose }: EditConnec | |
| const isCloudflare = connection?.provider === "cloudflare-ai"; | ||
| const isCodex = connection?.provider === "codex"; | ||
| const isClaude = connection?.provider === "claude"; | ||
| const isGeminiCli = connection?.provider === "gemini-cli"; | ||
| const localProviderMetadata = getLocalProviderMetadata(connection?.provider); | ||
| const isLocalSelfHostedProvider = !!localProviderMetadata; | ||
| const isSearxng = connection?.provider === "searxng-search"; | ||
|
|
@@ -6099,6 +6101,7 @@ function EditConnectionModal({ isOpen, connection, onSave, onClose }: EditConnec | |
| codexOpenaiStoreEnabled: connection.providerSpecificData?.openaiStoreEnabled === true, | ||
| consoleApiKey: existingConsoleApiKey, | ||
| ccCompatibleContext1m: ccRequestDefaults.context1m, | ||
| geminiProjectId: (connection.providerSpecificData?.projectId as string) || "", | ||
| blockExtraUsage: isClaudeExtraUsageBlockEnabled( | ||
| connection.provider, | ||
| connection.providerSpecificData | ||
|
|
@@ -6205,6 +6208,10 @@ function EditConnectionModal({ isOpen, connection, onSave, onClose }: EditConnec | |
| healthCheckInterval: formData.healthCheckInterval, | ||
| }; | ||
|
|
||
| if (isGeminiCli) { | ||
| updates.projectId = formData.geminiProjectId.trim() || null; | ||
| } | ||
|
|
||
| if (isGooglePse && !formData.cx.trim()) { | ||
| setSaveError(t("searchEngineIdRequired")); | ||
| return; | ||
|
|
@@ -6326,6 +6333,9 @@ function EditConnectionModal({ isOpen, connection, onSave, onClose }: EditConnec | |
| updates.providerSpecificData.openaiStoreEnabled = | ||
| formData.codexOpenaiStoreEnabled === true; | ||
| } | ||
| if (isGeminiCli) { | ||
| updates.providerSpecificData.projectId = formData.geminiProjectId.trim() || undefined; | ||
| } | ||
|
Comment on lines
+6336
to
+6338
Contributor
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. Storing |
||
| } | ||
| const error = (await onSave(updates)) as void | unknown; | ||
| if (error) { | ||
|
|
@@ -6420,6 +6430,18 @@ function EditConnectionModal({ isOpen, connection, onSave, onClose }: EditConnec | |
| /> | ||
| </div> | ||
| )} | ||
| {isGeminiCli && ( | ||
| <div className="flex flex-col gap-4 rounded-lg border border-border/50 bg-surface/20 p-4"> | ||
| <Input | ||
| label={t("geminiCliProjectIdLabel")} | ||
| value={formData.geminiProjectId} | ||
| onChange={(e) => setFormData({ ...formData, geminiProjectId: e.target.value })} | ||
| placeholder={t("geminiCliProjectIdPlaceholder")} | ||
| hint={t("geminiCliProjectIdHint")} | ||
| className="font-mono text-xs" | ||
| /> | ||
| </div> | ||
| )} | ||
| {isOAuth && connection.email && ( | ||
| <div className="bg-sidebar/50 p-3 rounded-lg"> | ||
| <p className="text-sm text-text-muted mb-1">{t("email")}</p> | ||
|
|
||
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.
The initialization of
geminiProjectIdonly checksproviderSpecificData. SinceprojectIdis now a top-level field in the database (as seen in the API and schema changes), it should be prioritized during initialization to ensure values are correctly loaded from the new field.