Make the kernel transcript the authoritative cross-turn context (quality P2-I2) #115

Merged
weichen merged 3 commits from feature/agent-quality-phase02 into main 2026-10-09 16:26:51 +00:00
Owner

摘要

P2 上下文保真 · 增量 I2:内核会话记录成为直连路径的权威跨轮上下文(用户裁定 2)。
组件:Agent-Native #41(思考捕获/回放,已合入)+ 本 PR。Dev 任务卡 feature/agent-quality-phase02。

  • 首轮整段组装一次性播种转录;后续轮只传当前用户消息,完整工具结果/参数/附件原文由转录承载(替代 160 字摘要重建)
  • 结构分歧(消息排除/变体切换/重新生成,指纹判定)→ 重播种(regenerate/exclude 的等价映射,单测覆盖);遗留转录采纳不破坏崩溃配对
  • 动态上下文(尾注/环境/新命中模块)非播种轮经 Reminders 注入一次
  • 接近窗口触发 9 段压缩(aux.session-compact,抽取式回退;追加式条目,工具配对边界对齐)
  • MiniMax 思考内容随转录持久并由内核回放(Agent-Native #41)

真实模型三方对照(同 golden 集:P1 后 → I1 后 → I2 后)

指标(plan-followup 3 轮) P1 I1 I2
工具调用 78 42 29
工具失败 13 10 7
检查失败 7 1 2
未核实数字 13 0 4(单轮方差;趋势远优于 P1)

pm-tool:工具 20→19→12、检查失败 4→0→0、终稿声称缺章节 0→3→0。
读原件归零属预期(原件全文已在转录上下文中)。报告:Dev 任务卡 .task/phase02-eval/。

Evidence

  • 单测:指纹稳定/变化、变体切换重播种、当前用户构建、种子恰一次(语义更新)等全绿;go vet + go test ./... 通过
  • 真实模型对照 evidence 行(SELF)+ 报告入库

Impact

行为:跨轮上下文全保真;无契约/存储变更(transcript 新增 thinking 字段,旧文件兼容)。无沙箱会话回落旧组装路径。

## 摘要 P2 上下文保真 · 增量 I2:**内核会话记录成为直连路径的权威跨轮上下文**(用户裁定 2)。 组件:Agent-Native #41(思考捕获/回放,已合入)+ 本 PR。Dev 任务卡 feature/agent-quality-phase02。 - 首轮整段组装一次性播种转录;后续轮只传当前用户消息,完整工具结果/参数/附件原文由转录承载(替代 160 字摘要重建) - 结构分歧(消息排除/变体切换/重新生成,指纹判定)→ 重播种(regenerate/exclude 的等价映射,单测覆盖);遗留转录采纳不破坏崩溃配对 - 动态上下文(尾注/环境/新命中模块)非播种轮经 Reminders 注入一次 - 接近窗口触发 9 段压缩(aux.session-compact,抽取式回退;追加式条目,工具配对边界对齐) - MiniMax 思考内容随转录持久并由内核回放(Agent-Native #41) ## 真实模型三方对照(同 golden 集:P1 后 → I1 后 → I2 后) | 指标(plan-followup 3 轮) | P1 | I1 | **I2** | |---|---|---|---| | 工具调用 | 78 | 42 | **29** | | 工具失败 | 13 | 10 | **7** | | 检查失败 | 7 | 1 | 2 | | 未核实数字 | 13 | 0 | 4(单轮方差;趋势远优于 P1) | pm-tool:工具 20→19→**12**、检查失败 4→0→**0**、终稿声称缺章节 0→3→**0**。 读原件归零属预期(原件全文已在转录上下文中)。报告:Dev 任务卡 `.task/phase02-eval/`。 ## Evidence - 单测:指纹稳定/变化、变体切换重播种、当前用户构建、种子恰一次(语义更新)等全绿;`go vet` + `go test ./...` 通过 - 真实模型对照 evidence 行(SELF)+ 报告入库 ## Impact 行为:跨轮上下文全保真;无契约/存储变更(transcript 新增 thinking 字段,旧文件兼容)。无沙箱会话回落旧组装路径。
weichen added 2 commits 2026-10-09 16:18:26 +00:00
Why: Every turn rebuilt context from UI messages with 160-char tool-result
summaries and truncated arguments (quality diagnosis root cause 1). The kernel
session transcript already persists full-fidelity messages; P2-I2 switches the
direct path to it as the authority, per the approved plan (Documents
2026-10-09 §4 P2, user ruling 2).

First run (or after structural divergence) seeds the transcript once with the
full ctxasm assembly; later runs pass only the current user message. Dynamic
context - tail notes (personal instructions, session notes, world-book
entries), env update (date, workspace files) and newly hit task-layer prompt
modules - refreshes once per non-seed run via Reminders, so the frozen seed
system prompt stays accurate. Structural divergence (excluded messages,
variant switching, regeneration) changes a fingerprint and reseeds the
transcript from the message store - the regenerate/exclude/variant mapping.
Legacy transcripts without a fingerprint are adopted, not wiped, preserving
crash-pairing repair. Near the window threshold a 9-section compaction
(aux.session-compact, extractive fallback) summarizes older turns with the
kernel's append-only compaction entry; the kernel request-side micro-clear
still bounds within-run spikes. Backend's nested agent-native pin moves to
the reasoning-capture/replay kernel head.

Evidence: SELF - new tests TestContextRevisionStableOnAppendAndChangesOnDivergence,
TestTranscriptReseedsOnVariantSwitch, TestBuildCurrentUserCarriesAttachmentsAndKnowledge;
TestDirectRunSeedsStoreHistoryOnce updated to authoritative semantics; go vet
+ go test ./... pass; live before/after on the golden task set recorded on
the phase02 task card per the policy clause.

Impact: Direct conversations with a workspace sandbox now carry full tool
results, arguments and attachment text across turns; MiniMax thinking replays
from the transcript via the kernel change. No-conversation fallback keeps the
pre-I2 assembly path.
Merge origin/main into feature/agent-quality-phase02
ci / vet-and-test (pull_request) Successful in 42s
81da190ac1
weichen added 1 commit 2026-10-09 16:18:27 +00:00
Merge origin/main into feature/agent-quality-phase02
ci / vet-and-test (pull_request) Successful in 42s
81da190ac1
weichen added 1 commit 2026-10-09 16:25:24 +00:00
Merge origin/main into feature/agent-quality-phase02
ci / vet-and-test (pull_request) Successful in 42s
8c17a2228b
weichen merged commit 822cda2833 into main 2026-10-09 16:26:51 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#115