Skip to content

出口请求未同步内核瘦身后的 compress 锚点文本:args 复写本 ~22K 永驻(独立于 #336 thinking 地板) #340

Description

@ranxianglei

现象与根因

acp-kernel 修复 #230(PR #232)后,内核出口视图里的 compress 锚点调用文本会被瘦身(滤死范围 + >200 字符摘要存根化)。但 pi 适配层 coreOutToAgentMessages(src/messages.ts)重建 assistant 消息时使用原始 entry 内容,不消费内核改写后的 tool-call text → 出口请求仍携带全量 args 复写本。

块摘要消息:  acp_summary 完整摘要        ← 权威拷贝(出口保留,应该)
锚点调用:    {"content":[{...,summary:"完整摘要"}]}  ← 内核已瘦身,pi 出口仍发原文

风暴会话 01a07b3c 实测:16 条活锚点 args 合计 21.6K tokens(kernel 侧瘦身实测同会话单条 924→278 chars)。

方案

coreOutToAgentMessages 增加 coreTextByCallId 逻辑(取自已关 #338 的 m00462 实现,剥离全部 reasoning 相关部分):内核出口 tool-call core 的 text 若被改写,把 JSON 部分(从首个 { 起,剥 <acp> 标签前缀)JSON.parse 后同步回 toolCall.arguments。纯文本同步,不动 thinking(那是 #339 的 scope)。

效果

出口 args 复写本 21.6K → 数百 tokens 量级;与 #339(剥 thinking,~53K)正交,两项合计削掉锚点三层地板中的两层。

依赖与顺序

  1. acp-kernel feat(config): move acp.json under agent dir with legacy fallback #232 合并 + 发版(预计 v0.0.60)
  2. 本仓库 pin bump 到该版本
  3. 本 issue 的同步 PR(可先行用 kernel master overlay 本地验证)

关联

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