Skip to content

Link posts survive a malformed model reply - #161

Merged
ralyodio merged 1 commit into
mainfrom
fix/link-post-lenient-json
Oct 7, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/link-post-lenient-json

Conversation

@ralyodio

@ralyodio ralyodio commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Verifying #159 live: drafting from https://outreachgraph.com/ returned 502 draft_failed. Prod's gpt-4o-mini replied with four good posts and one stray } after the Reddit object, and the strict JSON.parse threw all four away. When the whole reply is not valid JSON, each {"network": ...} object is now parsed on its own (string-aware brace matching), so one bad brace costs at most its own post. Regression test uses that reply's shape.

🤖 Generated with Claude Code

Prod's gpt-4o-mini answered for https://outreachgraph.com/ with a stray } after the Reddit post; the strict JSON.parse dropped all four posts and the API returned 502 draft_failed. Each {"network": ...} object is now parsed separately when the whole reply is not valid JSON.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit a70df3f into main Oct 7, 2026
4 checks passed
@ralyodio
ralyodio deleted the fix/link-post-lenient-json branch October 7, 2026 15:45
@ralyodio ralyodio mentioned this pull request Oct 7, 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