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:
committed by
GitHub
co-authored by
bashrusakh
parent
420582984e
commit
76c3bb5fd9
@@ -1666,6 +1666,9 @@ export const updateAgent = (agentName: string, updates: Record<string, unknown>,
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user