feat: store Pi Switch config in SQLite, activate on switch

This commit is contained in:
KimiSwitch Dev
2026-07-08 16:14:16 +08:00
parent 155efdf9f3
commit 6eb57d2ac6
6 changed files with 428 additions and 10 deletions
+5 -1
View File
@@ -191,7 +191,7 @@ export default function App() {
updateConfig((cfg) => ({ ...cfg, default_model: alias }));
};
const handleSwitchProvider = (name: string) => {
const handleSwitchProvider = async (name: string) => {
updateConfig((cfg) => {
const target = cfg.providers[name];
if (!target || target.managed) return cfg;
@@ -216,6 +216,10 @@ export default function App() {
return { ...cfg, providers, default_model };
});
// Persist the full config to Pi Switch's SQLite and activate the selected provider.
await save();
await invoke("activate_agent_config_command", { agent });
};
const handleApplyProviderJson = (provider: Provider, models: Model[]) => {