Repository navigation
[PR] fix: keep whole-message inserts out of semantic appends - #6738
ranxianglei merged 1 commit into
Conversation
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 No other open PR or issue targets the cache-diff insertion-boundary fix. I re-verified the PR's own history check against current master: #6496 (UTF-8 offsets only), #6691 (root-array discovery, already on this base), #3479 (the in-unit exception this PR tightens), #3027 (live-ledger producer attribution, different surface). #6738 is the only open PR touching ReviewVerdict: mergeable (可合) — pending the full CI test shards, which are still running (see below). What I verified (live, on head
|
Closes #6736
Problem
The offline cache-diff tool treats any byte insertion surrounded by an unchanged prefix and suffix as semantic message growth. That shape also describes inserting a complete message into the middle of existing history, prepending a message, or lengthening a model name before the conversation array. These are not growth inside one existing message, but the report calls them
pure-appendand loses client/proxy rewrite attribution.The special case introduced in #3479 explicitly describes an unchanged element count and growth inside one logical unit. Its actual condition only checks the byte prefix/suffix. This patch enforces the documented structural boundary while retaining the intended large single-message history container.
Change
Accept
mid-insertonly when both bodies select the same root message array, its element count stays unchanged, and one existing element span contains the insertion and grows by exactly the added text length. Whole-message insertions and changes before the array fall through to divergence. Field changes retain the existingpreArraynote in the public report.Handle an initially empty array as an ordinary first tail append. Skip legal JSON whitespace before separators when collecting spans, so the tighter check continues to recognize growth in later elements of a whitespace-formatted array. Normal strict-prefix and tail append classifications remain intact.
This changes the offline
bili acp-cache diffclassifier and its reports. It does not change wire bytes, provider requests, billing, or the separate live-panel threshold policy.Verification
messages,input,contents) reproduce whole-message prepend/middle insertion and pre-array model growth.runDiff: proxy insertion, client insertion, client rewriting normalized by the proxy, and a field-level model change. They assert classification, attribution, the correct message index, and the field-level note.acp-cache diff: dump request-header preamble folded into the byte comparison, and the auto-review giant single user message makes a pure append look like a mid-history insert | [Bug] BODY STABILITY /… #3476 in-unit growth suite, root-array lookup, Unicode offsets and the existing cache-diff report/usage cases.npm run typecheck,npm run build, andgit diff --checkpass.Validation used Node 24.22.1, TZ=UTC and an isolated temporary directory. No runtime dependency or configuration surface is added.
History check
Checked all Afloat16 issue descriptions and actual related PR patches. A fresh read of #6496 changes UTF-8 offsets only. #6691, already on this base, fixes discovery of the root array; the new regressions still fail on that corrected locator. The complete #3479 patch establishes the in-unit exception but lacks these count/span checks. #3027 concerns live-ledger producer attribution, not this offline append decision. Focused all-state insertion/semantic-append searches found no existing equivalent correction.
Base: master
a8bbb8d23108ba9148d09512927041364625d910, bili 0.1.214. Full-suite status is the hosted CI on the exact pushed head.