@tangle-network/agent-app 0.60.193 → 0.60.194

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.
@@ -36,7 +36,7 @@ import {
36
36
  flattenHistory,
37
37
  readSandboxBinaryBytes,
38
38
  statSandboxFileSize
39
- } from "../chunk-QW4UOEPH.js";
39
+ } from "../chunk-SUIH5B55.js";
40
40
  import "../chunk-4LBCTFBP.js";
41
41
  import {
42
42
  ModelFailoverExhaustedError,
@@ -47,6 +47,7 @@ function backendModelFields(model) {
47
47
  model: model.model,
48
48
  provider: model.provider,
49
49
  ...model.apiKey !== void 0 ? { apiKey: model.apiKey } : {},
50
+ ...model.apiKeyEnv !== void 0 ? { apiKeyEnv: model.apiKeyEnv } : {},
50
51
  ...model.baseUrl !== void 0 ? { baseUrl: model.baseUrl } : {}
51
52
  }
52
53
  };
@@ -66,7 +67,8 @@ function resolveModelSelection(config, override) {
66
67
  const source = overrideModel ? "override" : configModel ? "config" : "default";
67
68
  if (!provider) return { succeeded: false, error: "no_provider", model: modelName, source };
68
69
  const apiKey = explicitApiKey ?? (provider === "openai" ? openaiApiKey : void 0);
69
- if (!apiKey && !c.allowKeylessModel) {
70
+ const apiKeyEnv = apiKey ? null : trimOrNull(c.apiKeyEnv);
71
+ if (!apiKey && !apiKeyEnv && !c.allowKeylessModel) {
70
72
  return { succeeded: false, error: "no_api_key", model: modelName, provider, source };
71
73
  }
72
74
  return {
@@ -74,7 +76,7 @@ function resolveModelSelection(config, override) {
74
76
  value: {
75
77
  model: modelName,
76
78
  provider,
77
- ...apiKey ? { apiKey } : {},
79
+ ...apiKey ? { apiKey } : apiKeyEnv ? { apiKeyEnv } : {},
78
80
  ...explicitBaseUrl ? { baseUrl: explicitBaseUrl } : {}
79
81
  }
80
82
  };
@@ -3343,4 +3345,4 @@ export {
3343
3345
  isTerminalPromptEvent,
3344
3346
  detectInteractiveQuestion
3345
3347
  };
3346
- //# sourceMappingURL=chunk-QW4UOEPH.js.map
3348
+ //# sourceMappingURL=chunk-SUIH5B55.js.map