From 23da1872f2a202044cbe2b12b3837e7789c27b9d Mon Sep 17 00:00:00 2001 From: abhishek Date: Thu, 24 Sep 2026 12:37:22 +0530 Subject: [PATCH] agent changes --- src/api/assistant.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/api/assistant.ts b/src/api/assistant.ts index 980ba50..668d97c 100644 --- a/src/api/assistant.ts +++ b/src/api/assistant.ts @@ -69,7 +69,17 @@ export interface AssistantAnswer { */ export async function assistantAvailable(): Promise { try { - const status = await api.get<{ available?: boolean }>(`${WEB}/assistant/status`); + const status = await api.get<{ available?: boolean; reason?: string }>( + `${WEB}/assistant/status`, + ); + // The reason goes to the browser console, never to the panel. It names + // environment variables — useful to whoever deployed this, meaningless and + // faintly alarming to a shopkeeper. "Not connected yet" stays the only + // thing on screen; this is how somebody finds out which variable is wrong + // without a redeploy to add logging. + if (status?.available !== true && status?.reason) { + console.warn(`[nearle] Buddy is off: ${status.reason}`); + } return status?.available === true; } catch { return false;