@umsai/ums-code 0.5.0-v1 → 0.6.0-v1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +4 -4
- package/dist/src/acp-integration/acp.d.ts +6 -0
- package/dist/src/acp-integration/acp.js +7 -0
- package/dist/src/acp-integration/acp.js.map +1 -1
- package/dist/src/acp-integration/acpAgent.js +33 -7
- package/dist/src/acp-integration/acpAgent.js.map +1 -1
- package/dist/src/acp-integration/schema.d.ts +1235 -892
- package/dist/src/acp-integration/schema.js +19 -0
- package/dist/src/acp-integration/schema.js.map +1 -1
- package/dist/src/acp-integration/session/Session.d.ts +0 -5
- package/dist/src/acp-integration/session/Session.js +94 -15
- package/dist/src/acp-integration/session/Session.js.map +1 -1
- package/dist/src/commandMode.d.ts +11 -0
- package/dist/src/commandMode.js +238 -0
- package/dist/src/commandMode.js.map +1 -0
- package/dist/src/config/auth.js +26 -0
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/config.d.ts +8 -0
- package/dist/src/config/config.js +96 -21
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extensions/update.test.js +9 -0
- package/dist/src/config/extensions/update.test.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +41 -2
- package/dist/src/config/settingsSchema.js +36 -2
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/core/initializer.js +3 -0
- package/dist/src/core/initializer.js.map +1 -1
- package/dist/src/gemini.js +39 -19
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +30 -4
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +3 -3
- package/dist/src/generated/git-commit.js +3 -3
- package/dist/src/i18n/index.d.ts +10 -2
- package/dist/src/i18n/index.js +22 -1
- package/dist/src/i18n/index.js.map +1 -1
- package/dist/src/i18n/languages.d.ts +20 -0
- package/dist/src/i18n/languages.js +36 -0
- package/dist/src/i18n/languages.js.map +1 -0
- package/dist/src/i18n/locales/de.js +1073 -0
- package/dist/src/i18n/locales/en.js +120 -162
- package/dist/src/i18n/locales/ru.js +125 -151
- package/dist/src/i18n/locales/zh.js +51 -164
- package/dist/src/nonInteractive/control/controllers/systemController.d.ts +1 -1
- package/dist/src/nonInteractive/control/controllers/systemController.js +5 -10
- package/dist/src/nonInteractive/control/controllers/systemController.js.map +1 -1
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.js +11 -4
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.js.map +1 -1
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.js +40 -0
- package/dist/src/nonInteractive/io/BaseJsonOutputAdapter.test.js.map +1 -1
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.js +50 -0
- package/dist/src/nonInteractive/io/StreamJsonOutputAdapter.test.js.map +1 -1
- package/dist/src/nonInteractiveCli.js +104 -18
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCliCommands.d.ts +48 -9
- package/dist/src/nonInteractiveCliCommands.js +180 -64
- package/dist/src/nonInteractiveCliCommands.js.map +1 -1
- package/dist/src/{ui/hooks/useQuotaAndFallback.test.d.ts → nonInteractiveCliCommands.test.d.ts} +1 -1
- package/dist/src/nonInteractiveCliCommands.test.js +157 -0
- package/dist/src/nonInteractiveCliCommands.test.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.js +2 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.js +4 -2
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.js +1 -1
- package/dist/src/services/McpPromptLoader.test.js.map +1 -1
- package/dist/src/ui/AppContainer.js +23 -20
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +0 -46
- package/dist/src/ui/AppContainer.test.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.test.js +4 -4
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/useAuth.js +11 -3
- package/dist/src/ui/auth/useAuth.js.map +1 -1
- package/dist/src/ui/commands/approvalModeCommand.js +53 -4
- package/dist/src/ui/commands/approvalModeCommand.js.map +1 -1
- package/dist/src/ui/commands/approvalModeCommand.test.js +72 -10
- package/dist/src/ui/commands/approvalModeCommand.test.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.js +86 -16
- package/dist/src/ui/commands/compressCommand.js.map +1 -1
- package/dist/src/ui/commands/languageCommand.d.ts +6 -1
- package/dist/src/ui/commands/languageCommand.js +162 -216
- package/dist/src/ui/commands/languageCommand.js.map +1 -1
- package/dist/src/ui/commands/languageCommand.test.js +105 -10
- package/dist/src/ui/commands/languageCommand.test.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.js +1 -1
- package/dist/src/ui/commands/restoreCommand.js.map +1 -1
- package/dist/src/ui/commands/resumeCommand.d.ts +7 -0
- package/dist/src/ui/commands/resumeCommand.js +19 -0
- package/dist/src/ui/commands/resumeCommand.js.map +1 -0
- package/dist/src/ui/{components/ProQuotaDialog.test.d.ts → commands/resumeCommand.test.d.ts} +1 -1
- package/dist/src/ui/commands/resumeCommand.test.js +32 -0
- package/dist/src/ui/commands/resumeCommand.test.js.map +1 -0
- package/dist/src/ui/commands/reviewCommand.js +871 -92
- package/dist/src/ui/commands/reviewCommand.js.map +1 -1
- package/dist/src/ui/commands/reviewCommand.test.js +55 -0
- package/dist/src/ui/commands/reviewCommand.test.js.map +1 -1
- package/dist/src/ui/commands/summaryCommand.js +129 -42
- package/dist/src/ui/commands/summaryCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +21 -2
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/DialogManager.js +4 -4
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.js +5 -2
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -1
- package/dist/src/ui/components/SessionPicker.d.ts +18 -0
- package/dist/src/ui/components/SessionPicker.js +69 -0
- package/dist/src/ui/components/SessionPicker.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.js +6 -2
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/{ResumeSessionPicker.d.ts → StandaloneSessionPicker.d.ts} +1 -1
- package/dist/src/ui/components/StandaloneSessionPicker.js +78 -0
- package/dist/src/ui/components/StandaloneSessionPicker.js.map +1 -0
- package/dist/src/ui/components/StandaloneSessionPicker.test.d.ts +6 -0
- package/dist/src/ui/components/StandaloneSessionPicker.test.js +410 -0
- package/dist/src/ui/components/StandaloneSessionPicker.test.js.map +1 -0
- package/dist/src/ui/components/ums/UMSKeyPrompt.js +1 -1
- package/dist/src/ui/components/ums/UMSKeyPrompt.js.map +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +3 -1
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/UIStateContext.d.ts +2 -8
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +1 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js +9 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.js +46 -11
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +11 -6
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +12 -136
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/useQwenAuth.test.js +1 -1
- package/dist/src/ui/hooks/useQwenAuth.test.js.map +1 -1
- package/dist/src/ui/hooks/useResumeCommand.d.ts +20 -0
- package/dist/src/ui/hooks/useResumeCommand.js +49 -0
- package/dist/src/ui/hooks/useResumeCommand.js.map +1 -0
- package/dist/src/ui/hooks/useResumeCommand.test.d.ts +6 -0
- package/dist/src/ui/hooks/useResumeCommand.test.js +144 -0
- package/dist/src/ui/hooks/useResumeCommand.test.js.map +1 -0
- package/dist/src/ui/hooks/useSessionPicker.d.ts +36 -0
- package/dist/src/ui/hooks/useSessionPicker.js +189 -0
- package/dist/src/ui/hooks/useSessionPicker.js.map +1 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js +1 -1
- package/dist/src/ui/models/availableModels.d.ts +1 -0
- package/dist/src/ui/models/availableModels.js +8 -0
- package/dist/src/ui/models/availableModels.js.map +1 -1
- package/dist/src/ui/utils/resumeHistoryUtils.js +5 -1
- package/dist/src/ui/utils/resumeHistoryUtils.js.map +1 -1
- package/dist/src/ui/utils/resumeHistoryUtils.test.js +5 -0
- package/dist/src/ui/utils/resumeHistoryUtils.test.js.map +1 -1
- package/dist/src/ui/utils/sessionPickerUtils.d.ts +30 -0
- package/dist/src/ui/utils/sessionPickerUtils.js +41 -0
- package/dist/src/ui/utils/sessionPickerUtils.js.map +1 -0
- package/dist/src/ui/utils/sessionPickerUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/sessionPickerUtils.test.js +38 -0
- package/dist/src/ui/utils/sessionPickerUtils.test.js.map +1 -0
- package/dist/src/utils/errors.d.ts +1 -1
- package/dist/src/utils/errors.js +14 -3
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/errors.test.js +43 -1
- package/dist/src/utils/errors.test.js.map +1 -1
- package/dist/src/utils/gitUtils.js +22 -5
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/gitUtils.test.js +59 -0
- package/dist/src/utils/gitUtils.test.js.map +1 -1
- package/dist/src/utils/nonInteractiveHelpers.d.ts +3 -1
- package/dist/src/utils/nonInteractiveHelpers.js +13 -14
- package/dist/src/utils/nonInteractiveHelpers.js.map +1 -1
- package/dist/src/utils/nonInteractiveHelpers.test.js +35 -20
- package/dist/src/utils/nonInteractiveHelpers.test.js.map +1 -1
- package/dist/src/utils/relaunch.js +2 -2
- package/dist/src/utils/relaunch.js.map +1 -1
- package/dist/src/utils/relaunch.test.js +5 -5
- package/dist/src/utils/relaunch.test.js.map +1 -1
- package/dist/src/utils/systemInfo.js +2 -1
- package/dist/src/utils/systemInfo.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.js +9 -0
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist/src/ui/components/ProQuotaDialog.d.ts +0 -13
- package/dist/src/ui/components/ProQuotaDialog.js +0 -24
- package/dist/src/ui/components/ProQuotaDialog.js.map +0 -1
- package/dist/src/ui/components/ProQuotaDialog.test.js +0 -58
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +0 -1
- package/dist/src/ui/components/ResumeSessionPicker.js +0 -249
- package/dist/src/ui/components/ResumeSessionPicker.js.map +0 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +0 -21
- package/dist/src/ui/hooks/useQuotaAndFallback.js +0 -122
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +0 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +0 -269
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +0 -1
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { vi, describe, it, expect, beforeEach, afterEach, } from 'vitest';
|
|
7
|
-
import { act, renderHook } from '@testing-library/react';
|
|
8
|
-
import { UserTierId, AuthType, isGenericQuotaExceededError, isProQuotaExceededError, makeFakeConfig, } from '@umsai/ums-code-core';
|
|
9
|
-
import { useQuotaAndFallback } from './useQuotaAndFallback.js';
|
|
10
|
-
import { AuthState, MessageType } from '../types.js';
|
|
11
|
-
// Mock the error checking functions from the core package to control test scenarios
|
|
12
|
-
vi.mock('@umsai/ums-code-core', async (importOriginal) => {
|
|
13
|
-
const original = await importOriginal();
|
|
14
|
-
return {
|
|
15
|
-
...original,
|
|
16
|
-
isGenericQuotaExceededError: vi.fn(),
|
|
17
|
-
isProQuotaExceededError: vi.fn(),
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
describe('useQuotaAndFallback', () => {
|
|
21
|
-
let mockConfig;
|
|
22
|
-
let mockHistoryManager;
|
|
23
|
-
let mockSetAuthState;
|
|
24
|
-
let mockSetModelSwitchedFromQuotaError;
|
|
25
|
-
let setFallbackHandlerSpy;
|
|
26
|
-
const mockedIsGenericQuotaExceededError = isGenericQuotaExceededError;
|
|
27
|
-
const mockedIsProQuotaExceededError = isProQuotaExceededError;
|
|
28
|
-
beforeEach(() => {
|
|
29
|
-
mockConfig = makeFakeConfig();
|
|
30
|
-
// Spy on the method that requires the private field and mock its return.
|
|
31
|
-
// This is cleaner than modifying the config class for tests.
|
|
32
|
-
vi.spyOn(mockConfig, 'getContentGeneratorConfig').mockReturnValue({
|
|
33
|
-
model: 'test-model',
|
|
34
|
-
authType: AuthType.LOGIN_WITH_GOOGLE,
|
|
35
|
-
});
|
|
36
|
-
mockHistoryManager = {
|
|
37
|
-
addItem: vi.fn(),
|
|
38
|
-
history: [],
|
|
39
|
-
updateItem: vi.fn(),
|
|
40
|
-
clearItems: vi.fn(),
|
|
41
|
-
loadHistory: vi.fn(),
|
|
42
|
-
};
|
|
43
|
-
mockSetAuthState = vi.fn();
|
|
44
|
-
mockSetModelSwitchedFromQuotaError = vi.fn();
|
|
45
|
-
setFallbackHandlerSpy = vi.spyOn(mockConfig, 'setFallbackModelHandler');
|
|
46
|
-
vi.spyOn(mockConfig, 'setQuotaErrorOccurred');
|
|
47
|
-
mockedIsGenericQuotaExceededError.mockReturnValue(false);
|
|
48
|
-
mockedIsProQuotaExceededError.mockReturnValue(false);
|
|
49
|
-
});
|
|
50
|
-
afterEach(() => {
|
|
51
|
-
vi.clearAllMocks();
|
|
52
|
-
});
|
|
53
|
-
it('should register a fallback handler on initialization', () => {
|
|
54
|
-
renderHook(() => useQuotaAndFallback({
|
|
55
|
-
config: mockConfig,
|
|
56
|
-
historyManager: mockHistoryManager,
|
|
57
|
-
userTier: UserTierId.FREE,
|
|
58
|
-
setAuthState: mockSetAuthState,
|
|
59
|
-
setModelSwitchedFromQuotaError: mockSetModelSwitchedFromQuotaError,
|
|
60
|
-
}));
|
|
61
|
-
expect(setFallbackHandlerSpy).toHaveBeenCalledTimes(1);
|
|
62
|
-
expect(setFallbackHandlerSpy.mock.calls[0][0]).toBeInstanceOf(Function);
|
|
63
|
-
});
|
|
64
|
-
describe('Fallback Handler Logic', () => {
|
|
65
|
-
// Helper function to render the hook and extract the registered handler
|
|
66
|
-
const getRegisteredHandler = (userTier = UserTierId.FREE) => {
|
|
67
|
-
renderHook((props) => useQuotaAndFallback({
|
|
68
|
-
config: mockConfig,
|
|
69
|
-
historyManager: mockHistoryManager,
|
|
70
|
-
userTier: props.userTier,
|
|
71
|
-
setAuthState: mockSetAuthState,
|
|
72
|
-
setModelSwitchedFromQuotaError: mockSetModelSwitchedFromQuotaError,
|
|
73
|
-
}), { initialProps: { userTier } });
|
|
74
|
-
return setFallbackHandlerSpy.mock.calls[0][0];
|
|
75
|
-
};
|
|
76
|
-
it('should return null and take no action if already in fallback mode', async () => {
|
|
77
|
-
vi.spyOn(mockConfig, 'isInFallbackMode').mockReturnValue(true);
|
|
78
|
-
const handler = getRegisteredHandler();
|
|
79
|
-
const result = await handler('gemini-pro', 'gemini-flash', new Error());
|
|
80
|
-
expect(result).toBeNull();
|
|
81
|
-
expect(mockHistoryManager.addItem).not.toHaveBeenCalled();
|
|
82
|
-
});
|
|
83
|
-
it('should return null and take no action if authType is not LOGIN_WITH_GOOGLE', async () => {
|
|
84
|
-
// Override the default mock from beforeEach for this specific test
|
|
85
|
-
vi.spyOn(mockConfig, 'getContentGeneratorConfig').mockReturnValue({
|
|
86
|
-
model: 'test-model',
|
|
87
|
-
authType: AuthType.USE_GEMINI,
|
|
88
|
-
});
|
|
89
|
-
const handler = getRegisteredHandler();
|
|
90
|
-
const result = await handler('gemini-pro', 'gemini-flash', new Error());
|
|
91
|
-
expect(result).toBeNull();
|
|
92
|
-
expect(mockHistoryManager.addItem).not.toHaveBeenCalled();
|
|
93
|
-
});
|
|
94
|
-
describe('Automatic Fallback Scenarios', () => {
|
|
95
|
-
const testCases = [
|
|
96
|
-
{
|
|
97
|
-
errorType: 'generic',
|
|
98
|
-
tier: UserTierId.FREE,
|
|
99
|
-
expectedMessageSnippets: [
|
|
100
|
-
'Automatically switching from model-A to model-B',
|
|
101
|
-
'upgrade to a Gemini Code Assist Standard or Enterprise plan',
|
|
102
|
-
],
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
errorType: 'generic',
|
|
106
|
-
tier: UserTierId.STANDARD, // Paid tier
|
|
107
|
-
expectedMessageSnippets: [
|
|
108
|
-
'Automatically switching from model-A to model-B',
|
|
109
|
-
'switch to using a paid API key from AI Studio',
|
|
110
|
-
],
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
errorType: 'other',
|
|
114
|
-
tier: UserTierId.FREE,
|
|
115
|
-
expectedMessageSnippets: [
|
|
116
|
-
'Automatically switching from model-A to model-B for faster responses',
|
|
117
|
-
'upgrade to a Gemini Code Assist Standard or Enterprise plan',
|
|
118
|
-
],
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
errorType: 'other',
|
|
122
|
-
tier: UserTierId.LEGACY, // Paid tier
|
|
123
|
-
expectedMessageSnippets: [
|
|
124
|
-
'Automatically switching from model-A to model-B for faster responses',
|
|
125
|
-
'switch to using a paid API key from AI Studio',
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
];
|
|
129
|
-
for (const { errorType, tier, expectedMessageSnippets } of testCases) {
|
|
130
|
-
it(`should handle ${errorType} error for ${tier} tier correctly`, async () => {
|
|
131
|
-
mockedIsGenericQuotaExceededError.mockReturnValue(errorType === 'generic');
|
|
132
|
-
const handler = getRegisteredHandler(tier);
|
|
133
|
-
const result = await handler('model-A', 'model-B', new Error('quota exceeded'));
|
|
134
|
-
// Automatic fallbacks should return 'stop'
|
|
135
|
-
expect(result).toBe('stop');
|
|
136
|
-
expect(mockHistoryManager.addItem).toHaveBeenCalledWith(expect.objectContaining({ type: MessageType.INFO }), expect.any(Number));
|
|
137
|
-
const message = mockHistoryManager.addItem.mock.calls[0][0]
|
|
138
|
-
.text;
|
|
139
|
-
for (const snippet of expectedMessageSnippets) {
|
|
140
|
-
expect(message).toContain(snippet);
|
|
141
|
-
}
|
|
142
|
-
expect(mockSetModelSwitchedFromQuotaError).toHaveBeenCalledWith(true);
|
|
143
|
-
expect(mockConfig.setQuotaErrorOccurred).toHaveBeenCalledWith(true);
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
describe('Interactive Fallback (Pro Quota Error)', () => {
|
|
148
|
-
beforeEach(() => {
|
|
149
|
-
mockedIsProQuotaExceededError.mockReturnValue(true);
|
|
150
|
-
});
|
|
151
|
-
it('should set an interactive request and wait for user choice', async () => {
|
|
152
|
-
const { result } = renderHook(() => useQuotaAndFallback({
|
|
153
|
-
config: mockConfig,
|
|
154
|
-
historyManager: mockHistoryManager,
|
|
155
|
-
userTier: UserTierId.FREE,
|
|
156
|
-
setAuthState: mockSetAuthState,
|
|
157
|
-
setModelSwitchedFromQuotaError: mockSetModelSwitchedFromQuotaError,
|
|
158
|
-
}));
|
|
159
|
-
const handler = setFallbackHandlerSpy.mock
|
|
160
|
-
.calls[0][0];
|
|
161
|
-
// Call the handler but do not await it, to check the intermediate state
|
|
162
|
-
const promise = handler('gemini-pro', 'gemini-flash', new Error('pro quota'));
|
|
163
|
-
await act(async () => { });
|
|
164
|
-
// The hook should now have a pending request for the UI to handle
|
|
165
|
-
expect(result.current.proQuotaRequest).not.toBeNull();
|
|
166
|
-
expect(result.current.proQuotaRequest?.failedModel).toBe('gemini-pro');
|
|
167
|
-
// Simulate the user choosing to continue with the fallback model
|
|
168
|
-
act(() => {
|
|
169
|
-
result.current.handleProQuotaChoice('continue');
|
|
170
|
-
});
|
|
171
|
-
// The original promise from the handler should now resolve
|
|
172
|
-
const intent = await promise;
|
|
173
|
-
expect(intent).toBe('retry');
|
|
174
|
-
// The pending request should be cleared from the state
|
|
175
|
-
expect(result.current.proQuotaRequest).toBeNull();
|
|
176
|
-
});
|
|
177
|
-
it('should handle race conditions by stopping subsequent requests', async () => {
|
|
178
|
-
const { result } = renderHook(() => useQuotaAndFallback({
|
|
179
|
-
config: mockConfig,
|
|
180
|
-
historyManager: mockHistoryManager,
|
|
181
|
-
userTier: UserTierId.FREE,
|
|
182
|
-
setAuthState: mockSetAuthState,
|
|
183
|
-
setModelSwitchedFromQuotaError: mockSetModelSwitchedFromQuotaError,
|
|
184
|
-
}));
|
|
185
|
-
const handler = setFallbackHandlerSpy.mock
|
|
186
|
-
.calls[0][0];
|
|
187
|
-
const promise1 = handler('gemini-pro', 'gemini-flash', new Error('pro quota 1'));
|
|
188
|
-
await act(async () => { });
|
|
189
|
-
const firstRequest = result.current.proQuotaRequest;
|
|
190
|
-
expect(firstRequest).not.toBeNull();
|
|
191
|
-
const result2 = await handler('gemini-pro', 'gemini-flash', new Error('pro quota 2'));
|
|
192
|
-
// The lock should have stopped the second request
|
|
193
|
-
expect(result2).toBe('stop');
|
|
194
|
-
expect(result.current.proQuotaRequest).toBe(firstRequest);
|
|
195
|
-
act(() => {
|
|
196
|
-
result.current.handleProQuotaChoice('continue');
|
|
197
|
-
});
|
|
198
|
-
const intent1 = await promise1;
|
|
199
|
-
expect(intent1).toBe('retry');
|
|
200
|
-
expect(result.current.proQuotaRequest).toBeNull();
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
describe('handleProQuotaChoice', () => {
|
|
205
|
-
beforeEach(() => {
|
|
206
|
-
mockedIsProQuotaExceededError.mockReturnValue(true);
|
|
207
|
-
});
|
|
208
|
-
it('should do nothing if there is no pending pro quota request', () => {
|
|
209
|
-
const { result } = renderHook(() => useQuotaAndFallback({
|
|
210
|
-
config: mockConfig,
|
|
211
|
-
historyManager: mockHistoryManager,
|
|
212
|
-
userTier: UserTierId.FREE,
|
|
213
|
-
setAuthState: mockSetAuthState,
|
|
214
|
-
setModelSwitchedFromQuotaError: mockSetModelSwitchedFromQuotaError,
|
|
215
|
-
}));
|
|
216
|
-
act(() => {
|
|
217
|
-
result.current.handleProQuotaChoice('auth');
|
|
218
|
-
});
|
|
219
|
-
expect(mockSetAuthState).not.toHaveBeenCalled();
|
|
220
|
-
expect(mockHistoryManager.addItem).not.toHaveBeenCalled();
|
|
221
|
-
});
|
|
222
|
-
it('should resolve intent to "auth" and trigger auth state update', async () => {
|
|
223
|
-
const { result } = renderHook(() => useQuotaAndFallback({
|
|
224
|
-
config: mockConfig,
|
|
225
|
-
historyManager: mockHistoryManager,
|
|
226
|
-
userTier: UserTierId.FREE,
|
|
227
|
-
setAuthState: mockSetAuthState,
|
|
228
|
-
setModelSwitchedFromQuotaError: mockSetModelSwitchedFromQuotaError,
|
|
229
|
-
}));
|
|
230
|
-
const handler = setFallbackHandlerSpy.mock
|
|
231
|
-
.calls[0][0];
|
|
232
|
-
const promise = handler('gemini-pro', 'gemini-flash', new Error('pro quota'));
|
|
233
|
-
await act(async () => { }); // Allow state to update
|
|
234
|
-
act(() => {
|
|
235
|
-
result.current.handleProQuotaChoice('auth');
|
|
236
|
-
});
|
|
237
|
-
const intent = await promise;
|
|
238
|
-
expect(intent).toBe('auth');
|
|
239
|
-
expect(mockSetAuthState).toHaveBeenCalledWith(AuthState.Updating);
|
|
240
|
-
expect(result.current.proQuotaRequest).toBeNull();
|
|
241
|
-
});
|
|
242
|
-
it('should resolve intent to "retry" and add info message on continue', async () => {
|
|
243
|
-
const { result } = renderHook(() => useQuotaAndFallback({
|
|
244
|
-
config: mockConfig,
|
|
245
|
-
historyManager: mockHistoryManager,
|
|
246
|
-
userTier: UserTierId.FREE,
|
|
247
|
-
setAuthState: mockSetAuthState,
|
|
248
|
-
setModelSwitchedFromQuotaError: mockSetModelSwitchedFromQuotaError,
|
|
249
|
-
}));
|
|
250
|
-
const handler = setFallbackHandlerSpy.mock
|
|
251
|
-
.calls[0][0];
|
|
252
|
-
// The first `addItem` call is for the initial quota error message
|
|
253
|
-
const promise = handler('gemini-pro', 'gemini-flash', new Error('pro quota'));
|
|
254
|
-
await act(async () => { }); // Allow state to update
|
|
255
|
-
act(() => {
|
|
256
|
-
result.current.handleProQuotaChoice('continue');
|
|
257
|
-
});
|
|
258
|
-
const intent = await promise;
|
|
259
|
-
expect(intent).toBe('retry');
|
|
260
|
-
expect(result.current.proQuotaRequest).toBeNull();
|
|
261
|
-
// Check for the second "Switched to fallback model" message
|
|
262
|
-
expect(mockHistoryManager.addItem).toHaveBeenCalledTimes(2);
|
|
263
|
-
const lastCall = mockHistoryManager.addItem.mock.calls[1][0];
|
|
264
|
-
expect(lastCall.type).toBe(MessageType.INFO);
|
|
265
|
-
expect(lastCall.text).toContain('Switched to fallback model.');
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
//# sourceMappingURL=useQuotaAndFallback.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useQuotaAndFallback.test.js","sourceRoot":"","sources":["../../../../src/ui/hooks/useQuotaAndFallback.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,EAAE,EACF,QAAQ,EACR,EAAE,EACF,MAAM,EACN,UAAU,EACV,SAAS,GAEV,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAGL,UAAU,EACV,QAAQ,EACR,2BAA2B,EAC3B,uBAAuB,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