@joshuaswarren/openclaw-engram 9.1.13 → 9.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import {
3
3
  EngramAccessService,
4
4
  Orchestrator,
5
5
  parseConfig
6
- } from "./chunk-7L2Q2HQB.js";
6
+ } from "./chunk-WUKDMJRD.js";
7
7
  import "./chunk-4PXEFPHR.js";
8
8
  import "./chunk-IMMYYNXG.js";
9
9
  import "./chunk-4XBRUH6C.js";
@@ -3545,17 +3545,17 @@ var LocalLlmClient = class _LocalLlmClient {
3545
3545
  });
3546
3546
  clearTimeout(timeout);
3547
3547
  if (!response.ok) {
3548
- return { ok: false, data: null };
3548
+ return { ok: false, data: null, status: response.status };
3549
3549
  }
3550
3550
  const contentType = response.headers.get("content-type");
3551
3551
  if (contentType?.includes("application/json")) {
3552
- return { ok: true, data: await response.json() };
3552
+ return { ok: true, data: await response.json(), status: response.status };
3553
3553
  } else {
3554
- return { ok: true, data: await response.text() };
3554
+ return { ok: true, data: await response.text(), status: response.status };
3555
3555
  }
3556
3556
  } catch (err) {
3557
3557
  clearTimeout(timeout);
3558
- return { ok: false, data: null };
3558
+ return { ok: false, data: null, status: null };
3559
3559
  }
3560
3560
  }
3561
3561
  /**
@@ -3577,6 +3577,7 @@ var LocalLlmClient = class _LocalLlmClient {
3577
3577
  return this.isAvailable;
3578
3578
  }
3579
3579
  const baseUrl = this.config.localLlmUrl.replace("localhost", "127.0.0.1").replace(/\/+$/, "");
3580
+ let sawUnauthorizedProbe = false;
3580
3581
  for (const serverConfig of LOCAL_SERVERS) {
3581
3582
  const healthUrl = `${baseUrl}${serverConfig.healthEndpoint}`;
3582
3583
  log.debug(`checking ${serverConfig.type} at ${healthUrl}`);
@@ -3588,6 +3589,9 @@ var LocalLlmClient = class _LocalLlmClient {
3588
3589
  log.info(`detected ${serverConfig.type} at ${baseUrl}`);
3589
3590
  return true;
3590
3591
  }
3592
+ if (result.status === 401 || result.status === 403) {
3593
+ sawUnauthorizedProbe = true;
3594
+ }
3591
3595
  }
3592
3596
  try {
3593
3597
  const modelsUrl = `${baseUrl}/v1/models`;
@@ -3599,11 +3603,19 @@ var LocalLlmClient = class _LocalLlmClient {
3599
3603
  log.info(`detected generic OpenAI-compatible server at ${baseUrl}`);
3600
3604
  return true;
3601
3605
  }
3606
+ if (result.status === 401 || result.status === 403) {
3607
+ sawUnauthorizedProbe = true;
3608
+ }
3602
3609
  } catch {
3603
3610
  }
3604
3611
  this.isAvailable = false;
3605
3612
  this.detectedType = null;
3606
3613
  this.lastHealthCheck = now;
3614
+ if (sawUnauthorizedProbe) {
3615
+ log.warn(
3616
+ `local LLM availability probe was unauthorized at ${baseUrl}; verify localLlmApiKey and localLlmAuthHeader settings`
3617
+ );
3618
+ }
3607
3619
  log.debug("local LLM not available at", baseUrl);
3608
3620
  return false;
3609
3621
  }
@@ -4117,6 +4129,11 @@ var LocalLlmClient = class _LocalLlmClient {
4117
4129
  try {
4118
4130
  const result = await this.fetchWithTimeout(modelsUrl, 3e3);
4119
4131
  if (!result.ok) {
4132
+ if (result.status === 401 || result.status === 403) {
4133
+ log.warn(
4134
+ `Local LLM: unauthorized while fetching models from ${modelsUrl}; verify localLlmApiKey and localLlmAuthHeader settings`
4135
+ );
4136
+ }
4120
4137
  log.warn(`Local LLM: Failed to fetch models from ${modelsUrl} - server returned error`);
4121
4138
  return null;
4122
4139
  }
@@ -31428,4 +31445,4 @@ export {
31428
31445
  EngramAccessInputError,
31429
31446
  EngramAccessService
31430
31447
  };
31431
- //# sourceMappingURL=chunk-7L2Q2HQB.js.map
31448
+ //# sourceMappingURL=chunk-WUKDMJRD.js.map