From 40ba5865a471b83d54dae48ac4e01149ab9baafb Mon Sep 17 00:00:00 2001 From: ZhouYongyou <128128010+zhouyongyou@users.noreply.github.com> Date: Tue, 4 Nov 2025 23:11:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(decision):=20add=20CJK=20punctuation=20supp?= =?UTF-8?q?ort=20in=20fixMissingQuotes=20Critical=20discovery:=20AI=20can?= =?UTF-8?q?=20output=20different=20types=20of=20"fullwidth"=20brackets:=20?= =?UTF-8?q?-=20Fullwidth:=20=EF=BC=BB=EF=BC=BD=EF=BD=9B=EF=BD=9D(U+FF3B/FF?= =?UTF-8?q?3D/FF5B/FF5D)=20=E2=86=90=20Already=20handled=20-=20CJK:=20?= =?UTF-8?q?=E3=80=90=E3=80=91=E3=80=94=E3=80=95(U+3010/3011/3014/3015)=20?= =?UTF-8?q?=E2=86=90=20Was=20missing!=20Root=20cause=20of=20persistent=20e?= =?UTF-8?q?rrors:=20User=20reported:=20"JSON=20=E5=BF=85=E9=A1=BB=E4=BB=A5?= =?UTF-8?q?=E3=80=90=EF=BD=9B=E5=BC=80=E5=A4=B4"=20The=20=E3=80=90=20chara?= =?UTF-8?q?cter=20(U+3010)=20is=20NOT=20the=20same=20as=20=EF=BC=BB=20(U+F?= =?UTF-8?q?F3B)!=20Added=20CJK=20punctuation=20replacements:=20-=20?= =?UTF-8?q?=E3=80=90=20=E2=86=92=20[=20(U+3010=20Left=20Black=20Lenticular?= =?UTF-8?q?=20Bracket)=20-=20=E3=80=91=20=E2=86=92=20]=20(U+3011=20Right?= =?UTF-8?q?=20Black=20Lenticular=20Bracket)=20-=20=E3=80=94=20=E2=86=92=20?= =?UTF-8?q?[=20(U+3014=20Left=20Tortoise=20Shell=20Bracket)=20-=20?= =?UTF-8?q?=E3=80=95=20=E2=86=92=20]=20(U+3015=20Right=20Tortoise=20Shell?= =?UTF-8?q?=20Bracket)=20-=20=E3=80=81=20=E2=86=92=20,=20(U+3001=20Ideogra?= =?UTF-8?q?phic=20Comma)=20Why=20this=20was=20missed:=20AI=20uses=20differ?= =?UTF-8?q?ent=20characters=20in=20different=20contexts.=20CJK=20brackets?= =?UTF-8?q?=20(U+3010-3017)=20are=20distinct=20from=20Fullwidth=20Forms=20?= =?UTF-8?q?(U+FF00-FFEF)=20in=20Unicode.=20Test=20case:=20Input:=20=20?= =?UTF-8?q?=E3=80=90=EF=BD=9B"symbol"=EF=BC=9A"BTCUSDT"=E3=80=91=20Output:?= =?UTF-8?q?=20[{"symbol":"BTCUSDT"}]=20Co-Authored-By:=20tinkle-community?= =?UTF-8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- decision/engine.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/decision/engine.go b/decision/engine.go index 9619cc61..d8decef9 100644 --- a/decision/engine.go +++ b/decision/engine.go @@ -480,6 +480,13 @@ func fixMissingQuotes(jsonStr string) string { jsonStr = strings.ReplaceAll(jsonStr, ":", ":") // U+FF1A 全角冒号 jsonStr = strings.ReplaceAll(jsonStr, ",", ",") // U+FF0C 全角逗号 + // ⚠️ 替换CJK标点符号(AI在中文上下文中也可能输出这些) + jsonStr = strings.ReplaceAll(jsonStr, "【", "[") // CJK左方头括号 U+3010 + jsonStr = strings.ReplaceAll(jsonStr, "】", "]") // CJK右方头括号 U+3011 + jsonStr = strings.ReplaceAll(jsonStr, "〔", "[") // CJK左龟壳括号 U+3014 + jsonStr = strings.ReplaceAll(jsonStr, "〕", "]") // CJK右龟壳括号 U+3015 + jsonStr = strings.ReplaceAll(jsonStr, "、", ",") // CJK顿号 U+3001 + return jsonStr }