Skip to content

fix(parse): coalesce split line-form entries — refs header + summary as sibling array elements (#1001 problem 3) - #330

Merged
ranxianglei merged 1 commit into
masterfrom
2026-09-20_line-form-split-summary
Sep 19, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-09-20_line-form-split-summary

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes the third problem in billion-context #1001 (the one PR #1009 does not cover).

Root cause

parseLineEntry requires each line-form content entry to be ONE multi-line string (line 1 = m00150–m00220 topic, lines 2+ = summary). Models on non-strict wires (glm, chat/completions) routinely emit the header and the summary as SIBLING array elements:

{"content": ["m01588–m01712 走bili UI move + …", "## TASK …"]}

Each half alone is invalid (header-only → "missing summary after the refs header line"; summary sibling → "no refs in header"), so the whole call dies with kind=no-valid-ranges, dropped=2 — in #1001 this paired failure happened 5+ times, with object form succeeding on every manual retry. Not a regression from a recent change: the line-form parser shipped 09-13 (1dc17de..1caa488); the model just splits the documented shape.

Fix

coalesceLineEntries() runs before validateEntries: a refless string entry that directly follows a header-only string entry is adopted as that entry's summary body.

  • multiple summary siblings concatenate ("part 1", "part 2"part 1\npart 2);
  • complete entries (header + \n + body in one string), object entries, and refless strings after them reset the pairing — those keep today's verdicts exactly;
  • a header-only entry with nothing to adopt still fails (no summaryless compressions).

Tests

5 new cases in tests/parse-compress-input.test.ts: exact #1001 shape (CJK topic + en-dash range, topic preserved from the header), multi-sibling concat, stray-after-complete stays invalid, header-only still rejected, object entry resets pairing. Suite: 833 pass / 0 fail. Typecheck + build green.

Release note

bili PR #1009 should bump its pin to this version once released so issue #1001 is fully covered end-to-end.

…as sibling array elements (#1001 problem 3)

Models (glm on the chat/completions wire) routinely emit the documented
line form split across content elements: ["m01588–m01712 topic",
"## TASK ..."]. Each half alone is invalid (header-only lacks a summary;
the summary sibling lacks refs), so the whole call failed with
kind=no-valid-ranges, dropped=2 — five-plus paired failures in #1001,
object form always succeeding on retry.

coalesceLineEntries() now attaches refless string entries that follow a
header-only string entry onto that entry as its summary body (multiple
siblings concatenate; complete entries, object entries, and non-adjacent
strays reset the pairing and keep today's verdicts).
@github-actions

Copy link
Copy Markdown

📦 Built Package Artifact

Branch: 2026-09-20_line-form-split-summary (c2066e9)

Option A — Install from npm PR tag (recommended)

In your adapter project:

npm install acp-kernel@pr-330

Each push to this PR publishes a new version under the pr-330 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf acp-kernel-pr330.tgz
npm install ./package

This comment is automatically updated on each push.

@ranxianglei
ranxianglei merged commit daa4e2e into master Sep 19, 2026
4 checks passed
@ranxianglei ranxianglei mentioned this pull request Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant