Fix hidden-message leakage into plugin prompts

This commit is contained in:
Youzini-afk
2026-04-10 14:06:17 +08:00
parent ed0df6eb7e
commit ef154b5950
7 changed files with 121 additions and 4 deletions

View File

@@ -69,6 +69,14 @@ try {
},
chat: [
{ is_user: true, mes: "第一句" },
{
is_user: false,
is_system: true,
mes: "被 BME 隐藏的助手楼层",
extra: {
__st_bme_hide_managed: true,
},
},
{
is_user: false,
mes: "回应",
@@ -115,6 +123,14 @@ try {
assert.equal(hostSnapshot.snapshot.variables.local.location, "library");
assert.equal(hostSnapshot.snapshot.chat.lastUserMessage, "最后一句");
assert.equal(hostSnapshot.snapshot.chat.id, "chat-from-global");
assert.equal(
hostSnapshot.snapshot.chat.messages[1]?.is_system,
false,
);
assert.equal(
hostSnapshot.snapshot.chat.messages[1]?.mes,
"被 BME 隐藏的助手楼层",
);
assert.equal(hostSnapshot.prompt.charName, "Alice");
assert.equal(hostSnapshot.prompt.userPersona, "桥接 persona");