currently we just checking the error response key word using .include in src/components/terminal/AiCommandBar.tsx line 360...367
fix
- set constant ( a structured error object ) instead of error being a string it looks like this
{
"code": "AI_DISABLED",
"message": "AI features have been disabled in your settings.",
"provider": "ollama"
}
and frontend code look likke this
const classifyError = (err: AppError): ErrorKind => {
if (err.code === 'AI_DISABLED') return 'disabled';
if (err.code === 'AUTH_FAILED') return 'invalid-key';
// No strings, no guesses!
return 'generic';
};
currently we just checking the error response key word using .include in src/components/terminal/AiCommandBar.tsx line 360...367
fix
{ "code": "AI_DISABLED", "message": "AI features have been disabled in your settings.", "provider": "ollama" }and frontend code look likke this