mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-17 09:30:58 -07:00
fix: update currentSequenceModel when modelChanged (#17051)
This commit is contained in:
committed by
Tommaso Sciortino
parent
02e68e4554
commit
217f277580
@@ -166,11 +166,6 @@ describe('useQuotaAndFallback', () => {
|
||||
const intent = await promise!;
|
||||
expect(intent).toBe('retry_always');
|
||||
|
||||
// Verify activateFallbackMode was called
|
||||
expect(mockConfig.activateFallbackMode).toHaveBeenCalledWith(
|
||||
'gemini-flash',
|
||||
);
|
||||
|
||||
// The pending request should be cleared from the state
|
||||
expect(result.current.proQuotaRequest).toBeNull();
|
||||
expect(mockHistoryManager.addItem).toHaveBeenCalledTimes(1);
|
||||
@@ -282,11 +277,6 @@ describe('useQuotaAndFallback', () => {
|
||||
const intent = await promise!;
|
||||
expect(intent).toBe('retry_always');
|
||||
|
||||
// Verify activateFallbackMode was called
|
||||
expect(mockConfig.activateFallbackMode).toHaveBeenCalledWith(
|
||||
'model-B',
|
||||
);
|
||||
|
||||
// The pending request should be cleared from the state
|
||||
expect(result.current.proQuotaRequest).toBeNull();
|
||||
expect(mockConfig.setQuotaErrorOccurred).toHaveBeenCalledWith(true);
|
||||
@@ -342,11 +332,6 @@ To disable gemini-3-pro-preview, disable "Preview features" in /settings.`,
|
||||
const intent = await promise!;
|
||||
expect(intent).toBe('retry_always');
|
||||
|
||||
// Verify activateFallbackMode was called
|
||||
expect(mockConfig.activateFallbackMode).toHaveBeenCalledWith(
|
||||
'gemini-2.5-pro',
|
||||
);
|
||||
|
||||
expect(result.current.proQuotaRequest).toBeNull();
|
||||
});
|
||||
});
|
||||
@@ -430,11 +415,6 @@ To disable gemini-3-pro-preview, disable "Preview features" in /settings.`,
|
||||
expect(intent).toBe('retry_always');
|
||||
expect(result.current.proQuotaRequest).toBeNull();
|
||||
|
||||
// Verify activateFallbackMode was called
|
||||
expect(mockConfig.activateFallbackMode).toHaveBeenCalledWith(
|
||||
'gemini-flash',
|
||||
);
|
||||
|
||||
// Verify quota error flags are reset
|
||||
expect(mockSetModelSwitchedFromQuotaError).toHaveBeenCalledWith(false);
|
||||
expect(mockConfig.setQuotaErrorOccurred).toHaveBeenCalledWith(false);
|
||||
|
||||
@@ -135,10 +135,6 @@ export function useQuotaAndFallback({
|
||||
config.setQuotaErrorOccurred(false);
|
||||
|
||||
if (choice === 'retry_always') {
|
||||
// Set the model to the fallback model for the current session.
|
||||
// This ensures the Footer updates and future turns use this model.
|
||||
// The change is not persisted, so the original model is restored on restart.
|
||||
config.activateFallbackMode(proQuotaRequest.fallbackModel);
|
||||
historyManager.addItem(
|
||||
{
|
||||
type: MessageType.INFO,
|
||||
|
||||
Reference in New Issue
Block a user