WindsurfAPI
WindsurfAPI copied to clipboard
feat(dashboard): default mode.
When the requested model is not on the whitelist, this model will be used instead. Leave it blank to reject requests outside the whitelist.
改了什么 / What changed
新增「默認模型」(default model) 功能:當請求的模型不在白名單中時,系統會自動使用配置的默認模型代替直接拒絕請求。在 Dashboard 的模型訪問控制區域新增了默認模型輸入框。
为什么 / Why
解決白名單外模型請求被拒絕的問題。用戶現在可以設置一個 fallback 模型,讓不在白名單中的模型請求自動轉向該默認模型,而不是返回錯誤。這提高了系統的靈活性和用戶體驗。
测试 / Testing
- 在 Dashboard 的「模型訪問控制」區域輸入默認模型名稱並保存
- 使用 curl 或客戶端發送白名單外的模型請求,驗證系統自動使用默認模型響應
- 留空默認模型時,驗證白名單外請求被正確拒絕(返回 400 錯誤)
Checklist
- [x] 代码风格和现有文件一致 / Code style matches existing files
- [x] 没有引入 npm 依赖 / No new npm dependencies (project is zero-dep)
- [x] 涉及 LS binary 协议改动时 在 PR 描述里注明字段号来源 / If touching LS protocol, document field-number source in the PR description
- [x] 涉及 dashboard UI 用 App.confirm / App.prompt 不用浏览器原生 alert/confirm / Uses App.confirm / App.prompt, not native dialogs (if dashboard)