{"record":{"id":"72ab06989547f518","repo":"gitbutlerapp/gitbutler","slug":"received-empty-response-from-ai-service","errorCode":null,"errorMessage":"Received empty response from AI service","messagePattern":"Received empty response from AI service","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/src/components/settings/AiCredentialCheck.svelte","lineNumber":149,"sourceCode":"\t\t\t\t\t// Append each token as it comes in\n\t\t\t\t\tstreamingResult += token;\n\t\t\t\t},\n\t\t\t});\n\n\t\t\t// Clear the timeout since we got a result\n\t\t\tif (testTimeout) {\n\t\t\t\tclearTimeout(testTimeout);\n\t\t\t\ttestTimeout = null;\n\t\t\t}\n\n\t\t\t// Set the final result (handling undefined case)\n\t\t\tresult = aiResult || streamingResult || null;\n\n\t\t\tdebugInfo += `, Received commit message: ${result?.substring(0, 30)}${result && result.length > 30 ? \"...\" : \"\"}`;\n\n\t\t\t// If result is empty or undefined, show an error\n\t\t\tif (!result || result.trim() === \"\") {\n\t\t\t\tthrow new Error(\"Received empty response from AI service\");\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(\"AI credential check error:\", e);\n\n\t\t\t// Don't show abort errors as they're expected when we cancel the request\n\t\t\tif (e instanceof Error && e.name === \"AbortError\") {\n\t\t\t\terror = \"AI request was cancelled\";\n\t\t\t} else {\n\t\t\t\terror = e instanceof Error ? e.message : \"Unknown error occurred\";\n\t\t\t}\n\n\t\t\tdebugInfo += `, Error: ${error}`;\n\n\t\t\t// Clear the timeout if there was an error\n\t\t\tif (testTimeout) {\n\t\t\t\tclearTimeout(testTimeout);\n\t\t\t\ttestTimeout = null;\n\t\t\t}","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/apps/desktop/src/components/settings/AiCredentialCheck.svelte#L131-L167","documentation":"After a completed AI round-trip in the credential check, both the direct result and the accumulated streamed tokens came back empty or whitespace-only. The service responded without an error but produced no usable text, indicating a provider-side or model-configuration problem (empty completions) rather than a connectivity or auth failure.","triggerScenarios":"Thrown at apps/desktop/src/components/settings/AiCredentialCheck.svelte:149 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the test once - transient empty completions occur, especially with streamed models","Try a different model name in AI settings in case the selected model returns empty output","Check the provider's status page or local server logs for why completions come back empty"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}