feat(deskclaw): rebrand + vibe presets + chat model picker
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
removeAgentWorkspaceDirectory,
|
||||
resolveAccountIdForAgent,
|
||||
updateAgentModel,
|
||||
updateDefaultModel,
|
||||
updateAgentName,
|
||||
} from '../../utils/agent-config';
|
||||
import { deleteChannelAccountConfig } from '../../utils/channel-config';
|
||||
@@ -135,6 +136,23 @@ export async function handleAgentRoutes(
|
||||
return true;
|
||||
}
|
||||
|
||||
if (url.pathname === '/api/agents/default-model' && req.method === 'PUT') {
|
||||
try {
|
||||
const body = await parseJsonBody<{ modelRef?: string | null }>(req);
|
||||
const snapshot = await updateDefaultModel(body.modelRef ?? null);
|
||||
try {
|
||||
await syncAllProviderAuthToRuntime();
|
||||
} catch (syncError) {
|
||||
console.warn('[agents] Failed to sync runtime after updating default model:', syncError);
|
||||
}
|
||||
scheduleGatewayReload(ctx, 'update-default-model');
|
||||
sendJson(res, 200, { success: true, ...snapshot });
|
||||
} catch (error) {
|
||||
sendJson(res, 500, { success: false, error: String(error) });
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (url.pathname.startsWith('/api/agents/') && req.method === 'PUT') {
|
||||
const suffix = url.pathname.slice('/api/agents/'.length);
|
||||
const parts = suffix.split('/').filter(Boolean);
|
||||
|
||||
Reference in New Issue
Block a user