fix(core): ensure experiments are fetched even without projectId

This commit is contained in:
Sehoon Shon
2026-03-08 22:09:46 -04:00
parent fdd1ebbdf1
commit 2a0b007fec

View File

@@ -1254,19 +1254,21 @@ export class Config implements McpContext {
this.baseLlmClient = new BaseLlmClient(this.contentGenerator, this);
const codeAssistServer = getCodeAssistServer(this);
if (codeAssistServer?.projectId) {
const quotaPromise = this.refreshUserQuota();
this.experimentsPromise = getExperiments(codeAssistServer)
.then((experiments) => {
this.setExperiments(experiments);
return experiments;
})
.catch((e) => {
debugLogger.error('Failed to fetch experiments', e);
return undefined;
});
await quotaPromise;
}
const quotaPromise = codeAssistServer?.projectId
? this.refreshUserQuota()
: Promise.resolve();
this.experimentsPromise = getExperiments(codeAssistServer)
.then((experiments) => {
this.setExperiments(experiments);
return experiments;
})
.catch((e) => {
debugLogger.error('Failed to fetch experiments', e);
return undefined;
});
await quotaPromise;
const authType = this.contentGeneratorConfig.authType;
if (