Skip to content

滚动压缩的第二次摘要丢掉了原始用户目标 #174

Closed

Description

@astarforbae

情况

任务要求把零件脚本写到 /app/build_part.py,把零件存到 /app/part.FCStd。step-1 执行过程中发生了 3 次 context_compacted。

压缩模板 core/prompts/common/context_compact.md 要求摘要保留原始用户目标的原文,并放在 ## Goal 一节。同一次压缩会用这份摘要替换更早的消息(core/src/compaction.rs 的 compact_messages 用摘要作为新的消息前缀,core/src/agent/llm_turn.rs 把 state.messages 换成压缩结果)。下一次压缩读到的是上一份摘要。

观察到的现象

第一次压缩(trajectory sequence 46,25 条消息收到 14 条)的摘要以 ## Goal 开头,原文里有 /app/build_part.py、/app/part.FCStd 和 PartDesign。

第二次压缩(sequence 115,48 条收到 21 条)安装的摘要是下面这一段,508 个字符,没有 ## Goal,也没有上述三条路径。摘要里没有 truncate_summary_to_token_limit 的缩短标记 [... compact summary shortened ...]。

[Context Summary: The following is a summary of earlier conversation]
Looking at the full drawing, I can now see the overall layout clearly. The section view (top-left) shows the asymmetric internal ledges at z 32–42, the side view (top-right) shows the small rectangle at z 4–12, and the bottom view shows the two rectangular pads with 4 holes. Let me do precise programmatic scans of the remaining ambiguities — the section's lower region (checking for tab edges), the bottom-view rectangles, and Detail A.

第三次压缩(sequence 192,59 条收到 21 条)的摘要是一段像素扫描脚本,仍然没有这三条路径。

从 sequence 116 到 sequence 192 之前,每一次 llm_request 的 system prompt、消息和工具定义里都没有 build_part.py、part.FCStd、PartDesign。系统提示词全程不变(sha256 df609191ca18632aadad410a4750c06b36acdd5b0d3dfe7230d2f06f26c8d45a),里面没有这道题的路径。

第三次压缩之后,模型把 CadQuery 脚本写到 /app/reconstruct.py(第一次相关 tool_call 在 sequence 381),并导出了 STEP。Harbor verifier 的结果是 candidate did not produce /app/part.FCStd,reward 0。

同一次 run 在 step-1 结束时还触发了 completion gate(未绑定的 workspace mutation),这一步被标成 failed,计划中写脚本和生成 part.FCStd 的后续步骤没有 step_start。这里单列压缩之后目标从请求里消失的记录。

Activity

  1. ZhiXiao-Lin commented on Sep 25, 2026

    @ZhiXiao-Lin

    Fixed: compaction pins the original goal outside the LLM path (extract_pinned_goal + ensure_goal_section). Rolling summaries that omit ## Goal get the pinned goal re-inserted under a stable heading before the freeform/## Summary body, so the next roll cannot lose paths like /app/build_part.py.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions