singularity-forge/packages
Tibsfox 920fed7122 fix(pi-ai): extend repairToolJson to handle XML tags and truncated numbers
The existing repairToolJson only handles YAML bullet lists (#2660).
Two additional malformation patterns from smaller models now cause
tool call failures and stuck retry loops:

1. XML parameter tags mixed into JSON values (#3403):
   LLMs (especially Haiku-class) sometimes emit hybrid XML/JSON
   syntax like <parameter name="X">value</parameter> inside
   JSON string values. Add stripXmlParameterTags() to remove
   the tags while preserving content.

2. Truncated numeric values (#3464):
   Smaller models emit incomplete numbers like "exitCode": -,
   or "durationMs": , when values are cut off mid-generation.
   Add repairTruncatedNumbers() to replace these with 0.

Both repairs run before the existing YAML bullet repair phase.
The AJV validation layer (coerceTypes: true) then handles any
remaining string-to-number coercion.

Adds 13 new tests covering detection and repair for both patterns.

Closes #3464, closes #3403, addresses #3369
2026-04-04 03:59:55 -07:00
..
daemon wip: M005 daemon — orchestrator, event bridge, formatter, batcher improvements (#2929) 2026-03-27 20:22:30 -06:00
mcp-server feat: Headless Integration Hardening & Release (M002) (#2811) 2026-03-26 23:33:22 -06:00
native fix: align @gsd/native module type with compiled output (#3253) 2026-03-30 13:51:57 -06:00
pi-agent-core fix: handle pause_turn stop reason to prevent 400 errors with native web search (#2869) (#3248) 2026-03-30 13:51:18 -06:00
pi-ai fix(pi-ai): extend repairToolJson to handle XML tags and truncated numbers 2026-04-04 03:59:55 -07:00
pi-coding-agent Merge pull request #3432 from deseltrus/fix/slash-command-session-routing 2026-04-03 05:08:01 -05:00
pi-tui fix: skip TUI render loop on non-TTY stdout to prevent CPU burn (#3095) (#3263) 2026-03-30 13:49:55 -06:00
rpc-client feat: Headless Integration Hardening & Release (M002) (#2811) 2026-03-26 23:33:22 -06:00