fix(query-understand): fall back to original query on unparsable output

main
MidoriKurage 2026-08-07 14:51:11 +08:00 committed by lyingbug
parent d763816ebf
commit 1d2d623bfd
1 changed files with 1 additions and 5 deletions

View File

@ -334,11 +334,7 @@ func (p *PluginQueryUnderstand) parseOutput(chatManage *types.ChatManage, raw st
return
}
// If JSON parsing failed entirely, treat the raw text as the rewritten query
// and default to IntentKBSearch for safety.
if content != "" {
chatManage.RewriteQuery = content
}
// On parse failure, keep the original query and intent.
}
func parseStructuredQueryOutput(raw string) (queryUnderstandOutput, bool) {