fix(preflight): preserve complete content when recovering blocked ranges - #668
fix(preflight): preserve complete content when recovering blocked ranges#668Wuxie233 wants to merge 1 commit into
Conversation
|
Validation is complete for commit 71c6695: typecheck/build pass, all 1254 standalone serial tests pass, and all four upstream CI test jobs pass (Ubuntu/Windows, Node 22/24). Version guard also passes. The separate build-artifact job built successfully but failed at the npm PR-tag publish step with ENEEDAUTH: fork PRs do not receive the publishing credential. No credential or workflow permission change is needed to review this patch. Please treat that as a separate publishing-workflow issue; the branch and exact source diff are available in this PR. The gated real-client E2E suite remains a pre-merge check, as documented in the PR body. |
Review of Diff: single commit, two files — Verification (run locally on the PR head)
Design review against acp-kernel 0.0.60
Remaining pre-merge check: the gated four-phase real-client E2E ( ENEEDAUTH on the build-artifact job: confirmed as a separate workflow defect. 中文摘要:PR 已独立复核(typecheck 与 1254 项测试全部通过),preflight 预览/分段摘要/软保护放宽逻辑与 kernel 0.0.60 实际行为一致、diff 干净,审查通过,合并前仅剩 E2E 门控;fork PR 的 ENEEDAUTH 属发布工作流缺陷,已另开 #670。 |
When preflight selects a raw range already covered by an active block, it can exhaust its candidates without reducing an oversized request. Additionally, kernel tool/reasoning pairing can expand a requested range beyond the text previously supplied to the summarizer.
This change previews the kernel's actual compression boundary without mutating the session, skips rejected ranges, and collects exactly the content to be consumed using the original state so active child blocks remain summaries. Large content is summarized in bounded segments, and compression is applied only after every segment succeeds and the assembled summary satisfies the configured limit. Non-positive maximum summary lengths retain the kernel's unlimited semantics.
If ordinary candidates are exhausted while the request remains over-window, preflight retries with recent soft protection relaxed. Hard tool protection remains enforced; unknown-baseline decisions use the conservative upper bound. Summary carriers, persistent history, and the configured model window are unchanged. The shared preflight preserves the kernel contract in both modes; this does not change the plugin/proxy wire-carrier distinction.
Refs #663. This is a standalone range-recovery fix on current master, complementary to #665. It intentionally does not include the output-limit or Lite-header compatibility patches from that PR.
Validation:
The repository's gated four-phase client E2E suite has not been rerun for this standalone branch; it remains a pre-merge check. No private history, deployment scripts, credentials, or generated bundles are included.
CI note: the separate build-artifact workflow successfully builds but fails at publishing its npm PR tag with ENEEDAUTH because the fork PR has no npm publishing credential. The four test-matrix jobs pass. This is a publishing-workflow limitation, not a compile/test failure.