Skip to content

compress 锚点 args 复写本从未瘦身:继承 acp-kernel #230 解析 bug(qwen/glm 字符串形态全触发) #658

Description

@ranxianglei

现象

每次上游请求都携带 compress 锚点工具调用 arguments 里的完整 summary 原文复写本(每个活块一份)。同一份摘要存在两份:块摘要消息(权威拷贝)+ 锚点调用 args(冗余拷贝),后者本应被内核 hide-consumed 管线瘦身(滤死范围 + >200 字符摘要存根化),但由于 acp-kernel #230 的解析 bug,该瘦身对本项目的主要模型从未生效

影响链路(代码证据)

  • src/server.ts:328 createCore() + src/plugin.ts:399 core.processTurn(...) —— hide-consumed 管线在代理内完整生效
  • acp-kernel src/wire/openai.ts:133 text: tc.function.arguments ?? "" —— CoreMessage tool-call text = 原始 wire 参数字符串(qwen 等非严格 provider 把 content 数组双重编码为字符串)
  • 修复前 parseCallText 只认 Array.isArray(obj.content) → 字符串形态静默 return null → 改写跳过
  • 出口 acp-kernel src/wire/openai.ts:191 arguments: m.text ?? "" —— 未瘦身文本原样发回上游,每个后续请求都在浪费 token

触发条件与实测

  • 触发:content 字符串形态(qwen3.8 / glm-5.3 等非严格 provider 全中)或调用文本带前缀
  • 法证回放 billion-context-pi 风暴会话 01a07b3c(2026-09-09):52/52 个 compress 调用均为字符串形态,tag-prefixed 0 个;锚点 args 复写本合计 ~22K tokens 永驻上下文

后果

  1. 压缩回收量慢性泄漏:compress 报 reclaimed 22K,meter 回落不及预期(内容从 args 复写本溜回)
  2. 越压越胖棘轮:底座抬高 → 更快回到压力带 → 更多 nudge → 更多 compress → 底座更高(风暴会话六分钟一循环的燃料之一)
  3. 块失活后死范围条目残留,误导模型后续 compress 决策

修复方案

bump acp-kernel pin 至包含 #230 修复(PR acp-kernel#232:首个 { 定位 JSON + 保留前缀 + 字符串形态 content 解析 + 原形态回写)的版本(预计 v0.0.60,待 #232 合并发版)。bump PR 挂 draft 等 kernel 发版后刷新 lockfile 转 ready。

关联

  • 根因:acp-kernel issue #230 / PR #232
  • 同病兄弟:billion-context-pi 出口侧另需适配层同步(该仓库单独立案)

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions