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
@@ -451,6 +451,9 @@ function updateAgent(agentName, updates, workingDirectory) {
const creatingNewMd = isBuiltinOverride;
for (const [field, value] of Object.entries(updates)) {
// Skip undefined values — they would overwrite existing frontmatter fields with nothing
if (value === undefined) continue;
if (field === 'prompt') {
if (value === null) {
if (mdExists || creatingNewMd) {