Skip to content

fix(memory): parse line-edit JSON with raw_decode#645

Merged
pancacake merged 1 commit into
HKUDS:devfrom
santhreal:fix/line-doc-raw-decode-edits-dev
Jul 23, 2026
Merged

fix(memory): parse line-edit JSON with raw_decode#645
pancacake merged 1 commit into
HKUDS:devfrom
santhreal:fix/line-doc-raw-decode-edits-dev

Conversation

@santhreal

Copy link
Copy Markdown
Contributor

parse_edits_payload is a tolerant LLM JSON parser, but _extract_json used a greedy rfind("}") slice. Trailing prose that itself contains braces made the slice invalid, so valid edits were silently dropped. Decode the first JSON value with raw_decode (same approach as math_animator).

Repro: {"edits":[...]} trailing {brace} previously returned [].

Trailing prose containing braces made the greedy rfind slice invalid,
so parse_edits_payload silently dropped valid edits. Decode the first
JSON value like math_animator.
@pancacake

Copy link
Copy Markdown
Collaborator

Thanks for your contribution!

@pancacake
pancacake merged commit 2460b3e into HKUDS:dev Jul 23, 2026
vaskoyudha added a commit to vaskoyudha/deeptutor-for-programmer that referenced this pull request Jul 25, 2026
…dits-dev

fix(memory): parse line-edit JSON with raw_decode
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.

2 participants