Repository navigation
Replies: 1 comment
|
+1, with a security reason for the same hook: today the checkpoint can launder prompt injection. Read in
So a directive in a scraped web page or fetched file can enter the summary as an intent, a pending job or a constraint. After the fold it carries user authority, and its tool provenance is gone. #4097 (unescaped close tag) is the same trust boundary from a different side. A deployer cannot fix this inside the package: the instruction and the preamble are module-private, as #8052 notes. Our workaround is the one this post describes: a global What would close this upstream, in order of preference:
This is an unofficial third-party report. |
Uh oh!
There was an error while loading. Please reload this page.
环境
@deepseek-ai/dsh-compaction-basic0.2.1-rc.2f3803c9(0.2.2-alpha.2)上核对过,代码相同问题描述
dsh-compaction-basic的摘要提示词COMPACTION_INSTRUCTION是写死的(summarizer.ts第 32 行起)。它以「You are now acting as a compaction engine for this AI coding assistant」开头,固定输出 Primary Request and Intent、Files and Code、Errors and Fixes、Pending Jobs 等编程工作日志格式的英文摘要。config.ts里的配置项(摘要用的 provider/model、重试次数、thresholdRatio、headroomTokens、保留量等)都和提示词无关,没有办法修改这段文字。压缩后,这份摘要会放在上下文最前面,成为模型对之前对话的主要记忆。对于编程以外的用途,例如陪伴型、角色型 Agent 或中文对话,这个格式会带来两个问题:
期望行为
可以通过配置调整摘要提示词,例如:
instruction:整段替换;或preamble/sections:保留默认结构,只替换开头的角色说明或各节标题;language。我们目前的做法
我们在一个插件里注册了全局的
llm/stream监听,在options.purpose === 'compaction'时,把消息列表里最后一条(也就是这段提示词)替换成我们自己的中文版本,然后再调用next()。这能用,但依赖了 compaction-basic 的内部消息结构,插件升级后可能失效,所以希望有正式的配置项。相关讨论
COMPACTION_INSTRUCTION没有长度预算如果提示词可以配置,这类需求部署者可以自己调整,不必都改进默认值。
All reactions