Repository navigation
[PR] fix(web): preserve frozen message whitespace on retrieval - #6718
ranxianglei merged 1 commit into
Conversation
(ai: vllm-qwen/qwen3.8-27b) Review — PR #6718 Duplicate screening: no duplicate. Independent all-state search (frozen-snapshot whitespace / What I verified independently (not just the PR's claims):
CI: still in progress on the pushed head (407deb5) — 5 gates green, 10 e2e lanes skipped, 15 test/build lanes still queued, no failures so far. The authoritative full-suite verdict is the remote CI Auto-merge gate (§7.4): all 8 hold — single-module web-reader fix, reproducing regression test, green locally, no config/persistence/wire/kernel touch, pure 八问
判定:可合并(mergeable)。 修的是根因(解析器把正文与分隔符混淆),不是治标;测试是真回归测试(旧码 15 例红、新码全绿);diff 干净、无回归、无阻断项。等 CI 全绿后由 owner 合并即可。 |
Closes #6717
Problem
When a message has left both the resident window and unified storage, the Web panel can recover it from a frozen block-content snapshot. That parser currently uses an empty accumulated string to detect the first body line and removes every trailing newline. Opening the original message therefore silently drops its leading and trailing blank lines, even though the frozen snapshot still contains them.
For example, a message whose exact text is
\n\n first lineis returned asfirst line;last line\n\nis returned aslast line.Change
Track whether a body line has been consumed separately from its contents. When another role header follows, remove only the one empty line contributed by the snapshot's two-newline separator. At the end of the snapshot, retain the entire body. Keep the existing first-marker eligibility separate from whitespace accumulation so ref anchoring continues to work around leading blank lines.
This changes only the read-only Web snapshot fallback. Snapshot serialization, retained originals, live/store lookup priority, byte caps, and the existing alignment/foreign-marker rejection checks remain intact. Plugin and proxy modes use the same diagnostic reader; neither request pipeline nor kernel source changes.
Verification
collectBlockContent()serializer and publicbuildMessageContent()reader: leading/trailing blank lines, newline-only bodies, CRLF content, empty messages, and ordinary text, each at the first, middle, and last position. The old implementation fails 12 cases and passes six controls.web-blocks-tree,web-storage-fallback, andweb-sessions, including the existing shifted/foreign marker, partial snapshot, restamped-ref, lazy storage, and ordinary rendering controls.npm run typecheck,npm run build, andgit diff --checkpass on current master3858b6956abab52da781c2436c0245586ce18358plus this change. Local targeted tests use the repository's preload chain and an isolated writable temporary directory.Full-suite status comes from hosted CI on the pushed head.
History check
Reviewed the complete 111-entry Afloat16 changed-file/patch index and the relevant current-batch changes, plus focused all-state issue/PR searches. #6260 introduced this parser with the current whitespace loss; its actual patch was checked. #6593 changes the separate one-line preview allocator only. The open #6713 batch does not touch this source file. No previous matching whitespace-preserving snapshot read was found.