Files
nofx/decision
ZhouYongyou 86a7c2361b fix(decision): handle fullwidth JSON characters from AI responses
Extends fixMissingQuotes() to replace fullwidth brackets, colons, and commas that Claude AI occasionally outputs, preventing JSON parsing failures.

Root cause: AI can output fullwidth characters like [{:, instead of [{ :,
Error: "JSON 必须以 [{ 开头,实际: [ {"symbol": "BTCU"

Fix: Replace all fullwidth JSON syntax characters:
- [] (U+FF3B/FF3D) → []
- {} (U+FF5B/FF5D) → {}
- : (U+FF1A) → :
- , (U+FF0C) → ,

Test case:
Input:  [{\"symbol\":\"BTCUSDT\",\"action\":\"open_short\"}]
Output: [{\"symbol\":\"BTCUSDT\",\"action\":\"open_short\"}]

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 22:41:35 +08:00
..