Repository navigation
[PR] Guard the google lane against inert-frame tail drains - #6535
ranxianglei merged 1 commit into
Conversation
ranxianglei#5849 added hadTextOtherThanTextFields to the chat lane after a text-less frame drained a held render-tag head, letting the rest of the tag reach the host as prose. The google lane kept the unconditional drain, on the assumption that it never sees such frames -- an absence of observation, not a property of the lane. A Gemini progress frame whose only part is {text:""} reproduces the same split here, so gate that exit on googleFrameHasNonText, the predicate the rebuilt branch three lines above already uses.
[bot] 🏷 Duplicate screen: not a duplicate. This is the Google-lane half of the #5848 mechanism; the chat-lane half (#5849) is already merged on master. I searched open PRs — #6535 is the only in-flight PR doing the Google-lane inert-frame guard. #6537 is in the same #5192 family but a different mechanism (making a dropped head auditable, not the guard itself), so related but not a duplicate. Labels applied: Verdict: APPROVE / 可合 — pending CI (head Review method: I read the full diff independently (not the PR body's claims), pulled the authoritative source at the PR head, verified the mechanism against the tag-echo filter, and ran the in-family suites locally (RED before the fix, GREEN after). 结构化八问
验证(本地,PR head
|
|
Superseded by #6765 (merged to master as 7c17438). Your commit 2a355a6 is in master verbatim — same content, same authorship, only the object ID changed (the batch used a real Thanks for the fix — it is live in master from 7c17438 onward. |
What this changes
Ports the #5848 inert-frame guard to the Google (Gemini) lane, which still drained the tag-echo filter on any text-less frame.
src/plugin.ts:3748(insideprocessGoogle,:3582) was the exact twin of the line #5849 fixed for chat:googleFrameHasNonTextis the Gemini counterpart ofhadTextOtherThanTextFieldsand already existed in the file (it gates therebuiltbranch three lines above at:3740). No new helper, no config surface, no wire change.Why
PR #5849 shipped the guard on the chat lane only, justified in its description with "no mid-stream text-less frames observed there" for the Google lane — an absence of observation, not a property of the lane. When a text-less frame reaches the unguarded exit:
anyPending()is true because the tag-echo filter is holding a split render tag (<acp tokens="3);flushTails()drains it, andcreateTagEchoFilter.flush()drops the open-tag prefix it cannot complete (TRUNC_OPEN→drop(t[0]));1" type="text" …>m00039) never started with<, so it is forwarded as prose.That is exactly the persisted shape in #5192 (
type="text">mNNNNNas assistant text), reached through a different lane.Reproduction (red before the fix)
tests/plugin-passthrough-progress-frame-google.test.ts— the Gemini twin oftests/plugin-passthrough-progress-frame.test.ts, using a progress frame in Gemini's own dialect (a candidate whose only part is{ text: "" }).Against the unpatched tree, 3 of the 5 tests fail, e.g.:
With the fix: 19/19 pass across the three in-family suites (
plugin-passthrough-progress-frame-google,plugin-passthrough-progress-frame,plugin-passthrough-finish-tail).Both directions are asserted, per §3 Gate Test Discipline: the guard must not hold on a frame that legitimately carries something (
usageMetadatastill drains the held tail, and the result equals the no-extra-frame control run), and ordinary streams with no held tail are byte-identical.Verification
npx tsc --noEmit --project tsconfig.json→ exit 0Scope
Single-module fix (
src/plugin.ts+ one new test file). No config schema, no persistence, no wire shape, nokernel/change, noversionbump.Fixes #5192is deliberately not claimed — that issue keeps several open facets (live-streaming matcher policy, injection-side root cause) per the owner's "keep all facets under this issue" ruling; this PR closes only the Google-lane half of the #5848 mechanism.Related
type="text">mNNNNNinto assistant text #5192 — the family this belongs toplugin-passthrough-finish-tail.test.ts)