fix(ui): cycle through all thinking variants (#2848)
This commit is contained in:
@@ -525,6 +525,22 @@ describe('useConfigStore provider persistence', () => {
|
||||
expect(state.directoryScoped[DIRECTORY]?.currentVariant).toBe('high');
|
||||
});
|
||||
|
||||
test('cycleCurrentVariant wraps through every model variant', () => {
|
||||
useConfigStore.setState({
|
||||
providers: [provider('openai', 'gpt-5.6-sol', { none: {}, low: {}, medium: {}, high: {}, xhigh: {}, max: {} })],
|
||||
currentProviderId: 'openai',
|
||||
currentModelId: 'gpt-5.6-sol',
|
||||
currentVariant: 'high',
|
||||
directoryScoped: {},
|
||||
});
|
||||
|
||||
const expectedVariants = ['xhigh', 'max', 'none', 'low', 'medium', 'high'];
|
||||
for (const expectedVariant of expectedVariants) {
|
||||
useConfigStore.getState().cycleCurrentVariant();
|
||||
expect(useConfigStore.getState().currentVariant).toBe(expectedVariant);
|
||||
}
|
||||
});
|
||||
|
||||
test('setAgent prefers saved and agent variants before settings default', () => {
|
||||
const sessionId = 'ses_agent_saved_variant';
|
||||
useSessionUIStore.setState({ currentSessionId: sessionId });
|
||||
|
||||
@@ -1904,12 +1904,12 @@ export const useConfigStore = create<ConfigStore>()(
|
||||
}
|
||||
|
||||
const index = variantKeys.indexOf(current);
|
||||
if (index === -1 || index === variantKeys.length - 1) {
|
||||
get().setCurrentVariant(undefined);
|
||||
if (index === -1) {
|
||||
get().setCurrentVariant(variantKeys[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
get().setCurrentVariant(variantKeys[index + 1]);
|
||||
get().setCurrentVariant(variantKeys[(index + 1) % variantKeys.length]);
|
||||
},
|
||||
|
||||
setSelectedProvider: (providerId: string) => {
|
||||
|
||||
Reference in New Issue
Block a user