Skip to content

[Feature] 为提示词定界符增加随机后缀(nonce) #10057

Description

@lingyun14beta

功能描述

AstrBot 用 <Quoted Message><system_reminder><selected_excerpt>
尖括号标签区分「框架生成的结构」与「用户内容」。这些标签使用固定字面量
作为定界符,而用户内容中可以包含同形字符串,两者在文本层面无法区分。

建议为每次请求生成一个随机后缀,附加到框架生成的标签上:

<Quoted Message_a1b2c3d4>
(凌): 在吗
</Quoted Message_a1b2c3d4>

用户内容中出现 </Quoted Message> 时,由于缺少正确后缀,无法闭合框架标签,
内容始终停留在所属块内部。

使用场景

用户引用一条正文包含 </Quoted Message> 的消息时,引用块可能在文本层面
被提前闭合,后续内容变成与框架结构同级的块。

检查清单

  • 我已在 Issue 列表中搜索过相关功能,确认该功能想法从未被提出过。
  • 我建议的功能与 AstrBot 本体相关,而非在建议某一插件的功能。
  • 我已阅读并同意本项目的贡献者行为准则
  • (可选)我愿意提交 PR 以帮助实现该功能。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions