openfox 2.0.52 → 2.0.54

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.
@@ -5,11 +5,11 @@ import {
5
5
  } from "./chunk-UOKVBO67.js";
6
6
  import {
7
7
  runChatTurn
8
- } from "./chunk-N3Z4SMEH.js";
9
- import "./chunk-3KVWOPRN.js";
8
+ } from "./chunk-VCT4DBJC.js";
9
+ import "./chunk-55LI67AH.js";
10
10
  import "./chunk-LBGHZLLH.js";
11
- import "./chunk-PBGOZMVY.js";
12
- import "./chunk-VRGRAQDG.js";
11
+ import "./chunk-OCILP3SJ.js";
12
+ import "./chunk-CYJEQF7U.js";
13
13
  import "./chunk-NWO6GRYE.js";
14
14
  import {
15
15
  createChatMessageMessage,
@@ -154,4 +154,4 @@ export {
154
154
  startChatSession,
155
155
  stopSessionExecution
156
156
  };
157
- //# sourceMappingURL=chat-handler-FGRCJX76.js.map
157
+ //# sourceMappingURL=chat-handler-SEMT4SD5.js.map
@@ -9,11 +9,12 @@ import {
9
9
  getSessionProcesses,
10
10
  startProcessCommand,
11
11
  stopProcess
12
- } from "./chunk-PBGOZMVY.js";
12
+ } from "./chunk-OCILP3SJ.js";
13
13
  import {
14
14
  getMaxPerSession,
15
- getSessionProcessCount
16
- } from "./chunk-VRGRAQDG.js";
15
+ getSessionProcessCount,
16
+ terminateProcessTree
17
+ } from "./chunk-CYJEQF7U.js";
17
18
  import {
18
19
  createMcpTools
19
20
  } from "./chunk-NWO6GRYE.js";
@@ -1356,41 +1357,6 @@ function spawnShellProcess(command, cwd, _signal, detached = false) {
1356
1357
  });
1357
1358
  }
1358
1359
 
1359
- // src/server/utils/process-tree.ts
1360
- import { spawn as spawn2 } from "child_process";
1361
- import { setTimeout as sleep } from "timers/promises";
1362
- var SIGKILL_TIMEOUT_MS = 200;
1363
- async function terminateProcessTree(proc, options) {
1364
- const pid = proc.pid;
1365
- if (!pid || options?.exited?.()) {
1366
- return;
1367
- }
1368
- if (process.platform === "win32") {
1369
- await new Promise((resolve6) => {
1370
- const killer = spawn2("taskkill", ["/pid", String(pid), "/f", "/t"], {
1371
- stdio: "ignore",
1372
- windowsHide: true
1373
- });
1374
- killer.once("exit", () => resolve6());
1375
- killer.once("error", () => resolve6());
1376
- });
1377
- return;
1378
- }
1379
- try {
1380
- process.kill(-pid, "SIGTERM");
1381
- await sleep(SIGKILL_TIMEOUT_MS);
1382
- if (!options?.exited?.()) {
1383
- process.kill(-pid, "SIGKILL");
1384
- }
1385
- } catch {
1386
- proc.kill("SIGTERM");
1387
- await sleep(SIGKILL_TIMEOUT_MS);
1388
- if (!options?.exited?.()) {
1389
- proc.kill("SIGKILL");
1390
- }
1391
- }
1392
- }
1393
-
1394
1360
  // src/server/tools/shell-tail.ts
1395
1361
  var TAIL_END_RE = /^(.*?)\s*\|\s*tail\s+(?:-n\s+)?-?(\d+)\s*$/;
1396
1362
  function stripTailPipe(command) {
@@ -3481,7 +3447,7 @@ var callSubAgentTool = {
3481
3447
  };
3482
3448
  }
3483
3449
  try {
3484
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-2QMJFAXE.js");
3450
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-NGAV5NZF.js");
3485
3451
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3486
3452
  const turnMetrics = new TurnMetrics();
3487
3453
  const result = await executeSubAgent({
@@ -3731,7 +3697,7 @@ var webFetchTool = createTool(
3731
3697
  );
3732
3698
 
3733
3699
  // src/server/dev-server/manager.ts
3734
- import { spawn as spawn3 } from "child_process";
3700
+ import { spawn as spawn2 } from "child_process";
3735
3701
  import { readFile as readFile7, writeFile as writeFile6, mkdir as mkdir5 } from "fs/promises";
3736
3702
  import { resolve as resolve5, join as join7 } from "path";
3737
3703
  var MAX_LOG_LINES = 2e3;
@@ -3845,7 +3811,7 @@ var DevServerManager = class {
3845
3811
  }
3846
3812
  const resolved = this.resolveWorkdir(workdir);
3847
3813
  const shell = getPlatformShell();
3848
- const proc = spawn3(shell.command, [...shell.args, config.command], {
3814
+ const proc = spawn2(shell.command, [...shell.args, config.command], {
3849
3815
  cwd: resolved,
3850
3816
  env: { ...process.env, FORCE_COLOR: "1" },
3851
3817
  stdio: ["ignore", "pipe", "pipe"],
@@ -4297,7 +4263,7 @@ function resolveAgentDef2(sessionManager, sessionId) {
4297
4263
  }
4298
4264
  async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
4299
4265
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
4300
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-2QMJFAXE.js");
4266
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-NGAV5NZF.js");
4301
4267
  const tools = getToolRegistryForAgent2(agentDef).definitions;
4302
4268
  const toolFingerprint = getToolFingerprint(tools);
4303
4269
  const allAgents = await loadAllAgentsDefault();
@@ -4310,7 +4276,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
4310
4276
  async function computeSessionHash(sessionManager, sessionId) {
4311
4277
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
4312
4278
  const agentDef = await resolveAgentDef2(sessionManager, sessionId);
4313
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-2QMJFAXE.js");
4279
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-NGAV5NZF.js");
4314
4280
  const tools = getToolRegistryForAgent2(agentDef).definitions;
4315
4281
  const toolFingerprint = getToolFingerprint(tools);
4316
4282
  return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
@@ -4417,7 +4383,7 @@ var mcpConfigTool = createTool(
4417
4383
  await saveGlobalConfig(mcpConfigMode, { ...globalConfig, mcpServers: updated });
4418
4384
  }
4419
4385
  async function rebuildTools() {
4420
- const { setMcpTools: setMcpTools2 } = await import("./tools-2QMJFAXE.js");
4386
+ const { setMcpTools: setMcpTools2 } = await import("./tools-NGAV5NZF.js");
4421
4387
  const mcpTools = createMcpTools(mcpManagerForTools);
4422
4388
  setMcpTools2(mcpTools);
4423
4389
  }
@@ -5087,4 +5053,4 @@ export {
5087
5053
  getToolRegistryForAgent,
5088
5054
  createToolRegistry
5089
5055
  };
5090
- //# sourceMappingURL=chunk-3KVWOPRN.js.map
5056
+ //# sourceMappingURL=chunk-55LI67AH.js.map
@@ -1,3 +1,78 @@
1
+ // src/server/utils/process-tree.ts
2
+ import { spawn, execFile } from "child_process";
3
+ import { setTimeout as sleep } from "timers/promises";
4
+ var SIGKILL_TIMEOUT_MS = 200;
5
+ async function getDescendantPids(rootPid) {
6
+ try {
7
+ const { stdout } = await new Promise((resolve, reject) => {
8
+ execFile("ps", ["-eo", "pid=,ppid="], { timeout: 5e3 }, (err, stdout2) => {
9
+ if (err) reject(err);
10
+ else resolve({ stdout: stdout2 });
11
+ });
12
+ });
13
+ const children = /* @__PURE__ */ new Map();
14
+ for (const line of stdout.trim().split("\n")) {
15
+ const parts = line.trim().split(/\s+/);
16
+ const pid = parseInt(parts[0], 10);
17
+ const ppid = parseInt(parts[1], 10);
18
+ if (!isNaN(pid) && !isNaN(ppid) && pid > 0 && ppid >= 0) {
19
+ if (!children.has(ppid)) children.set(ppid, []);
20
+ children.get(ppid).push(pid);
21
+ }
22
+ }
23
+ const descendants = [];
24
+ const queue = [rootPid];
25
+ while (queue.length > 0) {
26
+ const current = queue.shift();
27
+ const kids = children.get(current);
28
+ if (kids) {
29
+ for (const kid of kids) {
30
+ descendants.push(kid);
31
+ queue.push(kid);
32
+ }
33
+ }
34
+ }
35
+ return descendants;
36
+ } catch {
37
+ return [];
38
+ }
39
+ }
40
+ function killProcess(pid, signal) {
41
+ try {
42
+ process.kill(pid, signal);
43
+ } catch {
44
+ }
45
+ }
46
+ async function killProcessTree(pid) {
47
+ if (process.platform === "win32") {
48
+ await new Promise((resolve) => {
49
+ const killer = spawn("taskkill", ["/pid", String(pid), "/f", "/t"], {
50
+ stdio: "ignore",
51
+ windowsHide: true
52
+ });
53
+ killer.once("exit", () => resolve());
54
+ killer.once("error", () => resolve());
55
+ });
56
+ return;
57
+ }
58
+ const allPids = await getDescendantPids(pid);
59
+ allPids.push(pid);
60
+ for (const p of allPids) {
61
+ killProcess(p, "SIGTERM");
62
+ }
63
+ await sleep(SIGKILL_TIMEOUT_MS);
64
+ for (const p of allPids) {
65
+ killProcess(p, "SIGKILL");
66
+ }
67
+ }
68
+ async function terminateProcessTree(proc, options) {
69
+ const pid = proc.pid;
70
+ if (!pid || options?.exited?.()) {
71
+ return;
72
+ }
73
+ await killProcessTree(pid);
74
+ }
75
+
1
76
  // src/server/tools/background-process/store.ts
2
77
  var MAX_PER_SESSION = 5;
3
78
  var processesBySession = /* @__PURE__ */ new Map();
@@ -115,14 +190,7 @@ function cleanupAllProcesses() {
115
190
  for (const sessionProcesses of processesBySession.values()) {
116
191
  for (const proc of sessionProcesses.values()) {
117
192
  if (proc.status === "running" && proc.pid) {
118
- try {
119
- process.kill(-proc.pid, "SIGTERM");
120
- } catch {
121
- try {
122
- process.kill(proc.pid, "SIGTERM");
123
- } catch {
124
- }
125
- }
193
+ killProcessTree(proc.pid);
126
194
  }
127
195
  }
128
196
  }
@@ -131,6 +199,8 @@ function cleanupAllProcesses() {
131
199
  }
132
200
 
133
201
  export {
202
+ killProcessTree,
203
+ terminateProcessTree,
134
204
  getMaxPerSession,
135
205
  getProcess,
136
206
  getSessionProcesses,
@@ -146,4 +216,4 @@ export {
146
216
  getProcessById,
147
217
  cleanupAllProcesses
148
218
  };
149
- //# sourceMappingURL=chunk-VRGRAQDG.js.map
219
+ //# sourceMappingURL=chunk-CYJEQF7U.js.map
@@ -208,7 +208,7 @@ async function runCli(options) {
208
208
  if (!configExists) {
209
209
  await runNetworkSetup(mode);
210
210
  }
211
- const { runServe } = await import("./serve-J4V6KLQ6.js");
211
+ const { runServe } = await import("./serve-ZZ2IGSZK.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-UOUQMYRJ.js.map
223
+ //# sourceMappingURL=chunk-GFAKHMIJ.js.map
@@ -21,7 +21,7 @@ import {
21
21
  tokenFromPassword,
22
22
  verifyPassword,
23
23
  workflowExists
24
- } from "./chunk-HVLNOTRE.js";
24
+ } from "./chunk-KPKQNJAG.js";
25
25
  import {
26
26
  agentExists,
27
27
  createToolRegistry,
@@ -61,11 +61,11 @@ import {
61
61
  setMcpTools,
62
62
  setNotifyMcpServersChanged,
63
63
  skillExists
64
- } from "./chunk-3KVWOPRN.js";
64
+ } from "./chunk-55LI67AH.js";
65
65
  import {
66
66
  getPathSeparator,
67
67
  isAbsolutePath
68
- } from "./chunk-PBGOZMVY.js";
68
+ } from "./chunk-OCILP3SJ.js";
69
69
  import {
70
70
  createMcpTools
71
71
  } from "./chunk-NWO6GRYE.js";
@@ -3849,7 +3849,7 @@ import { Router as Router7 } from "express";
3849
3849
  import { spawn as spawn2 } from "child_process";
3850
3850
 
3851
3851
  // src/constants.ts
3852
- var VERSION = "2.0.52";
3852
+ var VERSION = "2.0.54";
3853
3853
 
3854
3854
  // src/server/routes/auto-update.ts
3855
3855
  var updateInProgress = false;
@@ -3989,11 +3989,15 @@ async function createServerHandle(config4) {
3989
3989
  logger.info("Using configured LLM backend", { backend: getBackendDisplayName(backend) });
3990
3990
  }
3991
3991
  const detected = await detectModel(config4.llm.baseUrl);
3992
- if (detected) {
3992
+ if (detected && !config4.defaultModelSelection) {
3993
3993
  llmClient.setModel(detected);
3994
3994
  if (!useMock) {
3995
3995
  logger.info("Auto-detected LLM model", { model: detected, backend: getBackendDisplayName(backend) });
3996
3996
  }
3997
+ } else if (detected && config4.defaultModelSelection) {
3998
+ if (!useMock) {
3999
+ logger.debug("Skipping auto-detect, using configured model", { model: config4.llm.model });
4000
+ }
3997
4001
  } else {
3998
4002
  if (!useMock) {
3999
4003
  logger.warn("Could not auto-detect model, using config", { model: config4.llm.model });
@@ -4046,7 +4050,7 @@ async function createServerHandle(config4) {
4046
4050
  setMcpTools(mcpTools);
4047
4051
  logger.info("MCP tools registered", { count: mcpTools.length });
4048
4052
  }
4049
- const { signalMcpReady } = await import("./server-ZQ5NGHPD.js");
4053
+ const { signalMcpReady } = await import("./server-GCB67HAC.js");
4050
4054
  signalMcpReady();
4051
4055
  });
4052
4056
  const app = express();
@@ -4239,7 +4243,7 @@ async function createServerHandle(config4) {
4239
4243
  app.get("/api/sessions/:id", async (req, res) => {
4240
4244
  const { getEventStore: getEventStore2 } = await import("./events-52XADT6Y.js");
4241
4245
  const { buildMessagesFromStoredEvents } = await import("./folding-2BGFLV5J.js");
4242
- const { getPendingQuestionsForSession } = await import("./tools-2QMJFAXE.js");
4246
+ const { getPendingQuestionsForSession } = await import("./tools-NGAV5NZF.js");
4243
4247
  const session = sessionManager.getSession(req.params.id);
4244
4248
  if (!session) {
4245
4249
  return res.status(404).json({ error: "Session not found" });
@@ -4258,8 +4262,8 @@ async function createServerHandle(config4) {
4258
4262
  if (!session) {
4259
4263
  return res.status(404).json({ error: "Session not found" });
4260
4264
  }
4261
- const { stopSessionExecution } = await import("./chat-handler-FGRCJX76.js");
4262
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-2QMJFAXE.js");
4265
+ const { stopSessionExecution } = await import("./chat-handler-SEMT4SD5.js");
4266
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-NGAV5NZF.js");
4263
4267
  sessionManager.clearMessageQueue(sessionId);
4264
4268
  stopSessionExecution(sessionId, sessionManager);
4265
4269
  abortSession(sessionId);
@@ -4413,7 +4417,7 @@ async function createServerHandle(config4) {
4413
4417
  if (!callId || approved === void 0) {
4414
4418
  return res.status(400).json({ error: "callId and approved are required" });
4415
4419
  }
4416
- const { providePathConfirmation } = await import("./tools-2QMJFAXE.js");
4420
+ const { providePathConfirmation } = await import("./tools-NGAV5NZF.js");
4417
4421
  const result = providePathConfirmation(callId, approved, alwaysAllow);
4418
4422
  if (!result.found) {
4419
4423
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
@@ -4421,7 +4425,7 @@ async function createServerHandle(config4) {
4421
4425
  const { getEventStore: getEventStore2 } = await import("./events-52XADT6Y.js");
4422
4426
  const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-2BGFLV5J.js");
4423
4427
  const { createSessionStateMessage } = await import("./protocol-CTNE3ANP.js");
4424
- const { getPendingQuestionsForSession } = await import("./tools-2QMJFAXE.js");
4428
+ const { getPendingQuestionsForSession } = await import("./tools-NGAV5NZF.js");
4425
4429
  const eventStore = getEventStore2();
4426
4430
  const events = eventStore.getEvents(sessionId);
4427
4431
  const messages = buildMessagesFromStoredEvents(events);
@@ -4442,7 +4446,7 @@ async function createServerHandle(config4) {
4442
4446
  if (!skip && typeof answer !== "string") {
4443
4447
  return res.status(400).json({ error: "answer is required when not skipping" });
4444
4448
  }
4445
- const { provideAnswer } = await import("./tools-2QMJFAXE.js");
4449
+ const { provideAnswer } = await import("./tools-NGAV5NZF.js");
4446
4450
  const found = provideAnswer(callId, answer ?? "", skip ?? false);
4447
4451
  if (!found) {
4448
4452
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -4478,7 +4482,7 @@ async function createServerHandle(config4) {
4478
4482
  if (sessionManager.isWarmedUp(sessionId)) {
4479
4483
  return res.json({ success: false, reason: "already_warmed" });
4480
4484
  }
4481
- const { runAgentTurn, TurnMetrics } = await import("./orchestrator-5LSO63RB.js");
4485
+ const { runAgentTurn, TurnMetrics } = await import("./orchestrator-NPPNYDJJ.js");
4482
4486
  runAgentTurn(
4483
4487
  {
4484
4488
  sessionManager,
@@ -4521,8 +4525,8 @@ async function createServerHandle(config4) {
4521
4525
  if (!session) {
4522
4526
  return res.status(404).json({ error: "Session not found" });
4523
4527
  }
4524
- const { stopSessionExecution } = await import("./chat-handler-FGRCJX76.js");
4525
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-2QMJFAXE.js");
4528
+ const { stopSessionExecution } = await import("./chat-handler-SEMT4SD5.js");
4529
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-NGAV5NZF.js");
4526
4530
  const queuedMessages = sessionManager.getQueueState(sessionId);
4527
4531
  sessionManager.clearMessageQueue(sessionId);
4528
4532
  stopSessionExecution(sessionId, sessionManager);
@@ -5032,7 +5036,7 @@ async function createServerHandle(config4) {
5032
5036
  });
5033
5037
  async function rebuildMcpTools() {
5034
5038
  const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-MOGEI6TP.js");
5035
- const { setMcpTools: setMcpTools2 } = await import("./tools-2QMJFAXE.js");
5039
+ const { setMcpTools: setMcpTools2 } = await import("./tools-NGAV5NZF.js");
5036
5040
  const mcpTools = createMcpTools2(mcpManager);
5037
5041
  setMcpTools2(mcpTools);
5038
5042
  }
@@ -5191,13 +5195,13 @@ async function createServerHandle(config4) {
5191
5195
  })
5192
5196
  );
5193
5197
  app.get("/api/sessions/:id/background-processes", async (req, res) => {
5194
- const { getSessionProcesses } = await import("./manager-R3EMNOPR.js");
5198
+ const { getSessionProcesses } = await import("./manager-FV4BDEVU.js");
5195
5199
  const sessionId = req.params.id;
5196
5200
  const processes = getSessionProcesses(sessionId);
5197
5201
  res.json({ processes });
5198
5202
  });
5199
5203
  app.post("/api/sessions/:id/background-process/:processId/stop", async (req, res) => {
5200
- const { stopProcess } = await import("./manager-R3EMNOPR.js");
5204
+ const { stopProcess } = await import("./manager-FV4BDEVU.js");
5201
5205
  const sessionId = req.params.id;
5202
5206
  const processId = req.params.processId;
5203
5207
  const session = sessionManager.getSession(sessionId);
@@ -5340,7 +5344,7 @@ async function createServerHandle(config4) {
5340
5344
  const state = sessionManager.getContextState(sessionId);
5341
5345
  wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
5342
5346
  });
5343
- const { QueueProcessor } = await import("./processor-F5FMOPOQ.js");
5347
+ const { QueueProcessor } = await import("./processor-WJQILWUH.js");
5344
5348
  const queueProcessor = new QueueProcessor({
5345
5349
  sessionManager,
5346
5350
  providerManager,
@@ -5383,7 +5387,7 @@ async function createServerHandle(config4) {
5383
5387
  await mcpManager.disconnectAll();
5384
5388
  const { stopAllInspectProxies } = await import("./inspect-proxy-BV25JERQ.js");
5385
5389
  stopAllInspectProxies();
5386
- const { cleanupAllProcesses } = await import("./store-SF7CDOQT.js");
5390
+ const { cleanupAllProcesses } = await import("./store-TTU4UQQ7.js");
5387
5391
  cleanupAllProcesses();
5388
5392
  viteServer?.close();
5389
5393
  for (const client of wss.clients) {
@@ -5415,4 +5419,4 @@ export {
5415
5419
  createServerHandle,
5416
5420
  createServer
5417
5421
  };
5418
- //# sourceMappingURL=chunk-6J4KEDJQ.js.map
5422
+ //# sourceMappingURL=chunk-GGDYDMIC.js.map
@@ -2,7 +2,7 @@ import {
2
2
  injectWorkflowKickoffIfNeeded,
3
3
  runAgentTurn,
4
4
  runChatTurn
5
- } from "./chunk-N3Z4SMEH.js";
5
+ } from "./chunk-VCT4DBJC.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-3KVWOPRN.js";
19
+ } from "./chunk-55LI67AH.js";
20
20
  import {
21
21
  getPlatformShell,
22
22
  onProcessEvent
23
- } from "./chunk-PBGOZMVY.js";
23
+ } from "./chunk-OCILP3SJ.js";
24
24
  import {
25
25
  createChatErrorMessage,
26
26
  createChatMessageMessage,
@@ -2091,4 +2091,4 @@ export {
2091
2091
  signalMcpReady,
2092
2092
  createWebSocketServer
2093
2093
  };
2094
- //# sourceMappingURL=chunk-HVLNOTRE.js.map
2094
+ //# sourceMappingURL=chunk-KPKQNJAG.js.map
@@ -4,10 +4,11 @@ import {
4
4
  getLogsPaginated,
5
5
  getProcess,
6
6
  getSessionProcesses,
7
+ killProcessTree,
7
8
  removeProcess,
8
9
  startProcess,
9
10
  updateStatus
10
- } from "./chunk-VRGRAQDG.js";
11
+ } from "./chunk-CYJEQF7U.js";
11
12
 
12
13
  // src/server/tools/background-process/manager.ts
13
14
  import { spawn } from "child_process";
@@ -35,7 +36,6 @@ function isAbsolutePath(path) {
35
36
  }
36
37
 
37
38
  // src/server/tools/background-process/manager.ts
38
- var STOP_SIGNAL_TIMEOUT = 5e3;
39
39
  var listeners = /* @__PURE__ */ new Set();
40
40
  function onProcessEvent(callback) {
41
41
  listeners.add(callback);
@@ -122,42 +122,14 @@ async function stopProcess(processId, sessionId) {
122
122
  return;
123
123
  }
124
124
  updateStatus(processId, sessionId, "stopping");
125
- const pid = proc.pid;
126
- try {
127
- try {
128
- process.kill(-pid, "SIGTERM");
129
- } catch {
130
- process.kill(pid, "SIGTERM");
131
- }
132
- await new Promise((resolve) => {
133
- setTimeout(() => {
134
- try {
135
- process.kill(-pid, "SIGKILL");
136
- } catch {
137
- try {
138
- process.kill(pid, "SIGKILL");
139
- } catch {
140
- }
141
- }
142
- resolve();
143
- }, STOP_SIGNAL_TIMEOUT);
144
- });
145
- updateStatus(processId, sessionId, "exited", null);
146
- emitProcessEvent(processId, {
147
- type: "backgroundProcess.removed",
148
- payload: { processId },
149
- sessionId
150
- });
151
- removeProcess(processId, sessionId);
152
- } catch {
153
- updateStatus(processId, sessionId, "exited", 1);
154
- emitProcessEvent(processId, {
155
- type: "backgroundProcess.removed",
156
- payload: { processId },
157
- sessionId
158
- });
159
- removeProcess(processId, sessionId);
160
- }
125
+ await killProcessTree(proc.pid);
126
+ updateStatus(processId, sessionId, "exited", null);
127
+ emitProcessEvent(processId, {
128
+ type: "backgroundProcess.removed",
129
+ payload: { processId },
130
+ sessionId
131
+ });
132
+ removeProcess(processId, sessionId);
161
133
  }
162
134
  function getProcessStatus(processId, sessionId) {
163
135
  return getProcess(processId, sessionId);
@@ -181,4 +153,4 @@ export {
181
153
  getSessionProcesses2 as getSessionProcesses,
182
154
  getProcessLogs
183
155
  };
184
- //# sourceMappingURL=chunk-PBGOZMVY.js.map
156
+ //# sourceMappingURL=chunk-OCILP3SJ.js.map
@@ -12,7 +12,7 @@ import {
12
12
  loadAllAgentsDefault,
13
13
  processEventsForConversation,
14
14
  runTopLevelAgentLoop
15
- } from "./chunk-3KVWOPRN.js";
15
+ } from "./chunk-55LI67AH.js";
16
16
  import {
17
17
  TurnMetrics,
18
18
  WORKFLOW_KICKOFF_PROMPT,
@@ -324,4 +324,4 @@ export {
324
324
  runAgentTurn,
325
325
  injectWorkflowKickoffIfNeeded
326
326
  };
327
- //# sourceMappingURL=chunk-N3Z4SMEH.js.map
327
+ //# sourceMappingURL=chunk-VCT4DBJC.js.map
package/dist/cli/dev.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-UOUQMYRJ.js";
4
+ } from "../chunk-GFAKHMIJ.js";
5
5
  import "../chunk-XY3LESVZ.js";
6
6
  import {
7
7
  logger
package/dist/cli/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-UOUQMYRJ.js";
4
+ } from "../chunk-GFAKHMIJ.js";
5
5
  import "../chunk-XY3LESVZ.js";
6
6
  import {
7
7
  logger
@@ -6,8 +6,8 @@ import {
6
6
  onProcessEvent,
7
7
  startProcessCommand,
8
8
  stopProcess
9
- } from "./chunk-PBGOZMVY.js";
10
- import "./chunk-VRGRAQDG.js";
9
+ } from "./chunk-OCILP3SJ.js";
10
+ import "./chunk-CYJEQF7U.js";
11
11
  import "./chunk-5WRI5ZAA.js";
12
12
  export {
13
13
  createProcess,
@@ -18,4 +18,4 @@ export {
18
18
  startProcessCommand,
19
19
  stopProcess
20
20
  };
21
- //# sourceMappingURL=manager-R3EMNOPR.js.map
21
+ //# sourceMappingURL=manager-FV4BDEVU.js.map
@@ -2,11 +2,11 @@ import {
2
2
  injectWorkflowKickoffIfNeeded,
3
3
  runAgentTurn,
4
4
  runChatTurn
5
- } from "./chunk-N3Z4SMEH.js";
6
- import "./chunk-3KVWOPRN.js";
5
+ } from "./chunk-VCT4DBJC.js";
6
+ import "./chunk-55LI67AH.js";
7
7
  import "./chunk-LBGHZLLH.js";
8
- import "./chunk-PBGOZMVY.js";
9
- import "./chunk-VRGRAQDG.js";
8
+ import "./chunk-OCILP3SJ.js";
9
+ import "./chunk-CYJEQF7U.js";
10
10
  import "./chunk-NWO6GRYE.js";
11
11
  import "./chunk-F4PMNP7S.js";
12
12
  import "./chunk-EU3WWTFH.js";
@@ -43,4 +43,4 @@ export {
43
43
  runAgentTurn,
44
44
  runChatTurn
45
45
  };
46
- //# sourceMappingURL=orchestrator-5LSO63RB.js.map
46
+ //# sourceMappingURL=orchestrator-NPPNYDJJ.js.map
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "2.0.52",
3
+ "version": "2.0.54",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -3,10 +3,10 @@ import {
3
3
  finalizeTurnCompletion,
4
4
  generateSessionNameForSession
5
5
  } from "./chunk-UOKVBO67.js";
6
- import "./chunk-3KVWOPRN.js";
6
+ import "./chunk-55LI67AH.js";
7
7
  import "./chunk-LBGHZLLH.js";
8
- import "./chunk-PBGOZMVY.js";
9
- import "./chunk-VRGRAQDG.js";
8
+ import "./chunk-OCILP3SJ.js";
9
+ import "./chunk-CYJEQF7U.js";
10
10
  import "./chunk-NWO6GRYE.js";
11
11
  import {
12
12
  createChatMessageMessage,
@@ -174,7 +174,7 @@ var QueueProcessor = class {
174
174
  backend: provider?.backend ?? llmClient.getBackend(),
175
175
  model: llmClient.getModel()
176
176
  };
177
- const { runChatTurn } = await import("./orchestrator-5LSO63RB.js");
177
+ const { runChatTurn } = await import("./orchestrator-NPPNYDJJ.js");
178
178
  const runChatTurnParams = buildRunChatTurnParams({
179
179
  sessionManager,
180
180
  sessionId,
@@ -222,4 +222,4 @@ var QueueProcessor = class {
222
222
  export {
223
223
  QueueProcessor
224
224
  };
225
- //# sourceMappingURL=processor-F5FMOPOQ.js.map
225
+ //# sourceMappingURL=processor-WJQILWUH.js.map