feat(deskclaw): rebrand + vibe presets + chat model picker

This commit is contained in:
DeskClaw Bot
2026-04-21 13:56:26 +00:00
Unverified
parent 92144ab639
commit aa4d1fe2b2
23 changed files with 377 additions and 73 deletions

View File

@@ -681,6 +681,31 @@ export async function updateAgentModel(agentId: string, modelRef: string | null)
});
}
export async function updateDefaultModel(modelRef: string | null): Promise<AgentsSnapshot> {
return withConfigLock(async () => {
const config = await readOpenClawConfig() as AgentConfigDocument;
const { agentsConfig } = normalizeAgentsConfig(config);
const normalizedModelRef = typeof modelRef === 'string' ? modelRef.trim() : '';
const nextAgentsConfig: AgentsConfig = { ...(agentsConfig || {}) };
const nextDefaults: AgentDefaultsConfig = { ...(nextAgentsConfig.defaults || {}) };
if (!normalizedModelRef) {
delete nextDefaults.model;
} else {
if (!isValidModelRef(normalizedModelRef)) {
throw new Error('modelRef must be in "provider/model" format');
}
nextDefaults.model = { primary: normalizedModelRef };
}
nextAgentsConfig.defaults = nextDefaults;
config.agents = nextAgentsConfig;
await writeOpenClawConfig(config);
logger.info('Updated default model', { modelRef: normalizedModelRef || null });
return buildSnapshotFromConfig(config);
});
}
export async function deleteAgentConfig(agentId: string): Promise<{ snapshot: AgentsSnapshot; removedEntry: AgentListEntry }> {
return withConfigLock(async () => {
if (agentId === MAIN_AGENT_ID) {