Skip to content

Commit dbb2809

Browse files
committed
v0.7.22
Add the /models command for quick model switching
1 parent a32a56c commit dbb2809

18 files changed

Lines changed: 1631 additions & 10 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
5757
### What's New
5858
59-
- Fix Missing Difference Display for Diff Commands
59+
- Add the /models command for quick model switching
6060
6161
### Installation
6262
```bash

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snow-ai",
3-
"version": "0.7.21",
3+
"version": "0.7.22",
44
"description": "Agentic coding in your terminal",
55
"license": "MIT",
66
"bin": {

source/hooks/conversation/useCommandHandler.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ type CommandHandlerOptions = {
413413
setShowTodoListPanel: React.Dispatch<React.SetStateAction<boolean>>;
414414
setShowPixelEditor: React.Dispatch<React.SetStateAction<boolean>>;
415415
setShowUsagePanel: React.Dispatch<React.SetStateAction<boolean>>;
416+
setShowModelsPanel: React.Dispatch<React.SetStateAction<boolean>>;
416417
setShowSubAgentDepthPanel: React.Dispatch<React.SetStateAction<boolean>>;
417418
setShowCustomCommandConfig: React.Dispatch<React.SetStateAction<boolean>>;
418419
setShowSkillsCreation: React.Dispatch<React.SetStateAction<boolean>>;
@@ -674,6 +675,14 @@ export function useCommandHandler(options: CommandHandlerOptions) {
674675
commandName: commandName,
675676
};
676677
options.setMessages(prev => [...prev, commandMessage]);
678+
} else if (result.success && result.action === 'showModelsPanel') {
679+
options.setShowModelsPanel(true);
680+
const commandMessage: Message = {
681+
role: 'command',
682+
content: '',
683+
commandName: commandName,
684+
};
685+
options.setMessages(prev => [...prev, commandMessage]);
677686
} else if (result.success && result.action === 'showBackgroundPanel') {
678687
options.setShowBackgroundPanel();
679688
const commandMessage: Message = {

source/hooks/ui/useCommandPanel.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ export function useCommandPanel(buffer: TextBuffer, isProcessing = false) {
135135
name: 'profiles',
136136
description: t.commandPanel.commands.profiles,
137137
},
138+
{
139+
name: 'models',
140+
description:
141+
t.commandPanel.commands.models || 'Open the model switching panel',
142+
},
138143
{
139144
name: 'loop',
140145
description:

source/hooks/ui/usePanelState.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export type PanelState = {
2626
// 配置编辑面板:从 ProfilePanel 按右方向键进入,编辑指定 profile(不切换 active)
2727
showProfileEditPanel: boolean;
2828
editingProfileName: string | null;
29+
showModelsPanel: boolean;
2930
showDiffReviewPanel: boolean;
3031
showConnectionPanel: boolean;
3132
showNewPromptPanel: boolean;
@@ -60,6 +61,7 @@ export type PanelActions = {
6061
setShowProfilePanel: Dispatch<SetStateAction<boolean>>;
6162
setShowProfileEditPanel: Dispatch<SetStateAction<boolean>>;
6263
setEditingProfileName: Dispatch<SetStateAction<string | null>>;
64+
setShowModelsPanel: Dispatch<SetStateAction<boolean>>;
6365
/**
6466
* 打开 ProfileEditPanel 编辑指定 profile:
6567
* 同时关闭 ProfilePanel(picker),切换为编辑视图。
@@ -109,6 +111,7 @@ export function usePanelState(): PanelState & PanelActions {
109111
const [editingProfileName, setEditingProfileName] = useState<string | null>(
110112
null,
111113
);
114+
const [showModelsPanel, setShowModelsPanel] = useState(false);
112115
const [showDiffReviewPanel, setShowDiffReviewPanel] = useState(false);
113116
const [showConnectionPanel, setShowConnectionPanel] = useState(false);
114117
const [showNewPromptPanel, setShowNewPromptPanel] = useState(false);
@@ -149,6 +152,7 @@ export function usePanelState(): PanelState & PanelActions {
149152
showReviewCommitPanel ||
150153
showBranchPanel ||
151154
showProfilePanel ||
155+
showModelsPanel ||
152156
showDiffReviewPanel ||
153157
showConnectionPanel ||
154158
showNewPromptPanel ||
@@ -311,6 +315,12 @@ export function usePanelState(): PanelState & PanelActions {
311315
return true;
312316
}
313317

318+
// ModelsPanel handles its own ESC key logic internally
319+
// Don't close it here - let the panel decide when to close
320+
if (showModelsPanel) {
321+
return false; // Let ModelsPanel handle ESC
322+
}
323+
314324
// NewPromptPanel handles its own ESC key logic internally
315325
if (showNewPromptPanel) {
316326
return false; // Let NewPromptPanel handle ESC
@@ -350,6 +360,7 @@ export function usePanelState(): PanelState & PanelActions {
350360
showBranchPanel ||
351361
showProfilePanel ||
352362
showProfileEditPanel ||
363+
showModelsPanel ||
353364
showDiffReviewPanel ||
354365
showConnectionPanel ||
355366
showNewPromptPanel ||
@@ -379,6 +390,7 @@ export function usePanelState(): PanelState & PanelActions {
379390
showProfilePanel,
380391
showProfileEditPanel,
381392
editingProfileName,
393+
showModelsPanel,
382394
showDiffReviewPanel,
383395
showConnectionPanel,
384396
showNewPromptPanel,
@@ -408,6 +420,7 @@ export function usePanelState(): PanelState & PanelActions {
408420
setShowProfilePanel,
409421
setShowProfileEditPanel,
410422
setEditingProfileName,
423+
setShowModelsPanel,
411424
openProfileEdit,
412425
closeProfileEditAndReturnToPicker,
413426
setShowDiffReviewPanel,

source/i18n/lang/en.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ export const en: TranslationKeys = {
634634
backend: 'Show background processes panel',
635635
loop: 'Schedule a session-scoped recurring task. Usage: /loop 5m <prompt>',
636636
profiles: 'Switch configuration profiles',
637+
models: 'Open the model switching panel',
637638
subAgentDepth: 'Set the maximum nested spawn depth for sub-agents',
638639
vulnerabilityHunting:
639640
'Toggle vulnerability hunting mode for security-focused code analysis',
@@ -744,6 +745,43 @@ export const en: TranslationKeys = {
744745
fileHint:
745746
'This setting is persisted to .snow/settings.json in the project root',
746747
},
748+
modelsPanel: {
749+
title: 'Model Switching',
750+
subtitle: 'Tab to switch tabs | Enter to select',
751+
tabAdvanced: 'Advanced Model',
752+
tabBasic: 'Basic Model',
753+
tabThinking: 'Thinking',
754+
currentModel: 'Current Model:',
755+
notSet: 'Not Set',
756+
loadingModels: 'Loading models...',
757+
hint: 'Enter to select model | m for manual input | Esc to close',
758+
manualInputTitle: 'Manual Input',
759+
manualInputHint: 'Enter to save, Esc to close',
760+
filterLabel: 'Filter:',
761+
manualInputOption: 'Manual Input',
762+
requestMethod: 'Request Method:',
763+
showThinkingProcess: 'Show Thinking Process:',
764+
enableThinking: 'Enable Thinking:',
765+
thinkingMode: 'Thinking Mode:',
766+
thinkingStrength: 'Thinking Strength:',
767+
inputNumberHint: 'Enter number, press Enter to save',
768+
escCancel: 'Esc to cancel',
769+
navigationHint: '↑↓ to select | Enter to toggle | Esc to close',
770+
notSupported: 'Not Supported',
771+
advancedModelLabel: 'Advanced Model',
772+
basicModelLabel: 'Basic Model',
773+
thinkingLabel: 'Thinking',
774+
requestMethodNotSupportedForThinking:
775+
'Current request method ({requestMethod}) does not support thinking',
776+
requestMethodNotSupportedForThinkingStrength:
777+
'Current request method ({requestMethod}) does not support thinking strength settings',
778+
anthropicSpeed: 'Speed:',
779+
saveFailed: 'Save failed',
780+
modelSaveFailed: 'Model save failed',
781+
tipLabel: 'Tip:',
782+
modelCount: '{count} models',
783+
scrollHint: '↑↓ scroll for more',
784+
},
747785
profilePanel: {
748786
title: 'Select Profile',
749787
scrollHint: '↑↓ to scroll',

source/i18n/lang/zh-TW.ts

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ export const zhTW: TranslationKeys = {
596596
backend: '顯示背景處理程序面板',
597597
loop: '建立會話級循環任務。用法: /loop 5m <提示詞>',
598598
profiles: '開啟設定檔切換面板',
599+
models: '開啟模型切換面板',
599600
subAgentDepth: '設定子代理巢狀建立深度上限',
600601
vulnerabilityHunting: '切換漏洞檢查模式,進行安全性代碼分析',
601602
autoFormat:
@@ -699,6 +700,43 @@ export const zhTW: TranslationKeys = {
699700
hint: 'Enter 儲存 • Esc 關閉 • 僅支援數字輸入',
700701
fileHint: '此設定會持久化到專案根目錄的 .snow/settings.json',
701702
},
703+
modelsPanel: {
704+
title: '模型切換',
705+
subtitle: 'Tab 切換標籤 | Enter 選擇',
706+
tabAdvanced: '進階模型',
707+
tabBasic: '基礎模型',
708+
tabThinking: '思考',
709+
currentModel: '目前模型:',
710+
notSet: '未設定',
711+
loadingModels: '正在載入模型...',
712+
hint: 'Enter 選擇模型 | m 手動輸入 | Esc 關閉',
713+
manualInputTitle: '手動輸入',
714+
manualInputHint: 'Enter 儲存 | Esc 關閉',
715+
filterLabel: '篩選:',
716+
manualInputOption: '手動輸入',
717+
requestMethod: '請求方式:',
718+
showThinkingProcess: '顯示思考過程:',
719+
enableThinking: '啟用思考:',
720+
thinkingMode: '思考模式:',
721+
thinkingStrength: '思考強度:',
722+
inputNumberHint: '輸入數字,Enter 儲存',
723+
escCancel: 'Esc 取消',
724+
navigationHint: '↑↓ 選擇 | Enter 切換 | Esc 關閉',
725+
notSupported: '不支援',
726+
advancedModelLabel: '進階模型',
727+
basicModelLabel: '基礎模型',
728+
thinkingLabel: '思考',
729+
requestMethodNotSupportedForThinking:
730+
'目前請求方式({requestMethod})不支援思考',
731+
requestMethodNotSupportedForThinkingStrength:
732+
'目前請求方式({requestMethod})不支援思考強度設定',
733+
anthropicSpeed: 'Speed:',
734+
saveFailed: '儲存失敗',
735+
modelSaveFailed: '模型儲存失敗',
736+
tipLabel: '提示:',
737+
modelCount: '共 {count} 個模型',
738+
scrollHint: '↑↓ 捲動瀏覽更多模型',
739+
},
702740
profilePanel: {
703741
title: '選擇設定檔',
704742
scrollHint: '↑↓ 捲動',
@@ -1081,7 +1119,7 @@ export const zhTW: TranslationKeys = {
10811119
toolSearchEnabled: '♾︎ 工具搜尋已開啟 - 按需搜尋載入工具',
10821120
hybridCompressEnabled: '⇌ 混合壓縮已開啟 - AI 摘要 + 智慧截斷',
10831121
teamModeActive: '⚑ Agent Team 模式已啟用 - 多代理獨立 Worktree 協同工作',
1084-
tokens: ' 個token',
1122+
tokens: ' 個詞元',
10851123
cached: '已快取',
10861124
newCache: '新快取',
10871125
},

source/i18n/lang/zh.ts

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ export const zh: TranslationKeys = {
595595
backend: '显示后台进程面板',
596596
loop: '创建会话级循环任务。用法: /loop 5m <提示词>',
597597
profiles: '打开配置文件切换面板',
598+
models: '打开模型切换面板',
598599
subAgentDepth: '设置子代理嵌套创建深度上限',
599600
vulnerabilityHunting: '切换漏洞检查模式,进行安全性代码分析',
600601
autoFormat:
@@ -698,6 +699,43 @@ export const zh: TranslationKeys = {
698699
hint: 'Enter 保存 • Esc 关闭 • 仅支持数字输入',
699700
fileHint: '该设置会持久化到项目根目录的 .snow/settings.json',
700701
},
702+
modelsPanel: {
703+
title: '模型切换',
704+
subtitle: 'Tab 切换标签 | Enter 选择',
705+
tabAdvanced: '高级模型',
706+
tabBasic: '基础模型',
707+
tabThinking: '思考',
708+
currentModel: '当前模型:',
709+
notSet: '未设置',
710+
loadingModels: '正在加载模型...',
711+
hint: 'Enter 选择模型 | m 手动输入 | Esc 关闭',
712+
manualInputTitle: '手动输入',
713+
manualInputHint: 'Enter 保存 | Esc 关闭',
714+
filterLabel: '筛选:',
715+
manualInputOption: '手动输入',
716+
requestMethod: '请求方式:',
717+
showThinkingProcess: '显示思考过程:',
718+
enableThinking: '启用思考:',
719+
thinkingMode: '思考模式:',
720+
thinkingStrength: '思考强度:',
721+
inputNumberHint: '输入数字,回车保存',
722+
escCancel: 'Esc 取消',
723+
navigationHint: '↑↓键选择 | Enter 切换 | Esc 关闭',
724+
notSupported: '不支持',
725+
advancedModelLabel: '高级模型',
726+
basicModelLabel: '基础模型',
727+
thinkingLabel: '思考',
728+
requestMethodNotSupportedForThinking:
729+
'当前请求方式({requestMethod})不支持思考',
730+
requestMethodNotSupportedForThinkingStrength:
731+
'当前请求方式({requestMethod})不支持思考强度设置',
732+
anthropicSpeed: 'Speed:',
733+
saveFailed: '保存失败',
734+
modelSaveFailed: '模型保存失败',
735+
tipLabel: '提示:',
736+
modelCount: '共 {count} 个模型',
737+
scrollHint: '↑↓ 滚动浏览更多模型',
738+
},
701739
profilePanel: {
702740
title: '选择配置',
703741
scrollHint: '↑↓ 滚动',
@@ -1080,7 +1118,7 @@ export const zh: TranslationKeys = {
10801118
toolSearchEnabled: '♾︎ 工具搜索已开启 - 按需搜索加载工具',
10811119
hybridCompressEnabled: '⇌ 混合压缩已开启 - AI 摘要 + 智能截断',
10821120
teamModeActive: '⚑ Agent Team 模式已激活 - 多代理独立 Worktree 协同工作',
1083-
tokens: ' 个token',
1121+
tokens: ' 个词元',
10841122
cached: '已缓存',
10851123
newCache: '新缓存',
10861124
},

source/i18n/types.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ export type TranslationKeys = {
577577
backend: string;
578578
loop: string;
579579
profiles: string;
580+
models: string;
580581
subAgentDepth: string;
581582
export: string;
582583
custom: string;
@@ -765,6 +766,42 @@ export type TranslationKeys = {
765766
hint: string;
766767
fileHint: string;
767768
};
769+
modelsPanel: {
770+
title: string;
771+
subtitle: string;
772+
tabAdvanced: string;
773+
tabBasic: string;
774+
tabThinking: string;
775+
currentModel: string;
776+
notSet: string;
777+
loadingModels: string;
778+
hint: string;
779+
manualInputTitle: string;
780+
manualInputHint: string;
781+
filterLabel: string;
782+
manualInputOption: string;
783+
requestMethod: string;
784+
showThinkingProcess: string;
785+
enableThinking: string;
786+
thinkingMode: string;
787+
thinkingStrength: string;
788+
inputNumberHint: string;
789+
escCancel: string;
790+
navigationHint: string;
791+
notSupported: string;
792+
advancedModelLabel: string;
793+
basicModelLabel: string;
794+
thinkingLabel: string;
795+
requestMethodNotSupportedForThinking: string;
796+
requestMethodNotSupportedForThinkingStrength: string;
797+
anthropicSpeed: string;
798+
saveFailed: string;
799+
modelSaveFailed: string;
800+
tipLabel: string;
801+
modelCount: string;
802+
scrollHint: string;
803+
};
804+
768805
// Hooks
769806
hooks: {
770807
pressCtrlCAgain: string;

0 commit comments

Comments
 (0)