mirror of
https://github.com/google-gemini/gemini-cli
synced 2026-04-21 13:37:17 +00:00
feat(config): trigger auth refresh on model switch to support hybrid mode via /model
This commit is contained in:
parent
d33d5cf7e5
commit
1a5706268e
1 changed files with 9 additions and 0 deletions
|
|
@ -1928,6 +1928,15 @@ export class Config implements McpContext, AgentLoopContext {
|
|||
this.lastEmittedQuotaRemaining = undefined;
|
||||
this.lastEmittedQuotaLimit = undefined;
|
||||
this.emitQuotaChangedEvent();
|
||||
|
||||
// HYBRID AUTH TRIGGER: When changing model via /model, refresh auth
|
||||
// so that hybrid mode (OpenAI + Google) is correctly initialized.
|
||||
const newAuthType = getAuthTypeFromEnv(newModel);
|
||||
if (newAuthType) {
|
||||
this.refreshAuth(newAuthType).catch((err) => {
|
||||
debugLogger.log(`[Config] Auth refresh failed on model switch: ${err.message}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (this.onModelChange && !isTemporary) {
|
||||
this.onModelChange(newModel);
|
||||
|
|
|
|||
Loading…
Reference in a new issue