Repository navigation
[PR] fix(dsh): reuse verified folds across adjacent surface generations - #8123
bluesmilery wants to merge 23 commits into
Conversation
# Conflicts: # scripts/live-files.mjs
The parity test compares forwarded payloads across three forked proxy arms with deepEqual, but the kernel stamps wall-clock yyyy-mm-dd hh:mm:ss timestamps into the ACP tag time= attribute and the compress tool-result block time range. Arms running on different seconds differ in those bytes alone, so the comparison flaked. Mask every wall-clock timestamp before the cross-arm comparison (same sanctioned normalization as issue5403-watermark-fastpath.test.ts).
Resolves the two doc/config conflicts from master's Japanese-docs + config-coverage work: - docs/architecture.md: union (keep PR's DSH native-model-policy intro line + master's en/zh/ja hub line). - website/config-reference/server.yaml: keep the PR's feature-aware dsh section desc (wire guard refuses UNMANAGED native compaction, nativeCompactionModels bypasses it) over master's stale 'refused unconditionally' wording; add the desc_ja that master's new gen-config-docs check-coverage now requires on every entry for dsh.nativeCompactionModels / .model / .provider. No code changes; config-coverage and architecture-docs guards green.
Resolves the one code conflict in src/agent/dsh-native.ts (master moved 265 commits past the previous merge base 36a04a7): - PluginContext.tools type: union of the PR's register {when} conditional (native-compaction model gating) and master's new tools.get? method. - restoreTools register call: keep master's host-owned-lifetime structure (owner.ctx.tools.register(definition), ranxianglei#6702/ranxianglei#3380) and re-attach the PR's {when} predicate so bili tools stay hidden on native-owned models. definition is the same toolDefinition(tool) master pre-builds into owner.definitions (line 1084), so behavior is identical to the PR's inline registration. Verified locally: typecheck + build green; dsh-native-compaction + dsh-native targeted suites 83/83 pass.
# Conflicts: # src/agent/dsh-native.ts
…l-native-compaction
…els (ranxianglei#6123) The PR added the dsh.nativeCompactionModels seed entries and regenerated the EN/ZH config docs, but the Japanese artifact was left stale — the docs-sync drift guard (gen-config-docs generate + git diff --exit-code) went red on the merge ref. This commit is the generator's own output; no manual edits.
…l-native-compaction # Conflicts: # src/agent/dsh-compaction-disable.ts
…l-native-compaction # Conflicts: # reference/architecture.md # src/agent/dsh-native.ts
# Conflicts: # src/agent/dsh-compaction-disable.ts
# Conflicts: # reference/architecture.md # tsup.config.ts
Reviewing this stacked contribution now. Duplicate screening (查重): not a duplicate. Searched open+closed PRs/issues for the same mechanism:
Structural note for reviewers: the 35-file / +1987 PR diff includes the #6123 prerequisite. The actual second patch is a single commit Currently running typecheck + the focused test suites (unit |
|
CI triage for the Windows cold-restart check and the separate upstream failure:
|
|
Confirmed on the final head e238b44: Windows / Node 22, shard 4 reports ok 1821 for the DSH cold-restart / concurrent-retry / original-content test. Its only two remaining failures are the |
The ACP marker regex at src/dsh-generation-reuse.ts:295 used real angle brackets, inconsistent with the dominant hex-escape convention (\x3c/\x3e) used for ACP-tag regexes throughout the codebase (chain-artifacts.ts, preflight.ts, tag-echo-filter.ts, etc.). KDD ranxianglei#2 requires hex escapes for ACP angle brackets in source files. Functionally identical (tests pass 12/12); pure style consistency fix.
[bot] 🏷 PR #8123 审核结论 (ai: opencode/qwen3.8-27b)查重: 不重复。 #8123 是唯一做代际折叠复用的 PR。相关但不同: #6123 (其声明的前置依赖, 引入 审核范围PR diff (35 文件 / +1987) 含 #6123 前置。实际第二个补丁 = 单 commit 验证结果
顺手修 (1 处, 已 push 到 PR 分支)
结构化八问
合并判定代码质量高, 保守 fail-closed, 测试充分, 回归风险低。 风格问题已顺手修。待新 CI (head |
[bot] 🏷 CI 更新 (head 前一个 head 本地定向验证 (head 待办: 需获取 CI 日志确认失败的具体测试。若为 flaky, 重跑即可; 若为贡献者新增 commit 的测试问题, 需贡献者修复。不阻塞本 PR 核心逻辑的审核结论 (代码质量高, 保守 fail-closed, 回归风险低)。 |
(ai: vllm-qwen/qwen3.8-27b) Re-verified the live check state first: at head Conclusion: the 3 red shards are an inherited MASTER bug, not a defect in this PR. I did not touch the PR branch (no push). What is failing (all 3 shards, same signature) Why it is a master bug, not a PR bug (verified against live master
Why the prescribed "merge origin/ci-fixes" action does not apply here Action / disposition
中文八问(结构化结论)
关键事实补充: 判定:本 PR 无缺陷,红 CI 源于 master 既有 bug;不在 PR 分支止血,停手等 master/ci-fixes 侧修复。 |
Resolve tsup.config.ts entry-array conflict: keep both the PR's dsh-native-compaction entry and master's inline-engine entry (KDD ranxianglei#26 dist chunking). Union resolution; build + typecheck verified locally.
(ai: vllm-qwen/qwen3.8-27b) Merge conflict resolved. The PR was 28 commits behind master with a single content conflict in
Both entry files exist in the merged tree, so both belong in the build. I chose merge (not rebase) because this branch's established pattern is to merge master in (prior "Merge origin/master" commits) and its history carries many merge commits — a rebase would replay all of them. Verified locally before pushing:
Pushed as a fast-forward (no force): CI note: the new head ( 中文八问(结构化结论)
CI 说明:新 head( 判定:合并冲突已解决,PR 现与 master 同步、可合并;本 run 工作完成。 |
Fixes #8125
Problem
A DSH surface replacement changes the billing/compression conversation namespace introduced in #6123. Sending the first full replay to an empty namespace can resend history that the preceding generation had already compressed. Adopting the whole parent would also hide real edits or expose stale tool results.
Change
On the first full replay of an empty child, copy only complete folds from the immediately preceding generation of the same DSH session and upstream. Check original wire-unit content and order, complete tool pairs, protected recent messages, nested dependencies, citations, original text and content-store bindings. Persist accepted folds under the target lock before preparing the first upstream request. A miss keeps the raw messages; an existing child or a legacy ledger without evidence is never backfilled. No extra summary call, history rewrite or change to either compaction engine.
The adapter stamps the owner only on attributed main dispatches carrying host message IDs. The local proxy consumes that header; it does not reach the model. Scope is OpenAI Chat and Anthropic Messages. Responses, auxiliary calls, partial deltas and the experimental egress plane are not reuse sources.
Review stack
Depends on #6123 for the DSH model/generation namespace. The base is upstream master; until #6123 lands, GitHub's Files changed tab includes the prerequisite. Review the second patch alone. Please merge the route first (or rebase this after it), not the other way around.
Config surface
No new config, no migration or automatic repair of existing ledgers.
Verification
All histories and provider responses for these tests are synthetic.