feat: lenient compress-arg parsing via acp-kernel salvage (omp#121) - #188
Open
ranxianglei wants to merge 1 commit into
Open
feat: lenient compress-arg parsing via acp-kernel salvage (omp#121)#188ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
parseCompressInput was strict-only: raw string args (text-protocol triggers, stream tails) were rejected outright, and JSON-string content that failed to parse returned [] — raw arguments discarded, zero log evidence. Weak/local models (vLLM qwen etc.) fail strict JSON ~50% of the time, making the failure class undiagnosable. - string input now routes through parseCompressInputString → kernel salvageParseRanges (5-layer ladder) - broken JSON-string content falls back to the same ladder instead of [] - lenient path logs layer + note, and keeps raw[:800] evidence when 0 ranges are recovered Bump acp-kernel to 0.0.33. tests: 5 new lenient-path cases in basic.test.ts; 516 pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Weak/local models (vLLM qwen etc.) emit compress tool arguments that fail strict JSON.parse ~50% of the time — truncated output caps, raw newlines inside summary strings, trailing commas, or plain prose (see billion-context-omp#121). Until now the proxy's
parseCompressInputwas strict-only:[]— raw arguments discarded with zero log evidence, making the failure class undiagnosable in production.What
Route both paths through acp-kernel's
parseCompressInputString→salvageParseRanges(5-layer ladder: strict JSON / fenced / repaired / truncated-array prefix / field-regex):[];raw[:800]as evidence when 0 ranges are recovered.Bumps acp-kernel to ^0.0.34 (introduces
salvageParseRanges+extractRangesdouble-encode normalization).Tests
5 new lenient-path cases in
tests/basic.test.ts(raw string salvage, fenced JSON, repaired commas/newlines, truncated-array prefix, field-regex prose form). Full suite 516/516, typecheck clean.Companion PRs: acp-kernel#109 (parser), billion-context-omp (replay), billion-context-pi (ACP host extension).
--- DEPENDENCY NOTE (pre-publish) ---