Commit Graph
3 Commits
Author SHA1 Message Date
can1357 ef95756354 refactor(ai): simplified streaming JSON parsing and removed unused user agent helper
- Removed the unused `antigravity-user-agent.ts` file from the AI providers.
- Updated `parseStreamingJson` to trim only leading whitespace, try `JSON.parse` first, then partial parsing on repaired input before returning an empty object on failure.
- Removed a streaming JSON test that depended on preserving trailing spaces in incomplete string fragments.
2026-05-02 06:59:25 +02:00
can1357 1a95e93ac7 chore: smol prompt change 2026-05-02 04:34:38 +02:00
can1357 ac1bacbeab fix(ai/utils): reworked JSON repair to efficiently fix malformed string escapes
- Optimized `repairJson` to scan JSON input incrementally and only patch invalid escape sequences or raw control characters.
- Reworked escape validation with byte-level constants and stricter `\uXXXX` handling for truncated or non-hex sequences.
- Added coverage for valid escapes, control-character repair, literal invalid-escape preservation, and whitespace-only streaming JSON inputs.
2026-05-02 02:03:15 +02:00