fix: Fix agent context variable insertion to preserve existing text

This commit is contained in:
zhsama
2026-01-12 18:12:01 +08:00
parent b25b069917
commit 47790b49d4
2 changed files with 3 additions and 2 deletions

View File

@ -113,7 +113,8 @@ const MixedVariableTextInput = ({
if (!onChange)
return
const newValue = `{{#${agent.id}.context#}}`
const valueWithoutTrigger = value.replace(/@$/, '')
const newValue = `{{#${agent.id}.context#}}${valueWithoutTrigger}`
onChange(newValue)
setControlPromptEditorRerenderKey(Date.now())