openfox 2.0.56 → 2.0.58

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.
Files changed (41) hide show
  1. package/dist/{auto-config-F5Y6KAQ6.js → auto-config-T5GR2N6X.js} +20 -1
  2. package/dist/{backend-B23GIKKD.js → backend-P3GHHLHJ.js} +2 -2
  3. package/dist/{chat-handler-TVFUXHXP.js → chat-handler-W5D5LKKU.js} +9 -9
  4. package/dist/{chunk-ITN5PD7H.js → chunk-55VITQP3.js} +6 -6
  5. package/dist/{chunk-VZHN46NW.js → chunk-6VDCH5ML.js} +2 -2
  6. package/dist/{chunk-CYJEQF7U.js → chunk-ADOXTORQ.js} +9 -1
  7. package/dist/{chunk-OCILP3SJ.js → chunk-BIWVYBIE.js} +2 -2
  8. package/dist/{chunk-7VFX3QXQ.js → chunk-CFLGVCYT.js} +7 -7
  9. package/dist/{chunk-4566MTWM.js → chunk-GJU35MDV.js} +2 -2
  10. package/dist/{chunk-R2QCDYYR.js → chunk-H774GQJW.js} +53 -2
  11. package/dist/{chunk-ZZLCX7YT.js → chunk-JKLPWTUN.js} +2 -2
  12. package/dist/{chunk-H5YF6DVQ.js → chunk-LAWUUAN7.js} +15 -14
  13. package/dist/{chunk-UOKVBO67.js → chunk-NVPVDDQZ.js} +2 -2
  14. package/dist/{chunk-YVRGXDIX.js → chunk-UDZNMYWN.js} +82 -49
  15. package/dist/{chunk-4R6YPRLX.js → chunk-XR2XC7WM.js} +3 -3
  16. package/dist/{chunk-PSJON33Y.js → chunk-YHEQTVFV.js} +7 -1
  17. package/dist/{chunk-QQ5XY6BH.js → chunk-YMEZFRY2.js} +12 -2
  18. package/dist/cli/dev.js +1 -1
  19. package/dist/cli/index.js +1 -1
  20. package/dist/{client-Y3ESMMZA.js → client-KRFGMNGN.js} +3 -3
  21. package/dist/{compactor-ZKZYSNMD.js → compactor-Q33AJPCQ.js} +4 -4
  22. package/dist/{config-5ZHFKWOW.js → config-C2YDEF3N.js} +2 -2
  23. package/dist/{manager-FV4BDEVU.js → manager-CZOVNTSN.js} +3 -3
  24. package/dist/{orchestrator-ZBWWJZPN.js → orchestrator-Q47D6JXG.js} +8 -8
  25. package/dist/package.json +1 -1
  26. package/dist/{processor-KXXQKBQV.js → processor-2YJ33KUH.js} +9 -9
  27. package/dist/{protocol-DRe5K6Id.d.ts → protocol-PSKVUhdN.d.ts} +1 -1
  28. package/dist/{provider-V6Q6WJAF.js → provider-SNXYPSPH.js} +6 -6
  29. package/dist/{provider-manager-PR64DEN2.js → provider-manager-ABEUYU3K.js} +4 -4
  30. package/dist/{serve-QD3KZNSX.js → serve-LOPGRMFP.js} +13 -13
  31. package/dist/server/index.d.ts +3 -3
  32. package/dist/server/index.js +12 -12
  33. package/dist/{server-URL2FOSC.js → server-XUDZRBD3.js} +11 -11
  34. package/dist/shared/index.d.ts +2 -2
  35. package/dist/{store-TTU4UQQ7.js → store-NS2RMRA7.js} +2 -2
  36. package/dist/{tools-3ULXCV6F.js → tools-YJLXW3QS.js} +7 -7
  37. package/dist/web/assets/{index-CvIUuius.css → index-DjfRXOO7.css} +1 -1
  38. package/dist/web/assets/{index-CRW5qofP.js → index-Dqqp_j-f.js} +71 -71
  39. package/dist/web/index.html +2 -2
  40. package/dist/web/sw.js +1 -1
  41. package/package.json +1 -1
@@ -44,6 +44,9 @@ async function detectModelInfo(baseUrl, apiKey, backend, modelId) {
44
44
  if (backend === "llamacpp") {
45
45
  return await detectLlamacppInfo(baseUrl);
46
46
  }
47
+ if (backend === "lmstudio") {
48
+ return await detectLmstudioInfo(baseUrl, modelId);
49
+ }
47
50
  return await detectVllmInfo(baseUrl, apiKey, modelId);
48
51
  } catch {
49
52
  return { contextWindow: 2e5, source: "default", supportsVision: false };
@@ -90,6 +93,22 @@ async function detectOllamaInfo(baseUrl, modelId) {
90
93
  }
91
94
  throw new Error("No context_length in model_info");
92
95
  }
96
+ async function detectLmstudioInfo(baseUrl, modelId) {
97
+ const base = baseUrl.replace(/\/+$/, "");
98
+ const nativeUrl = `${base.replace(/\/v\d+\/?$/, "")}/api/v1/models`;
99
+ const response = await fetch(nativeUrl, { signal: AbortSignal.timeout(5e3) });
100
+ if (!response.ok) throw new Error(`HTTP ${response.status}`);
101
+ const data = await response.json();
102
+ const model = data.find((m) => (m.key ?? m.id) === modelId);
103
+ if (!model) throw new Error(`Model ${modelId} not found in LM Studio`);
104
+ const loadedContext = model.loaded_instances?.[0]?.config?.context_length;
105
+ const ctxLen = loadedContext ?? model.max_context_length;
106
+ const supportsVision = model.capabilities?.vision ?? false;
107
+ if (ctxLen) {
108
+ return { contextWindow: ctxLen, source: "backend", supportsVision };
109
+ }
110
+ throw new Error("No context_length in LM Studio response");
111
+ }
93
112
  async function probeCombo(baseUrl, apiKey, model, combo, signal) {
94
113
  const headers = { "Content-Type": "application/json" };
95
114
  if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
@@ -167,4 +186,4 @@ async function autoConfig(input) {
167
186
  export {
168
187
  autoConfig
169
188
  };
170
- //# sourceMappingURL=auto-config-F5Y6KAQ6.js.map
189
+ //# sourceMappingURL=auto-config-T5GR2N6X.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getBackendCapabilities,
3
3
  getBackendDisplayName
4
- } from "./chunk-PSJON33Y.js";
4
+ } from "./chunk-YHEQTVFV.js";
5
5
  import "./chunk-5WRI5ZAA.js";
6
6
  export {
7
7
  getBackendCapabilities,
8
8
  getBackendDisplayName
9
9
  };
10
- //# sourceMappingURL=backend-B23GIKKD.js.map
10
+ //# sourceMappingURL=backend-P3GHHLHJ.js.map
@@ -2,14 +2,14 @@ import {
2
2
  buildRunChatTurnParams,
3
3
  finalizeTurnCompletion,
4
4
  generateSessionNameForSession
5
- } from "./chunk-UOKVBO67.js";
5
+ } from "./chunk-NVPVDDQZ.js";
6
6
  import {
7
7
  runChatTurn
8
- } from "./chunk-4R6YPRLX.js";
9
- import "./chunk-H5YF6DVQ.js";
8
+ } from "./chunk-XR2XC7WM.js";
9
+ import "./chunk-LAWUUAN7.js";
10
10
  import "./chunk-LBGHZLLH.js";
11
- import "./chunk-OCILP3SJ.js";
12
- import "./chunk-CYJEQF7U.js";
11
+ import "./chunk-BIWVYBIE.js";
12
+ import "./chunk-ADOXTORQ.js";
13
13
  import "./chunk-NWO6GRYE.js";
14
14
  import {
15
15
  createChatMessageMessage,
@@ -19,18 +19,18 @@ import {
19
19
  import "./chunk-EU3WWTFH.js";
20
20
  import "./chunk-CDRQJDSJ.js";
21
21
  import "./chunk-YQ3SOPBI.js";
22
- import "./chunk-VZHN46NW.js";
22
+ import "./chunk-6VDCH5ML.js";
23
23
  import {
24
24
  getEventStore
25
25
  } from "./chunk-AIJE3RYH.js";
26
26
  import "./chunk-TMUBLQFC.js";
27
27
  import "./chunk-ZPIZLTWU.js";
28
28
  import "./chunk-J2GP3J3X.js";
29
- import "./chunk-PSJON33Y.js";
29
+ import "./chunk-YHEQTVFV.js";
30
30
  import "./chunk-Z6W4YHJB.js";
31
31
  import "./chunk-K44MW7JJ.js";
32
32
  import "./chunk-YD6NDTKF.js";
33
- import "./chunk-QQ5XY6BH.js";
33
+ import "./chunk-YMEZFRY2.js";
34
34
  import "./chunk-CQGTEGKL.js";
35
35
  import "./chunk-V4IE7HJY.js";
36
36
  import "./chunk-5WRI5ZAA.js";
@@ -154,4 +154,4 @@ export {
154
154
  startChatSession,
155
155
  stopSessionExecution
156
156
  };
157
- //# sourceMappingURL=chat-handler-TVFUXHXP.js.map
157
+ //# sourceMappingURL=chat-handler-W5D5LKKU.js.map
@@ -39,7 +39,7 @@ Options:
39
39
  }
40
40
  async function runNetworkSetup(mode) {
41
41
  const { loadAuthConfig, saveAuthConfig, encryptPassword } = await import("./auth-YY5PJYSC.js");
42
- const { saveGlobalConfig } = await import("./config-5ZHFKWOW.js");
42
+ const { saveGlobalConfig } = await import("./config-C2YDEF3N.js");
43
43
  const { getAuthKeyPath } = await import("./paths-F27V3S4I.js");
44
44
  const existingAuth = await loadAuthConfig(mode);
45
45
  if (existingAuth) {
@@ -106,7 +106,7 @@ async function runNetworkSetup(mode) {
106
106
  console.log("\u2713 Configuration saved!\n");
107
107
  }
108
108
  async function runConfig(mode) {
109
- const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-5ZHFKWOW.js");
109
+ const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-C2YDEF3N.js");
110
110
  const { getGlobalConfigPath } = await import("./paths-F27V3S4I.js");
111
111
  const config = await loadGlobalConfig(mode);
112
112
  const configPath = getGlobalConfigPath(mode);
@@ -164,7 +164,7 @@ async function runCli(options) {
164
164
  break;
165
165
  }
166
166
  case "provider": {
167
- const { runProviderCommand } = await import("./provider-V6Q6WJAF.js");
167
+ const { runProviderCommand } = await import("./provider-SNXYPSPH.js");
168
168
  const [, subcommand] = positionals;
169
169
  await runProviderCommand(mode, subcommand);
170
170
  break;
@@ -203,12 +203,12 @@ async function runCli(options) {
203
203
  break;
204
204
  }
205
205
  default: {
206
- const { configFileExists } = await import("./config-5ZHFKWOW.js");
206
+ const { configFileExists } = await import("./config-C2YDEF3N.js");
207
207
  const configExists = await configFileExists(mode);
208
208
  if (!configExists) {
209
209
  await runNetworkSetup(mode);
210
210
  }
211
- const { runServe } = await import("./serve-QD3KZNSX.js");
211
+ const { runServe } = await import("./serve-LOPGRMFP.js");
212
212
  const serveOptions = { mode };
213
213
  if (values.port) serveOptions.port = parseInt(values.port);
214
214
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -220,4 +220,4 @@ async function runCli(options) {
220
220
  export {
221
221
  runCli
222
222
  };
223
- //# sourceMappingURL=chunk-ITN5PD7H.js.map
223
+ //# sourceMappingURL=chunk-55VITQP3.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-J2GP3J3X.js";
4
4
  import {
5
5
  getBackendCapabilities
6
- } from "./chunk-PSJON33Y.js";
6
+ } from "./chunk-YHEQTVFV.js";
7
7
  import {
8
8
  buildModelParams
9
9
  } from "./chunk-Z6W4YHJB.js";
@@ -705,4 +705,4 @@ export {
705
705
  createChatDoneEvent,
706
706
  consumeStreamGenerator
707
707
  };
708
- //# sourceMappingURL=chunk-VZHN46NW.js.map
708
+ //# sourceMappingURL=chunk-6VDCH5ML.js.map
@@ -70,6 +70,14 @@ async function terminateProcessTree(proc, options) {
70
70
  if (!pid || options?.exited?.()) {
71
71
  return;
72
72
  }
73
+ if (options?.immediate) {
74
+ const allPids = await getDescendantPids(pid);
75
+ allPids.push(pid);
76
+ for (const p of allPids) {
77
+ killProcess(p, "SIGKILL");
78
+ }
79
+ return;
80
+ }
73
81
  await killProcessTree(pid);
74
82
  }
75
83
 
@@ -216,4 +224,4 @@ export {
216
224
  getProcessById,
217
225
  cleanupAllProcesses
218
226
  };
219
- //# sourceMappingURL=chunk-CYJEQF7U.js.map
227
+ //# sourceMappingURL=chunk-ADOXTORQ.js.map
@@ -8,7 +8,7 @@ import {
8
8
  removeProcess,
9
9
  startProcess,
10
10
  updateStatus
11
- } from "./chunk-CYJEQF7U.js";
11
+ } from "./chunk-ADOXTORQ.js";
12
12
 
13
13
  // src/server/tools/background-process/manager.ts
14
14
  import { spawn } from "child_process";
@@ -153,4 +153,4 @@ export {
153
153
  getSessionProcesses2 as getSessionProcesses,
154
154
  getProcessLogs
155
155
  };
156
- //# sourceMappingURL=chunk-OCILP3SJ.js.map
156
+ //# sourceMappingURL=chunk-BIWVYBIE.js.map
@@ -2,7 +2,7 @@ import {
2
2
  injectWorkflowKickoffIfNeeded,
3
3
  runAgentTurn,
4
4
  runChatTurn
5
- } from "./chunk-4R6YPRLX.js";
5
+ } from "./chunk-XR2XC7WM.js";
6
6
  import {
7
7
  applyDynamicContext,
8
8
  checkAborted,
@@ -16,11 +16,11 @@ import {
16
16
  loadAllAgentsDefault,
17
17
  saveItemToDir,
18
18
  spawnShellProcess
19
- } from "./chunk-H5YF6DVQ.js";
19
+ } from "./chunk-LAWUUAN7.js";
20
20
  import {
21
21
  getPlatformShell,
22
22
  onProcessEvent
23
- } from "./chunk-OCILP3SJ.js";
23
+ } from "./chunk-BIWVYBIE.js";
24
24
  import {
25
25
  createChatErrorMessage,
26
26
  createChatMessageMessage,
@@ -40,11 +40,11 @@ import {
40
40
  } from "./chunk-EU3WWTFH.js";
41
41
  import {
42
42
  appendCompactionPrompt
43
- } from "./chunk-4566MTWM.js";
43
+ } from "./chunk-GJU35MDV.js";
44
44
  import {
45
45
  TurnMetrics,
46
46
  createMessageStartEvent
47
- } from "./chunk-VZHN46NW.js";
47
+ } from "./chunk-6VDCH5ML.js";
48
48
  import {
49
49
  getCurrentContextWindowId,
50
50
  getEventStore,
@@ -52,7 +52,7 @@ import {
52
52
  } from "./chunk-AIJE3RYH.js";
53
53
  import {
54
54
  createLLMClient
55
- } from "./chunk-ZZLCX7YT.js";
55
+ } from "./chunk-JKLPWTUN.js";
56
56
  import {
57
57
  ensureVersionPrefix
58
58
  } from "./chunk-HNCM3D7Y.js";
@@ -2091,4 +2091,4 @@ export {
2091
2091
  signalMcpReady,
2092
2092
  createWebSocketServer
2093
2093
  };
2094
- //# sourceMappingURL=chunk-7VFX3QXQ.js.map
2094
+ //# sourceMappingURL=chunk-CFLGVCYT.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  COMPACTION_PROMPT,
3
3
  createMessageStartEvent
4
- } from "./chunk-VZHN46NW.js";
4
+ } from "./chunk-6VDCH5ML.js";
5
5
  import {
6
6
  getCurrentWindowMessageOptions
7
7
  } from "./chunk-AIJE3RYH.js";
@@ -31,4 +31,4 @@ export {
31
31
  shouldCompact,
32
32
  getCompactionTarget
33
33
  };
34
- //# sourceMappingURL=chunk-4566MTWM.js.map
34
+ //# sourceMappingURL=chunk-GJU35MDV.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-M3RB4IF6.js";
4
4
  import {
5
5
  createLLMClient
6
- } from "./chunk-ZZLCX7YT.js";
6
+ } from "./chunk-JKLPWTUN.js";
7
7
  import {
8
8
  buildModelsUrl,
9
9
  ensureVersionPrefix,
@@ -82,6 +82,12 @@ async function fetchModelsWithContext(baseUrl, apiKey, backend) {
82
82
  logger.info("Fetching Ollama models via /api/tags and /api/show");
83
83
  return fetchOllamaModelsWithContext(baseUrl, apiKey);
84
84
  }
85
+ if (backend === "lmstudio") {
86
+ logger.info("Fetching LM Studio models via /api/v1/models");
87
+ const lmStudioModels = await fetchLmStudioModelsWithContext(baseUrl, apiKey);
88
+ if (lmStudioModels.length > 0) return lmStudioModels;
89
+ logger.info("LM Studio native endpoint unavailable, falling back to /v1/models");
90
+ }
85
91
  const isOpenCodeGo = baseUrl.includes("opencode.ai/zen/go");
86
92
  const url = isOpenCodeGo ? buildModelsUrl(baseUrl.replace("/zen/go", "/zen")) : buildModelsUrl(baseUrl);
87
93
  logger.info("Fetching models via /v1/models", { url });
@@ -154,6 +160,51 @@ async function fetchOllamaModelsWithContext(baseUrl, _apiKey) {
154
160
  return [];
155
161
  }
156
162
  }
163
+ async function fetchLmStudioModelsWithContext(baseUrl, _apiKey) {
164
+ const base = baseUrl.replace(/\/+$/, "");
165
+ const nativeUrl = `${base.replace(/\/v\d+\/?$/, "")}/api/v1/models`;
166
+ try {
167
+ logger.info("Fetching LM Studio native models", { url: nativeUrl });
168
+ const response = await fetch(nativeUrl, {
169
+ signal: AbortSignal.timeout(1e4)
170
+ });
171
+ if (!response.ok) {
172
+ logger.info("LM Studio native endpoint returned error", { url: nativeUrl, status: response.status });
173
+ return [];
174
+ }
175
+ const raw = await response.json();
176
+ const rawArray = Array.isArray(raw) ? raw : Array.isArray(raw.models) ? raw.models : Array.isArray(raw.data) ? raw.data : [];
177
+ const modelList = rawArray;
178
+ if (modelList.length === 0) {
179
+ logger.info("LM Studio native endpoint returned no models", { url: nativeUrl });
180
+ return [];
181
+ }
182
+ logger.info("LM Studio native models found", { count: modelList.length });
183
+ return modelList.map((model) => {
184
+ const modelId = model.key ?? model.id ?? "";
185
+ const loadedContext = model.loaded_instances?.[0]?.config?.context_length;
186
+ const maxContext = model.max_context_length;
187
+ const contextWindow = loadedContext ?? maxContext ?? 2e5;
188
+ logger.info("LM Studio model detected", {
189
+ modelId,
190
+ loadedContext,
191
+ maxContext,
192
+ contextWindow
193
+ });
194
+ return {
195
+ id: modelId,
196
+ contextWindow,
197
+ source: loadedContext || maxContext ? "backend" : "default"
198
+ };
199
+ });
200
+ } catch (error) {
201
+ logger.info("Error fetching LM Studio native models", {
202
+ url: nativeUrl,
203
+ error: error instanceof Error ? error.message : String(error)
204
+ });
205
+ return [];
206
+ }
207
+ }
157
208
  function parseDefaultModelSelection(selection) {
158
209
  if (!selection) return { providerId: void 0, model: void 0 };
159
210
  const slashIndex = selection.indexOf("/");
@@ -551,4 +602,4 @@ export {
551
602
  parseDefaultModelSelection,
552
603
  createProviderManager
553
604
  };
554
- //# sourceMappingURL=chunk-R2QCDYYR.js.map
605
+ //# sourceMappingURL=chunk-H774GQJW.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getBackendCapabilities
3
- } from "./chunk-PSJON33Y.js";
3
+ } from "./chunk-YHEQTVFV.js";
4
4
  import {
5
5
  ensureVersionPrefix
6
6
  } from "./chunk-HNCM3D7Y.js";
@@ -259,4 +259,4 @@ function createLLMClient(config, initialBackend = "unknown") {
259
259
  export {
260
260
  createLLMClient
261
261
  };
262
- //# sourceMappingURL=chunk-ZZLCX7YT.js.map
262
+ //# sourceMappingURL=chunk-JKLPWTUN.js.map
@@ -9,12 +9,12 @@ import {
9
9
  getSessionProcesses,
10
10
  startProcessCommand,
11
11
  stopProcess
12
- } from "./chunk-OCILP3SJ.js";
12
+ } from "./chunk-BIWVYBIE.js";
13
13
  import {
14
14
  getMaxPerSession,
15
15
  getSessionProcessCount,
16
16
  terminateProcessTree
17
- } from "./chunk-CYJEQF7U.js";
17
+ } from "./chunk-ADOXTORQ.js";
18
18
  import {
19
19
  createMcpTools
20
20
  } from "./chunk-NWO6GRYE.js";
@@ -50,7 +50,7 @@ import {
50
50
  createToolCallEvent,
51
51
  createToolResultEvent,
52
52
  streamLLMPure
53
- } from "./chunk-VZHN46NW.js";
53
+ } from "./chunk-6VDCH5ML.js";
54
54
  import {
55
55
  getCurrentContextWindowId,
56
56
  getCurrentWindowMessageOptions,
@@ -73,7 +73,7 @@ import {
73
73
  import {
74
74
  loadGlobalConfig,
75
75
  saveGlobalConfig
76
- } from "./chunk-QQ5XY6BH.js";
76
+ } from "./chunk-YMEZFRY2.js";
77
77
  import {
78
78
  getGlobalConfigDir
79
79
  } from "./chunk-CQGTEGKL.js";
@@ -1463,7 +1463,7 @@ function executeCommand(command, cwd, timeout, signal, onProgress) {
1463
1463
  const onAbort = () => {
1464
1464
  if (!timedOut && !aborted) {
1465
1465
  aborted = true;
1466
- void terminateProcessTree(proc, { exited: () => exited });
1466
+ void terminateProcessTree(proc, { exited: () => exited, immediate: true });
1467
1467
  }
1468
1468
  };
1469
1469
  signal?.addEventListener("abort", onAbort);
@@ -2417,12 +2417,13 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
2417
2417
  ...instructionContent2 ? { customInstructions: instructionContent2 } : {},
2418
2418
  ...skills2.length > 0 ? { skills: skills2 } : {}
2419
2419
  });
2420
+ const modelSettings2 = sessionManager.getCurrentModelSettings(sessionId);
2420
2421
  await llmClient.complete({
2421
2422
  messages: [{ role: "system", content: assembledRequest2.systemPrompt }],
2422
2423
  tools: assembledRequest2.tools,
2423
2424
  maxTokens: 1,
2424
2425
  temperature: 0,
2425
- skipClientReasoningEffort: true
2426
+ ...modelSettings2 ? { modelSettings: modelSettings2 } : {}
2426
2427
  });
2427
2428
  return {};
2428
2429
  }
@@ -2481,7 +2482,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
2481
2482
  const previousContextTokens = contextState.currentTokens;
2482
2483
  const contextWindow = sessionManager.getCurrentModelContext();
2483
2484
  const availableForOutput = Math.max(256, contextWindow - contextState.currentTokens);
2484
- let modelSettings = currentMaxTokensOverride !== void 0 ? { ...sessionManager.getCurrentModelSettings(), maxTokens: currentMaxTokensOverride } : sessionManager.getCurrentModelSettings();
2485
+ let modelSettings = currentMaxTokensOverride !== void 0 ? { ...sessionManager.getCurrentModelSettings(sessionId), maxTokens: currentMaxTokensOverride } : sessionManager.getCurrentModelSettings(sessionId);
2485
2486
  if (modelSettings) {
2486
2487
  const requestedMaxTokens = modelSettings.maxTokens ?? 16384;
2487
2488
  modelSettings = { ...modelSettings, maxTokens: Math.min(requestedMaxTokens, availableForOutput) };
@@ -2552,7 +2553,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
2552
2553
  sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens);
2553
2554
  if (!compacting) {
2554
2555
  const contextState2 = sessionManager.getContextState(sessionId);
2555
- const { shouldCompact, appendCompactionPrompt } = await import("./compactor-ZKZYSNMD.js");
2556
+ const { shouldCompact, appendCompactionPrompt } = await import("./compactor-Q33AJPCQ.js");
2556
2557
  if (shouldCompact(contextState2.currentTokens, contextState2.maxTokens, runtimeConfig.context.compactionThreshold)) {
2557
2558
  appendCompactionPrompt(sessionId, append);
2558
2559
  compacting = true;
@@ -2909,7 +2910,7 @@ async function describeImageFromDataUrl(dataUrl, visionModel, options) {
2909
2910
  import { createHash as createHash2 } from "crypto";
2910
2911
  async function loadVisionModelFromGlobalConfig() {
2911
2912
  try {
2912
- const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-5ZHFKWOW.js");
2913
+ const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-C2YDEF3N.js");
2913
2914
  const runtimeConfig = getRuntimeConfig();
2914
2915
  const mode = runtimeConfig.mode ?? "production";
2915
2916
  const globalConfig = await loadGlobalConfig2(mode);
@@ -3424,7 +3425,7 @@ var callSubAgentTool = {
3424
3425
  };
3425
3426
  }
3426
3427
  try {
3427
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-3ULXCV6F.js");
3428
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-YJLXW3QS.js");
3428
3429
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3429
3430
  const turnMetrics = new TurnMetrics();
3430
3431
  const result = await executeSubAgent({
@@ -4240,7 +4241,7 @@ function resolveAgentDef2(sessionManager, sessionId) {
4240
4241
  }
4241
4242
  async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
4242
4243
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
4243
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-3ULXCV6F.js");
4244
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-YJLXW3QS.js");
4244
4245
  const tools = getToolRegistryForAgent2(agentDef).definitions;
4245
4246
  const toolFingerprint = getToolFingerprint(tools);
4246
4247
  const allAgents = await loadAllAgentsDefault();
@@ -4253,7 +4254,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
4253
4254
  async function computeSessionHash(sessionManager, sessionId) {
4254
4255
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
4255
4256
  const agentDef = await resolveAgentDef2(sessionManager, sessionId);
4256
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-3ULXCV6F.js");
4257
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-YJLXW3QS.js");
4257
4258
  const tools = getToolRegistryForAgent2(agentDef).definitions;
4258
4259
  const toolFingerprint = getToolFingerprint(tools);
4259
4260
  return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
@@ -4360,7 +4361,7 @@ var mcpConfigTool = createTool(
4360
4361
  await saveGlobalConfig(mcpConfigMode, { ...globalConfig, mcpServers: updated });
4361
4362
  }
4362
4363
  async function rebuildTools() {
4363
- const { setMcpTools: setMcpTools2 } = await import("./tools-3ULXCV6F.js");
4364
+ const { setMcpTools: setMcpTools2 } = await import("./tools-YJLXW3QS.js");
4364
4365
  const mcpTools = createMcpTools(mcpManagerForTools);
4365
4366
  setMcpTools2(mcpTools);
4366
4367
  }
@@ -5030,4 +5031,4 @@ export {
5030
5031
  getToolRegistryForAgent,
5031
5032
  createToolRegistry
5032
5033
  };
5033
- //# sourceMappingURL=chunk-H5YF6DVQ.js.map
5034
+ //# sourceMappingURL=chunk-LAWUUAN7.js.map
@@ -131,7 +131,7 @@ async function generateSessionNameForSession(sessionId, userMessage, deps, signa
131
131
  client = deps.getLLMClient();
132
132
  client.setModel(providerConfig.model);
133
133
  } else if (providerConfig) {
134
- const { createLLMClient } = await import("./client-Y3ESMMZA.js");
134
+ const { createLLMClient } = await import("./client-KRFGMNGN.js");
135
135
  client = createLLMClient({
136
136
  llm: {
137
137
  baseUrl: providerConfig.baseUrl,
@@ -180,4 +180,4 @@ export {
180
180
  buildRunChatTurnParams,
181
181
  generateSessionNameForSession
182
182
  };
183
- //# sourceMappingURL=chunk-UOKVBO67.js.map
183
+ //# sourceMappingURL=chunk-NVPVDDQZ.js.map