fix(agents): preserve YAML frontmatter fields when saving agent settings via UI (#2004)

Co-authored-by: bashrusakh <bashrusakh@users.noreply.github.com>
This commit is contained in:
Leonid
2026-07-11 16:05:16 +03:00
committed by GitHub
co-authored by bashrusakh
parent 420582984e
commit 76c3bb5fd9
3 changed files with 8 additions and 2 deletions
@@ -624,7 +624,7 @@ export const AgentsPage: React.FC = () => {
const permissionConfig = buildPermissionConfigWithGlobal(globalPermission, permissionRules);
const config: AgentConfig = {
name: agentName,
description: description.trim() || undefined,
...(description.trim() ? { description: description.trim() } : {}),
mode,
model: trimmedModel === '' ? null : trimmedModel,
variant: trimmedVariant === '' ? null : trimmedVariant || undefined,
@@ -632,7 +632,7 @@ export const AgentsPage: React.FC = () => {
top_p: topP ?? null,
prompt: trimmedPrompt || (isNewAgent ? undefined : null),
permission: permissionConfig,
scope: isNewAgent ? draftScope : undefined,
...(isNewAgent && draftScope ? { scope: draftScope } : {}),
};
let result: AgentMutationResult;