Skip to content

fix(memory): parse update facts JSON with raw_decode#646

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

fix(memory): parse update facts JSON with raw_decode#646
pancacake merged 1 commit into
HKUDS:devfrom
santhreal:fix/update-facts-raw-decode-dev

Conversation

@santhreal

Copy link
Copy Markdown
Contributor

_parse_facts is a tolerant LLM JSON parser, but _extract_json_object used a greedy rfind("}") slice. Trailing prose that itself contains braces made the slice invalid, so valid facts were silently dropped. Decode the first JSON object with raw_decode (same approach as line-edit parsing).

Repro: {"facts":[...]} trailing {note} previously returned [].

Trailing prose with braces made the greedy rfind slice invalid, so
_parse_facts silently dropped valid facts. Decode the first object.
@pancacake

Copy link
Copy Markdown
Collaborator

Thanks for your contribution!

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

fix(memory): parse update facts 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