feat(ai): add full JSON \uXXXX decoding with UTF-8 and surrogate pair support #126

Manually merged
jabber.developer merged 2 commits from fix/ai-json-encoding into master 2026-05-19 19:15:15 +00:00
2 changed files with 121 additions and 17 deletions
Showing only changes of commit 53cdf488b6 - Show all commits

View File

@@ -10932,21 +10932,14 @@ cmd_ai_start(ProfWin* window, const char* const command, gchar** args)
if (g_strv_length(args) >= 2) {
provider_name = args[1];
}
if (g_strv_length(args) >= 3) {
model = args[2];
if (!provider_name) {
cons_show_error("Please specify provider name.");
return TRUE;
}
// Resolve defaults
auto_gchar gchar* owned_provider_name = NULL;
if (!provider_name) {
// Use default provider from preferences
auto_gchar gchar* default_provider = prefs_get_string(PREF_AI_PROVIDER);
if (default_provider && strlen(default_provider) > 0) {
provider_name = default_provider;
}
}
if (!provider_name) {
provider_name = "openai"; // Fallback
if (g_strv_length(args) >= 3) {
model = args[2];
}
AIProvider* provider = ai_get_provider(provider_name);