Skip to content

Commit a4f9ba9

Browse files
committed
refactor: remove debug logging from configuration checks in CodeIndexConfigManager and webviewMessageHandler
1 parent ccef3d9 commit a4f9ba9

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

src/core/webview/webviewMessageHandler.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,15 +1830,6 @@ export const webviewMessageHandler = async (
18301830
const settings = message.codeIndexSettings
18311831

18321832
try {
1833-
console.log(`[DEBUG WebviewHandler] Starting atomic save for code index settings`)
1834-
console.log(`[DEBUG WebviewHandler] Settings received:`, {
1835-
enabled: settings.codebaseIndexEnabled,
1836-
provider: settings.codebaseIndexEmbedderProvider,
1837-
openAiKey: settings.codeIndexOpenAiKey
1838-
? `"${settings.codeIndexOpenAiKey.substring(0, 4)}..."`
1839-
: "undefined",
1840-
})
1841-
18421833
// Save global state settings atomically (without codebaseIndexEnabled which is now in global settings)
18431834
const currentConfig = getGlobalState("codebaseIndexConfig") || {}
18441835
const globalStateConfig = {
@@ -1867,12 +1858,15 @@ export const webviewMessageHandler = async (
18671858
settings.codebaseIndexOpenAiCompatibleApiKey,
18681859
)
18691860
}
1861+
if (settings.codebaseIndexGeminiApiKey !== undefined) {
1862+
await provider.contextProxy.storeSecret(
1863+
"codebaseIndexGeminiApiKey",
1864+
settings.codebaseIndexGeminiApiKey,
1865+
)
1866+
}
18701867

18711868
// Verify secrets are actually stored
18721869
const storedOpenAiKey = provider.contextProxy.getSecret("codeIndexOpenAiKey")
1873-
console.log(
1874-
`[DEBUG WebviewHandler] Verification - stored OpenAI key: ${storedOpenAiKey ? `"${storedOpenAiKey.substring(0, 4)}..."` : "undefined"}`,
1875-
)
18761870

18771871
// Notify code index manager of changes
18781872
if (provider.codeIndexManager) {
@@ -1922,13 +1916,15 @@ export const webviewMessageHandler = async (
19221916
const hasOpenAiCompatibleApiKey = !!(await provider.context.secrets.get(
19231917
"codebaseIndexOpenAiCompatibleApiKey",
19241918
))
1919+
const hasGeminiApiKey = !!(await provider.context.secrets.get("codebaseIndexGeminiApiKey"))
19251920

19261921
provider.postMessageToWebview({
19271922
type: "codeIndexSecretStatus",
19281923
values: {
19291924
hasOpenAiKey,
19301925
hasQdrantApiKey,
19311926
hasOpenAiCompatibleApiKey,
1927+
hasGeminiApiKey,
19321928
},
19331929
})
19341930
break

src/services/code-index/config-manager.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,11 @@ export class CodeIndexConfigManager {
183183
const apiKey = this.openAiCompatibleOptions?.apiKey
184184
const qdrantUrl = this.qdrantUrl
185185
const isConfigured = !!(baseUrl && apiKey && qdrantUrl)
186-
console.log(
187-
`[DEBUG ConfigManager] OpenAI Compatible config check: baseUrl=${baseUrl}, key=${apiKey ? `"${apiKey.substring(0, 4)}..."` : "undefined"}, url=${qdrantUrl}, configured=${isConfigured}`,
188-
)
189186
return isConfigured
190187
} else if (this.embedderProvider === "gemini") {
191188
const apiKey = this.geminiOptions?.apiKey
192189
const qdrantUrl = this.qdrantUrl
193190
const isConfigured = !!(apiKey && qdrantUrl)
194-
console.log(
195-
`[DEBUG ConfigManager] Gemini config check: key=${apiKey ? `"${apiKey.substring(0, 4)}..."` : "undefined"}, url=${qdrantUrl}, configured=${isConfigured}`,
196-
)
197191
return isConfigured
198192
}
199193
return false // Should not happen if embedderProvider is always set correctly

0 commit comments

Comments
 (0)