openfox 2.0.147 → 2.0.148

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 (28) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/CHANGELOG.md +6 -0
  3. package/dist/{auto-continue-FGQ63HHR.js → auto-continue-NODN37EK.js} +2 -2
  4. package/dist/{chat-handler-VCED3JYF.js → chat-handler-PETIVNGQ.js} +4 -4
  5. package/dist/{chunk-QHFJRUJV.js → chunk-6UU3W3XO.js} +3 -3
  6. package/dist/{chunk-YQJ6HEFS.js → chunk-772W5PF7.js} +37 -29
  7. package/dist/chunk-DKHY5UNR.js +7 -0
  8. package/dist/{chunk-AJMBQMJH.js → chunk-EJKAN7HK.js} +11 -8
  9. package/dist/{chunk-ABXERHIY.js → chunk-F6QMFCHQ.js} +4 -4
  10. package/dist/{chunk-ESHP42KO.js → chunk-LNJOQAXT.js} +2 -2
  11. package/dist/{chunk-2V6QL6IW.js → chunk-NELDQCPC.js} +3 -3
  12. package/dist/{chunk-UOBJP4GN.js → chunk-V4BEYGBJ.js} +7 -7
  13. package/dist/cli/dev.js +1 -1
  14. package/dist/cli/index.js +1 -1
  15. package/dist/{dynamic-context-YLRA34WJ.js → dynamic-context-CM3M2EJC.js} +2 -2
  16. package/dist/{export-import-R4E5BUQS.js → export-import-UITAIBU5.js} +2 -2
  17. package/dist/{launch-QP2BI3PB.js → launch-E6SDDTHE.js} +5 -5
  18. package/dist/{orchestrator-7T62RLDL.js → orchestrator-MVQIPITF.js} +4 -4
  19. package/dist/package.json +1 -1
  20. package/dist/{processor-LDLRELLS.js → processor-UTBTJVV5.js} +3 -3
  21. package/dist/{serve-A4AJAH2N.js → serve-XGIHFEC6.js} +8 -8
  22. package/dist/server/index.d.ts +3 -0
  23. package/dist/server/index.js +7 -7
  24. package/dist/{server-A3EGJ6MD.js → server-F66GXJUS.js} +6 -6
  25. package/dist/{tools-MRC27SZG.js → tools-NIOESJYT.js} +2 -2
  26. package/dist/{update-MLDVVG3D.js → update-X6BS6MUF.js} +2 -2
  27. package/package.json +1 -1
  28. package/dist/chunk-65KDNVRA.js +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.148 - 2026-09-14
4
+
5
+ ### Bug Fixes
6
+
7
+ - **Sub-agent responses no longer truncate in long sessions** — sub-agent output is now budgeted against its own context instead of the parent session's, so plans and reviews run to completion even when the orchestrator session is huge.
8
+
3
9
  ## 2.0.147 - 2026-09-14
4
10
 
5
11
  ### Features
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.148 - 2026-09-14
4
+
5
+ ### Bug Fixes
6
+
7
+ - **Sub-agent responses no longer truncate in long sessions** — sub-agent output is now budgeted against its own context instead of the parent session's, so plans and reviews run to completion even when the orchestrator session is huge.
8
+
3
9
  ## 2.0.147 - 2026-09-14
4
10
 
5
11
  ### Features
@@ -1,4 +1,4 @@
1
- import "./chunk-AJMBQMJH.js";
1
+ import "./chunk-EJKAN7HK.js";
2
2
  import "./chunk-OAN4BXEW.js";
3
3
  import "./chunk-DJH6LMBT.js";
4
4
  import "./chunk-PHR64A6U.js";
@@ -108,4 +108,4 @@ export {
108
108
  planBootContinuation,
109
109
  runBootAutoContinuations
110
110
  };
111
- //# sourceMappingURL=auto-continue-FGQ63HHR.js.map
111
+ //# sourceMappingURL=auto-continue-NODN37EK.js.map
@@ -5,9 +5,9 @@ import {
5
5
  } from "./chunk-ORIPUMOQ.js";
6
6
  import {
7
7
  runChatTurn
8
- } from "./chunk-ABXERHIY.js";
9
- import "./chunk-ESHP42KO.js";
10
- import "./chunk-AJMBQMJH.js";
8
+ } from "./chunk-F6QMFCHQ.js";
9
+ import "./chunk-LNJOQAXT.js";
10
+ import "./chunk-EJKAN7HK.js";
11
11
  import "./chunk-OAN4BXEW.js";
12
12
  import "./chunk-DJH6LMBT.js";
13
13
  import "./chunk-PHR64A6U.js";
@@ -181,4 +181,4 @@ export {
181
181
  startChatSession,
182
182
  stopSessionExecution
183
183
  };
184
- //# sourceMappingURL=chat-handler-VCED3JYF.js.map
184
+ //# sourceMappingURL=chat-handler-PETIVNGQ.js.map
@@ -252,7 +252,7 @@ async function runCli(options) {
252
252
  break;
253
253
  }
254
254
  case "update": {
255
- const { runUpdate } = await import("./update-MLDVVG3D.js");
255
+ const { runUpdate } = await import("./update-X6BS6MUF.js");
256
256
  const code = await runUpdate();
257
257
  if (code !== 0) {
258
258
  process.exit(code);
@@ -265,7 +265,7 @@ async function runCli(options) {
265
265
  if (!configExists) {
266
266
  await runNetworkSetup(mode);
267
267
  }
268
- const { runServe } = await import("./serve-A4AJAH2N.js");
268
+ const { runServe } = await import("./serve-XGIHFEC6.js");
269
269
  const serveOptions = { mode };
270
270
  if (values.port) serveOptions.port = parseInt(values.port);
271
271
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -277,4 +277,4 @@ async function runCli(options) {
277
277
  export {
278
278
  runCli
279
279
  };
280
- //# sourceMappingURL=chunk-QHFJRUJV.js.map
280
+ //# sourceMappingURL=chunk-6UU3W3XO.js.map
@@ -9,10 +9,10 @@ import {
9
9
  terminalManager,
10
10
  tokenFromPassword,
11
11
  verifyPassword
12
- } from "./chunk-UOBJP4GN.js";
12
+ } from "./chunk-V4BEYGBJ.js";
13
13
  import {
14
14
  TEMPLATE_VARIABLES
15
- } from "./chunk-2V6QL6IW.js";
15
+ } from "./chunk-NELDQCPC.js";
16
16
  import {
17
17
  projectSessionStatus
18
18
  } from "./chunk-T3S5MTMD.js";
@@ -42,7 +42,7 @@ import {
42
42
  setMcpManagerForTools,
43
43
  setMcpTools,
44
44
  setNotifyMcpServersChanged
45
- } from "./chunk-AJMBQMJH.js";
45
+ } from "./chunk-EJKAN7HK.js";
46
46
  import {
47
47
  deleteOwnedSkill,
48
48
  deleteProjectSkill,
@@ -224,7 +224,7 @@ import {
224
224
  } from "./chunk-YNMP647F.js";
225
225
  import {
226
226
  VERSION
227
- } from "./chunk-65KDNVRA.js";
227
+ } from "./chunk-DKHY5UNR.js";
228
228
  import {
229
229
  deleteProject,
230
230
  getProject,
@@ -2849,6 +2849,7 @@ var SessionManager = class {
2849
2849
  // Sessions already warned about an unresolvable provider — getContextState runs on every
2850
2850
  // turn, and the warning is only worth one line per session.
2851
2851
  unknownProviderWarned = /* @__PURE__ */ new Set();
2852
+ subAgentContextSizes = /* @__PURE__ */ new Map();
2852
2853
  switchLocks = /* @__PURE__ */ new Map();
2853
2854
  workspaceCreationLocks = /* @__PURE__ */ new Map();
2854
2855
  // Cooperative pause: in-memory only (a pause is only meaningful for a live,
@@ -3147,8 +3148,8 @@ var SessionManager = class {
3147
3148
  * @throws Error for invalid payloads or unknown project
3148
3149
  */
3149
3150
  async importSession(projectId, rawPayload) {
3150
- const { parseSessionExport, IMPORTED_SESSION_REMINDER, SESSION_EXPORT_VERSION } = await import("./export-import-R4E5BUQS.js");
3151
- const { injectContextDriftReminders, getToolSetFingerprint } = await import("./dynamic-context-YLRA34WJ.js");
3151
+ const { parseSessionExport, IMPORTED_SESSION_REMINDER, SESSION_EXPORT_VERSION } = await import("./export-import-UITAIBU5.js");
3152
+ const { injectContextDriftReminders, getToolSetFingerprint } = await import("./dynamic-context-CM3M2EJC.js");
3152
3153
  const { loadAllAgentsDefault: loadAllAgentsDefault2, resolveDefaultAgentId } = await import("./registry-24U5BZAJ.js");
3153
3154
  const payload = parseSessionExport(rawPayload);
3154
3155
  if (payload.version !== SESSION_EXPORT_VERSION) {
@@ -3901,6 +3902,9 @@ var SessionManager = class {
3901
3902
  const currentTokens = promptTokens + completionTokens;
3902
3903
  const compactionCount = subAgentId ? 0 : state?.contextState.compactionCount ?? 0;
3903
3904
  const dynamicContextChanged = this.getDynamicContextChanged(sessionId);
3905
+ if (subAgentId) {
3906
+ this.subAgentContextSizes.set(subAgentId, currentTokens);
3907
+ }
3904
3908
  emitContextState(
3905
3909
  sessionId,
3906
3910
  currentTokens,
@@ -3913,6 +3917,10 @@ var SessionManager = class {
3913
3917
  );
3914
3918
  logger.debug("Context state updated", { sessionId, promptTokens, maxTokens, subAgentId });
3915
3919
  }
3920
+ /** Tokens used by a sub-agent's own scoped context (fresh, never-compacted). */
3921
+ getSubAgentContextTokens(subAgentId) {
3922
+ return this.subAgentContextSizes.get(subAgentId);
3923
+ }
3916
3924
  // ============================================================================
3917
3925
  // Criteria Operations (delegates to EventStore)
3918
3926
  // ============================================================================
@@ -7248,7 +7256,7 @@ function detectWsl() {
7248
7256
  // src/server/index.ts
7249
7257
  var __dirname3 = dirname7(fileURLToPath6(import.meta.url));
7250
7258
  async function announceContextDrift(sessionManager, sessionIds) {
7251
- const { injectContextDriftRemindersForSessions } = await import("./dynamic-context-YLRA34WJ.js");
7259
+ const { injectContextDriftRemindersForSessions } = await import("./dynamic-context-CM3M2EJC.js");
7252
7260
  await injectContextDriftRemindersForSessions(sessionManager, sessionIds);
7253
7261
  }
7254
7262
  async function createServerHandle(config3) {
@@ -7364,7 +7372,7 @@ async function createServerHandle(config3) {
7364
7372
  toolRegistry = createToolRegistry();
7365
7373
  logger.info("MCP tools registered", { count: mcpTools.length });
7366
7374
  }
7367
- const { signalMcpReady } = await import("./server-A3EGJ6MD.js");
7375
+ const { signalMcpReady } = await import("./server-F66GXJUS.js");
7368
7376
  signalMcpReady();
7369
7377
  }
7370
7378
  const app = express();
@@ -7581,7 +7589,7 @@ async function createServerHandle(config3) {
7581
7589
  app.use("/api", sessionFavoriteRouter);
7582
7590
  const { createTasksService } = await import("./service-KMOSB6SU.js");
7583
7591
  const { registerTaskRoutes } = await import("./tasks-X5DM553T.js");
7584
- const { setTasksService } = await import("./tools-MRC27SZG.js");
7592
+ const { setTasksService } = await import("./tools-NIOESJYT.js");
7585
7593
  const tasksService = createTasksService({
7586
7594
  sessionManager,
7587
7595
  config: config3,
@@ -7904,7 +7912,7 @@ All file and git operations should use this branch.
7904
7912
  const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEventsWithSnapshot2 } = await import("./events-FTS5W6FX.js");
7905
7913
  const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, buildSessionStatsMessages, foldPendingConfirmations } = await import("./folding-VWRMYZ5T.js");
7906
7914
  const { computeSessionStatsSummary } = await import("./stats-2QMXP6G4.js");
7907
- const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-MRC27SZG.js");
7915
+ const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-NIOESJYT.js");
7908
7916
  const { getMaxVisibleItems } = await import("./settings-FQUDSGZF.js");
7909
7917
  const session = sessionManager.getSession(req.params.id);
7910
7918
  if (!session) {
@@ -7935,7 +7943,7 @@ All file and git operations should use this branch.
7935
7943
  });
7936
7944
  app.get("/api/sessions/:id/status", async (req, res) => {
7937
7945
  const { projectSessionStatus: projectSessionStatus2 } = await import("./session-status-UFO5IFI7.js");
7938
- const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-MRC27SZG.js");
7946
+ const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-NIOESJYT.js");
7939
7947
  const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEventsWithSnapshot2 } = await import("./events-FTS5W6FX.js");
7940
7948
  const { foldPendingConfirmations } = await import("./folding-VWRMYZ5T.js");
7941
7949
  const sessionId = req.params["id"];
@@ -7971,8 +7979,8 @@ All file and git operations should use this branch.
7971
7979
  if (!session) {
7972
7980
  return res.status(404).json({ error: "Session not found" });
7973
7981
  }
7974
- const { stopSessionExecution } = await import("./chat-handler-VCED3JYF.js");
7975
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-MRC27SZG.js");
7982
+ const { stopSessionExecution } = await import("./chat-handler-PETIVNGQ.js");
7983
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-NIOESJYT.js");
7976
7984
  sessionManager.clearMessageQueue(sessionId);
7977
7985
  stopSessionExecution(sessionId, sessionManager);
7978
7986
  abortSession(sessionId);
@@ -8204,7 +8212,7 @@ All file and git operations should use this branch.
8204
8212
  }
8205
8213
  sessionManager.setDangerLevel(sessionId, dangerLevel);
8206
8214
  if (dangerLevel === "dangerous") {
8207
- const { autoApprovePendingConfirmationsForSession } = await import("./tools-MRC27SZG.js");
8215
+ const { autoApprovePendingConfirmationsForSession } = await import("./tools-NIOESJYT.js");
8208
8216
  const approvedCallIds = autoApprovePendingConfirmationsForSession(sessionId);
8209
8217
  for (const callId of approvedCallIds) {
8210
8218
  wssExports.broadcastForSession(sessionId, {
@@ -8239,7 +8247,7 @@ All file and git operations should use this branch.
8239
8247
  setSessionDisabledServers(sessionId, disabledServers);
8240
8248
  const messages = session.messages ?? [];
8241
8249
  if (messages.length === 0) {
8242
- const { applyDynamicContext } = await import("./dynamic-context-YLRA34WJ.js");
8250
+ const { applyDynamicContext } = await import("./dynamic-context-CM3M2EJC.js");
8243
8251
  const modelName = session.providerModel ?? providerManager.getCurrentModel();
8244
8252
  await applyDynamicContext(sessionManager, sessionId, modelName);
8245
8253
  } else {
@@ -8273,7 +8281,7 @@ All file and git operations should use this branch.
8273
8281
  if (alwaysAllow !== void 0 && typeof alwaysAllow !== "boolean") {
8274
8282
  return res.status(400).json({ error: "alwaysAllow must be a boolean if provided" });
8275
8283
  }
8276
- const { providePathConfirmation: providePathConfirmation2, getConfirmationSessionId } = await import("./tools-MRC27SZG.js");
8284
+ const { providePathConfirmation: providePathConfirmation2, getConfirmationSessionId } = await import("./tools-NIOESJYT.js");
8277
8285
  const pendingSessionId = getConfirmationSessionId(callId);
8278
8286
  if (!pendingSessionId) {
8279
8287
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
@@ -8288,7 +8296,7 @@ All file and git operations should use this branch.
8288
8296
  const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-FTS5W6FX.js");
8289
8297
  const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations } = await import("./folding-VWRMYZ5T.js");
8290
8298
  const { createSessionStateMessage } = await import("./protocol-M4DFHA32.js");
8291
- const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-MRC27SZG.js");
8299
+ const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-NIOESJYT.js");
8292
8300
  const { getMaxVisibleItems } = await import("./settings-FQUDSGZF.js");
8293
8301
  const eventStore = getEventStore2();
8294
8302
  const { snapshot, events: eventsSinceSnapshot } = eventStore.getEventsSinceSnapshot(sessionId);
@@ -8326,7 +8334,7 @@ All file and git operations should use this branch.
8326
8334
  if (!skip && typeof answer !== "string") {
8327
8335
  return res.status(400).json({ error: "answer is required when not skipping" });
8328
8336
  }
8329
- const { provideAnswer: provideAnswer2 } = await import("./tools-MRC27SZG.js");
8337
+ const { provideAnswer: provideAnswer2 } = await import("./tools-NIOESJYT.js");
8330
8338
  const found = provideAnswer2(callId, answer ?? "", skip ?? false);
8331
8339
  if (!found) {
8332
8340
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -8392,7 +8400,7 @@ All file and git operations should use this branch.
8392
8400
  backend: activeProvider?.backend ?? llmClient.getBackend(),
8393
8401
  model: llmClient.getModel()
8394
8402
  };
8395
- const { runAgentTurn, TurnMetrics } = await import("./orchestrator-7T62RLDL.js");
8403
+ const { runAgentTurn, TurnMetrics } = await import("./orchestrator-MVQIPITF.js");
8396
8404
  runAgentTurn(
8397
8405
  {
8398
8406
  sessionManager,
@@ -8430,8 +8438,8 @@ All file and git operations should use this branch.
8430
8438
  if (!session) {
8431
8439
  return res.status(404).json({ error: "Session not found" });
8432
8440
  }
8433
- const { stopSessionExecution } = await import("./chat-handler-VCED3JYF.js");
8434
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-MRC27SZG.js");
8441
+ const { stopSessionExecution } = await import("./chat-handler-PETIVNGQ.js");
8442
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-NIOESJYT.js");
8435
8443
  const queuedMessages = sessionManager.getQueueState(sessionId);
8436
8444
  sessionManager.clearMessageQueue(sessionId);
8437
8445
  stopSessionExecution(sessionId, sessionManager);
@@ -8554,7 +8562,7 @@ All file and git operations should use this branch.
8554
8562
  return res.status(404).json({ error: "Session not found" });
8555
8563
  }
8556
8564
  try {
8557
- const { buildSessionExport } = await import("./export-import-R4E5BUQS.js");
8565
+ const { buildSessionExport } = await import("./export-import-UITAIBU5.js");
8558
8566
  const payload = buildSessionExport(sessionManager, sessionId);
8559
8567
  const filename = `${(payload.session.title ?? "session").replace(/[^a-zA-Z0-9-_]/g, "_")}.openfox-session.json`;
8560
8568
  res.setHeader("Content-Disposition", `attachment; filename="${filename}"`);
@@ -9377,7 +9385,7 @@ All file and git operations should use this branch.
9377
9385
  });
9378
9386
  async function rebuildMcpTools() {
9379
9387
  const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-ZY4FC4C4.js");
9380
- const { setMcpTools: setMcpTools2 } = await import("./tools-MRC27SZG.js");
9388
+ const { setMcpTools: setMcpTools2 } = await import("./tools-NIOESJYT.js");
9381
9389
  const mcpTools = createMcpTools2(mcpManager);
9382
9390
  setMcpTools2(mcpTools);
9383
9391
  toolRegistry = createToolRegistry();
@@ -9953,7 +9961,7 @@ All file and git operations should use this branch.
9953
9961
  );
9954
9962
  const wss = wssExports.wss;
9955
9963
  deferTasksBroadcast = (_projectId, payload) => wssExports.broadcastAll({ type: "tasks.update", payload });
9956
- const { launchWorkflowRun, abortRunnerRun } = await import("./launch-QP2BI3PB.js");
9964
+ const { launchWorkflowRun, abortRunnerRun } = await import("./launch-E6SDDTHE.js");
9957
9965
  deferTasksLaunchWorkflow = (sessionId, launch) => {
9958
9966
  const effective = sessionManager.resolveEffectiveProviderModel(sessionId);
9959
9967
  let llmClient = getLLMClient();
@@ -9998,7 +10006,7 @@ All file and git operations should use this branch.
9998
10006
  const state = sessionManager.getContextState(sessionId);
9999
10007
  wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
10000
10008
  });
10001
- const { QueueProcessor } = await import("./processor-LDLRELLS.js");
10009
+ const { QueueProcessor } = await import("./processor-UTBTJVV5.js");
10002
10010
  const queueProcessor = new QueueProcessor({
10003
10011
  sessionManager,
10004
10012
  providerManager,
@@ -10011,7 +10019,7 @@ All file and git operations should use this branch.
10011
10019
  const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-FQUDSGZF.js");
10012
10020
  if (getSetting2(SETTINGS_KEYS.AUTO_CONTINUE_ON_BOOT) === "true") {
10013
10021
  const { getStaleRunningSessionIds } = await import("./store-OWOLXB74.js");
10014
- const { runBootAutoContinuations } = await import("./auto-continue-FGQ63HHR.js");
10022
+ const { runBootAutoContinuations } = await import("./auto-continue-NODN37EK.js");
10015
10023
  const staleIds = getStaleRunningSessionIds();
10016
10024
  if (staleIds.length > 0) {
10017
10025
  const continued = runBootAutoContinuations(staleIds, {
@@ -10055,8 +10063,8 @@ All file and git operations should use this branch.
10055
10063
  launchWorkflow: (sessionId, launch) => deferTasksLaunchWorkflow(sessionId, launch),
10056
10064
  stopSession: (sessionId) => {
10057
10065
  void (async () => {
10058
- const { stopSessionExecution } = await import("./chat-handler-VCED3JYF.js");
10059
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-MRC27SZG.js");
10066
+ const { stopSessionExecution } = await import("./chat-handler-PETIVNGQ.js");
10067
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-NIOESJYT.js");
10060
10068
  sessionManager.clearMessageQueue(sessionId);
10061
10069
  stopSessionExecution(sessionId, sessionManager);
10062
10070
  abortSession(sessionId);
@@ -10183,4 +10191,4 @@ export {
10183
10191
  createServerHandle,
10184
10192
  createServer
10185
10193
  };
10186
- //# sourceMappingURL=chunk-YQJ6HEFS.js.map
10194
+ //# sourceMappingURL=chunk-772W5PF7.js.map
@@ -0,0 +1,7 @@
1
+ // src/constants.ts
2
+ var VERSION = "2.0.148";
3
+
4
+ export {
5
+ VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-DKHY5UNR.js.map
@@ -1616,11 +1616,12 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
1616
1616
  );
1617
1617
  };
1618
1618
  const contextState = sessionManager.getContextState(sessionId);
1619
- previousContextTokens = contextState.currentTokens;
1619
+ const subAgentContextTokens = config.subAgentMetadata ? sessionManager.getSubAgentContextTokens?.(config.subAgentMetadata.subAgentId) ?? 0 : void 0;
1620
+ previousContextTokens = subAgentContextTokens ?? contextState.currentTokens;
1620
1621
  const contextWindow = sessionManager.getCurrentModelContext(sessionId, config.mode);
1621
1622
  const availableForOutput = Math.max(
1622
1623
  256,
1623
- contextWindow - contextState.currentTokens - pendingToolResultTokens - OUTPUT_RESERVE_TOKENS
1624
+ contextWindow - previousContextTokens - pendingToolResultTokens - OUTPUT_RESERVE_TOKENS
1624
1625
  );
1625
1626
  let modelSettings = config.modelSettings ?? sessionManager.getCurrentModelSettings(sessionId, config.mode);
1626
1627
  if (modelSettings && currentMaxTokensOverride !== void 0) {
@@ -1769,9 +1770,11 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
1769
1770
  if (!compacting) {
1770
1771
  const contextState = sessionManager.getContextState(sessionId);
1771
1772
  const { shouldCompact, appendCompactionPrompt } = await import("./compactor-YY7PO2XE.js");
1773
+ const compactionTokens = config.subAgentMetadata ? sessionManager.getSubAgentContextTokens?.(config.subAgentMetadata.subAgentId) ?? 0 : contextState.currentTokens;
1774
+ const compactionWindow = config.subAgentMetadata ? sessionManager.getCurrentModelContext(sessionId, config.mode) : contextState.maxTokens;
1772
1775
  if (shouldCompact(
1773
- contextState.currentTokens,
1774
- contextState.maxTokens,
1776
+ compactionTokens,
1777
+ compactionWindow,
1775
1778
  sessionManager.getModelCompactionThreshold(sessionId, config.mode) ?? runtimeConfig.context.compactionThreshold
1776
1779
  )) {
1777
1780
  appendCompactionPrompt(sessionId, append);
@@ -2478,7 +2481,7 @@ var callSubAgentTool = {
2478
2481
  };
2479
2482
  }
2480
2483
  try {
2481
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-MRC27SZG.js");
2484
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-NIOESJYT.js");
2482
2485
  const toolRegistry = getToolRegistryForAgent2(agentDef);
2483
2486
  const turnMetrics = new TurnMetrics();
2484
2487
  const result = await executeSubAgent({
@@ -3582,11 +3585,11 @@ var mcpConfigTool = createTool(
3582
3585
  async function notifyContextChanged(sessionId) {
3583
3586
  context.sessionManager.setDynamicContextChanged(sessionId, true);
3584
3587
  mcpNotifyChanged?.(sessionId);
3585
- const { injectContextDriftReminders } = await import("./dynamic-context-YLRA34WJ.js");
3588
+ const { injectContextDriftReminders } = await import("./dynamic-context-CM3M2EJC.js");
3586
3589
  await injectContextDriftReminders(context.sessionManager, sessionId);
3587
3590
  }
3588
3591
  async function rebuildTools() {
3589
- const { setMcpTools: setMcpTools2 } = await import("./tools-MRC27SZG.js");
3592
+ const { setMcpTools: setMcpTools2 } = await import("./tools-NIOESJYT.js");
3590
3593
  const mcpTools = createMcpTools(mcpManagerForTools);
3591
3594
  setMcpTools2(mcpTools);
3592
3595
  }
@@ -4729,4 +4732,4 @@ export {
4729
4732
  getToolRegistryForAgent,
4730
4733
  createToolRegistry
4731
4734
  };
4732
- //# sourceMappingURL=chunk-AJMBQMJH.js.map
4735
+ //# sourceMappingURL=chunk-EJKAN7HK.js.map
@@ -3,14 +3,14 @@ import {
3
3
  checkToolChangesAndInject,
4
4
  computeDynamicContextHash,
5
5
  getToolFingerprint
6
- } from "./chunk-ESHP42KO.js";
6
+ } from "./chunk-LNJOQAXT.js";
7
7
  import {
8
8
  createAssemblyResult,
9
9
  getConversationMessages,
10
10
  getToolRegistryForAgent,
11
11
  processEventsForConversation,
12
12
  runTopLevelAgentLoop
13
- } from "./chunk-AJMBQMJH.js";
13
+ } from "./chunk-EJKAN7HK.js";
14
14
  import {
15
15
  getAllInstructions,
16
16
  getEnabledSkillMetadata
@@ -357,7 +357,7 @@ async function runAgentTurn(options, turnMetrics, agentId, append, callbacks) {
357
357
  getConversationMessages: buildGetConversationMessages(options.sessionId, resolveAgentClient, append),
358
358
  injectAgentReminder: () => injectAgentReminder(options.sessionId, agentDef),
359
359
  rebuildCachedContext: async () => {
360
- const { applyDynamicContext } = await import("./dynamic-context-YLRA34WJ.js");
360
+ const { applyDynamicContext } = await import("./dynamic-context-CM3M2EJC.js");
361
361
  await applyDynamicContext(options.sessionManager, options.sessionId, agentLlmClient.getModel());
362
362
  },
363
363
  ...options.initialCompacting ? { initialCompacting: true } : {},
@@ -387,4 +387,4 @@ export {
387
387
  runChatTurn,
388
388
  runAgentTurn
389
389
  };
390
- //# sourceMappingURL=chunk-ABXERHIY.js.map
390
+ //# sourceMappingURL=chunk-F6QMFCHQ.js.map
@@ -329,7 +329,7 @@ function resolveAgentDef(sessionManager, sessionId) {
329
329
  });
330
330
  }
331
331
  async function getEffectiveToolDefinitions(agentDef, sessionId, modelName) {
332
- const { getToolRegistryForAgent } = await import("./tools-MRC27SZG.js");
332
+ const { getToolRegistryForAgent } = await import("./tools-NIOESJYT.js");
333
333
  const { isDescribeImageEligible } = await import("./describe-image-Z5WS6YU3.js");
334
334
  const all = getToolRegistryForAgent(agentDef, sessionId).definitions;
335
335
  const eligible = await isDescribeImageEligible(modelName);
@@ -398,4 +398,4 @@ export {
398
398
  computeSessionHash,
399
399
  applyDynamicContext
400
400
  };
401
- //# sourceMappingURL=chunk-ESHP42KO.js.map
401
+ //# sourceMappingURL=chunk-LNJOQAXT.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  runAgentTurn
3
- } from "./chunk-ABXERHIY.js";
3
+ } from "./chunk-F6QMFCHQ.js";
4
4
  import {
5
5
  buildAgentOverrideStatsIdentity,
6
6
  executeSubAgent,
7
7
  getToolRegistryForAgent,
8
8
  resolveLLMClientForAgent
9
- } from "./chunk-AJMBQMJH.js";
9
+ } from "./chunk-EJKAN7HK.js";
10
10
  import {
11
11
  gitSpawnEnv
12
12
  } from "./chunk-J7GAZGZT.js";
@@ -1196,4 +1196,4 @@ export {
1196
1196
  abortRunnerRun,
1197
1197
  launchWorkflowRun
1198
1198
  };
1199
- //# sourceMappingURL=chunk-2V6QL6IW.js.map
1199
+ //# sourceMappingURL=chunk-NELDQCPC.js.map
@@ -5,18 +5,18 @@ import {
5
5
  } from "./chunk-ORIPUMOQ.js";
6
6
  import {
7
7
  launchWorkflowRun
8
- } from "./chunk-2V6QL6IW.js";
8
+ } from "./chunk-NELDQCPC.js";
9
9
  import {
10
10
  runChatTurn
11
- } from "./chunk-ABXERHIY.js";
11
+ } from "./chunk-F6QMFCHQ.js";
12
12
  import {
13
13
  applyDynamicContext,
14
14
  computeSessionHash,
15
15
  computeUnifiedDiff
16
- } from "./chunk-ESHP42KO.js";
16
+ } from "./chunk-LNJOQAXT.js";
17
17
  import {
18
18
  devServerManager
19
- } from "./chunk-AJMBQMJH.js";
19
+ } from "./chunk-EJKAN7HK.js";
20
20
  import {
21
21
  gitSpawnEnv
22
22
  } from "./chunk-J7GAZGZT.js";
@@ -1358,7 +1358,7 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
1358
1358
  }
1359
1359
  const session = sessionManager.requireSession(sessionId);
1360
1360
  try {
1361
- const { buildCachedPrompt, computePreviewToolDiff } = await import("./dynamic-context-YLRA34WJ.js");
1361
+ const { buildCachedPrompt, computePreviewToolDiff } = await import("./dynamic-context-CM3M2EJC.js");
1362
1362
  const allAgents = await import("./registry-24U5BZAJ.js");
1363
1363
  const agentDef = allAgents.findAgentById(session.mode, await allAgents.loadAllAgentsDefault()) ?? allAgents.findAgentById("planner", await allAgents.loadAllAgentsDefault());
1364
1364
  const modelName = session.providerModel ?? _providerManager?.getCurrentModel();
@@ -1370,7 +1370,7 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
1370
1370
  const oldCached = sessionManager.getCachedPrompt(sessionId);
1371
1371
  const oldPrompt = oldCached?.systemPrompt;
1372
1372
  const diff = oldPrompt ? computeUnifiedDiff(oldPrompt, newPrompt) : [];
1373
- const { getToolRegistryForAgent } = await import("./tools-MRC27SZG.js");
1373
+ const { getToolRegistryForAgent } = await import("./tools-NIOESJYT.js");
1374
1374
  const unfilteredTools = getToolRegistryForAgent(agentDef).definitions;
1375
1375
  const toolDiff = computePreviewToolDiff(oldCached?.tools, unfilteredTools, newTools);
1376
1376
  send({
@@ -1743,4 +1743,4 @@ export {
1743
1743
  signalMcpReady,
1744
1744
  createWebSocketServer
1745
1745
  };
1746
- //# sourceMappingURL=chunk-UOBJP4GN.js.map
1746
+ //# sourceMappingURL=chunk-V4BEYGBJ.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-QHFJRUJV.js";
4
+ } from "../chunk-6UU3W3XO.js";
5
5
  import "../chunk-AGXJ5O63.js";
6
6
  import "../chunk-2OMGR7LN.js";
7
7
  import {
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-QHFJRUJV.js";
4
+ } from "../chunk-6UU3W3XO.js";
5
5
  import "../chunk-AGXJ5O63.js";
6
6
  import "../chunk-2OMGR7LN.js";
7
7
  import {
@@ -16,7 +16,7 @@ import {
16
16
  injectContextDriftRemindersForSessions,
17
17
  renderSystemPromptDiff,
18
18
  renderToolChangeReminder
19
- } from "./chunk-ESHP42KO.js";
19
+ } from "./chunk-LNJOQAXT.js";
20
20
  import "./chunk-DJH6LMBT.js";
21
21
  import "./chunk-ZONLEX2F.js";
22
22
  import "./chunk-5JGRKNMS.js";
@@ -52,4 +52,4 @@ export {
52
52
  renderSystemPromptDiff,
53
53
  renderToolChangeReminder
54
54
  };
55
- //# sourceMappingURL=dynamic-context-YLRA34WJ.js.map
55
+ //# sourceMappingURL=dynamic-context-CM3M2EJC.js.map
@@ -11,7 +11,7 @@ import "./chunk-OSXPQSLW.js";
11
11
  import "./chunk-LCLH6ZUL.js";
12
12
  import {
13
13
  VERSION
14
- } from "./chunk-65KDNVRA.js";
14
+ } from "./chunk-DKHY5UNR.js";
15
15
  import {
16
16
  getProject
17
17
  } from "./chunk-JYYBSODN.js";
@@ -136,4 +136,4 @@ export {
136
136
  buildSessionExport,
137
137
  parseSessionExport
138
138
  };
139
- //# sourceMappingURL=export-import-R4E5BUQS.js.map
139
+ //# sourceMappingURL=export-import-UITAIBU5.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  abortRunnerRun,
3
3
  launchWorkflowRun
4
- } from "./chunk-2V6QL6IW.js";
5
- import "./chunk-ABXERHIY.js";
6
- import "./chunk-ESHP42KO.js";
7
- import "./chunk-AJMBQMJH.js";
4
+ } from "./chunk-NELDQCPC.js";
5
+ import "./chunk-F6QMFCHQ.js";
6
+ import "./chunk-LNJOQAXT.js";
7
+ import "./chunk-EJKAN7HK.js";
8
8
  import "./chunk-OAN4BXEW.js";
9
9
  import "./chunk-DJH6LMBT.js";
10
10
  import "./chunk-PHR64A6U.js";
@@ -56,4 +56,4 @@ export {
56
56
  abortRunnerRun,
57
57
  launchWorkflowRun
58
58
  };
59
- //# sourceMappingURL=launch-QP2BI3PB.js.map
59
+ //# sourceMappingURL=launch-E6SDDTHE.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  runAgentTurn,
3
3
  runChatTurn
4
- } from "./chunk-ABXERHIY.js";
5
- import "./chunk-ESHP42KO.js";
6
- import "./chunk-AJMBQMJH.js";
4
+ } from "./chunk-F6QMFCHQ.js";
5
+ import "./chunk-LNJOQAXT.js";
6
+ import "./chunk-EJKAN7HK.js";
7
7
  import "./chunk-OAN4BXEW.js";
8
8
  import "./chunk-DJH6LMBT.js";
9
9
  import "./chunk-PHR64A6U.js";
@@ -67,4 +67,4 @@ export {
67
67
  runAgentTurn,
68
68
  runChatTurn
69
69
  };
70
- //# sourceMappingURL=orchestrator-7T62RLDL.js.map
70
+ //# sourceMappingURL=orchestrator-MVQIPITF.js.map
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "2.0.147",
3
+ "version": "2.0.148",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -3,7 +3,7 @@ import {
3
3
  finalizeTurnCompletion,
4
4
  generateSessionNameForSession
5
5
  } from "./chunk-ORIPUMOQ.js";
6
- import "./chunk-AJMBQMJH.js";
6
+ import "./chunk-EJKAN7HK.js";
7
7
  import "./chunk-OAN4BXEW.js";
8
8
  import "./chunk-DJH6LMBT.js";
9
9
  import "./chunk-PHR64A6U.js";
@@ -229,7 +229,7 @@ var QueueProcessor = class {
229
229
  model: sessionClient.getModel(),
230
230
  ...sessionEffort ? { reasoningEffort: sessionEffort } : {}
231
231
  };
232
- const { runChatTurn } = await import("./orchestrator-7T62RLDL.js");
232
+ const { runChatTurn } = await import("./orchestrator-MVQIPITF.js");
233
233
  const runChatTurnParams = buildRunChatTurnParams({
234
234
  sessionManager,
235
235
  sessionId,
@@ -278,4 +278,4 @@ var QueueProcessor = class {
278
278
  export {
279
279
  QueueProcessor
280
280
  };
281
- //# sourceMappingURL=processor-LDLRELLS.js.map
281
+ //# sourceMappingURL=processor-UTBTJVV5.js.map
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-YQJ6HEFS.js";
4
- import "./chunk-UOBJP4GN.js";
3
+ } from "./chunk-772W5PF7.js";
4
+ import "./chunk-V4BEYGBJ.js";
5
5
  import "./chunk-ORIPUMOQ.js";
6
- import "./chunk-2V6QL6IW.js";
6
+ import "./chunk-NELDQCPC.js";
7
7
  import "./chunk-T3S5MTMD.js";
8
8
  import "./chunk-WLJJRX22.js";
9
9
  import "./chunk-DQTN4B33.js";
10
10
  import "./chunk-IJ53Y77N.js";
11
- import "./chunk-ABXERHIY.js";
12
- import "./chunk-ESHP42KO.js";
13
- import "./chunk-AJMBQMJH.js";
11
+ import "./chunk-F6QMFCHQ.js";
12
+ import "./chunk-LNJOQAXT.js";
13
+ import "./chunk-EJKAN7HK.js";
14
14
  import "./chunk-OAN4BXEW.js";
15
15
  import "./chunk-DJH6LMBT.js";
16
16
  import "./chunk-PHR64A6U.js";
@@ -47,7 +47,7 @@ import "./chunk-J2GP3J3X.js";
47
47
  import "./chunk-YNMP647F.js";
48
48
  import {
49
49
  VERSION
50
- } from "./chunk-65KDNVRA.js";
50
+ } from "./chunk-DKHY5UNR.js";
51
51
  import "./chunk-JYYBSODN.js";
52
52
  import "./chunk-L2RESXUF.js";
53
53
  import "./chunk-TS5WKTFB.js";
@@ -250,4 +250,4 @@ async function runServe(options) {
250
250
  export {
251
251
  runServe
252
252
  };
253
- //# sourceMappingURL=serve-A4AJAH2N.js.map
253
+ //# sourceMappingURL=serve-XGIHFEC6.js.map
@@ -345,6 +345,7 @@ declare class SessionManager {
345
345
  private announcedToolFingerprintStore;
346
346
  private warmedUpSessions;
347
347
  private unknownProviderWarned;
348
+ private subAgentContextSizes;
348
349
  private switchLocks;
349
350
  private workspaceCreationLocks;
350
351
  private pauseStates;
@@ -651,6 +652,8 @@ declare class SessionManager {
651
652
  * the currently selected model's limit).
652
653
  */
653
654
  setCurrentContextSize(sessionId: string, promptTokens: number, completionTokens?: number, subAgentId?: string): void;
655
+ /** Tokens used by a sub-agent's own scoped context (fresh, never-compacted). */
656
+ getSubAgentContextTokens(subAgentId: string): number | undefined;
654
657
  /**
655
658
  * Set criteria. Delegates to EventStore.
656
659
  */
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  createServer,
3
3
  createServerHandle
4
- } from "../chunk-YQJ6HEFS.js";
5
- import "../chunk-UOBJP4GN.js";
4
+ } from "../chunk-772W5PF7.js";
5
+ import "../chunk-V4BEYGBJ.js";
6
6
  import "../chunk-ORIPUMOQ.js";
7
- import "../chunk-2V6QL6IW.js";
7
+ import "../chunk-NELDQCPC.js";
8
8
  import "../chunk-T3S5MTMD.js";
9
9
  import "../chunk-WLJJRX22.js";
10
10
  import "../chunk-DQTN4B33.js";
11
11
  import "../chunk-IJ53Y77N.js";
12
- import "../chunk-ABXERHIY.js";
13
- import "../chunk-ESHP42KO.js";
14
- import "../chunk-AJMBQMJH.js";
12
+ import "../chunk-F6QMFCHQ.js";
13
+ import "../chunk-LNJOQAXT.js";
14
+ import "../chunk-EJKAN7HK.js";
15
15
  import "../chunk-OAN4BXEW.js";
16
16
  import "../chunk-DJH6LMBT.js";
17
17
  import "../chunk-PHR64A6U.js";
@@ -42,7 +42,7 @@ import "../chunk-AWBV2VXO.js";
42
42
  import "../chunk-OA2FURC3.js";
43
43
  import "../chunk-J2GP3J3X.js";
44
44
  import "../chunk-YNMP647F.js";
45
- import "../chunk-65KDNVRA.js";
45
+ import "../chunk-DKHY5UNR.js";
46
46
  import "../chunk-JYYBSODN.js";
47
47
  import "../chunk-L2RESXUF.js";
48
48
  import "../chunk-TS5WKTFB.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createWebSocketServer,
3
3
  signalMcpReady
4
- } from "./chunk-UOBJP4GN.js";
4
+ } from "./chunk-V4BEYGBJ.js";
5
5
  import "./chunk-ORIPUMOQ.js";
6
- import "./chunk-2V6QL6IW.js";
7
- import "./chunk-ABXERHIY.js";
8
- import "./chunk-ESHP42KO.js";
9
- import "./chunk-AJMBQMJH.js";
6
+ import "./chunk-NELDQCPC.js";
7
+ import "./chunk-F6QMFCHQ.js";
8
+ import "./chunk-LNJOQAXT.js";
9
+ import "./chunk-EJKAN7HK.js";
10
10
  import "./chunk-OAN4BXEW.js";
11
11
  import "./chunk-DJH6LMBT.js";
12
12
  import "./chunk-PHR64A6U.js";
@@ -59,4 +59,4 @@ export {
59
59
  createWebSocketServer,
60
60
  signalMcpReady
61
61
  };
62
- //# sourceMappingURL=server-A3EGJ6MD.js.map
62
+ //# sourceMappingURL=server-F66GXJUS.js.map
@@ -10,7 +10,7 @@ import {
10
10
  setTasksService,
11
11
  stepDoneTool,
12
12
  validateToolAction
13
- } from "./chunk-AJMBQMJH.js";
13
+ } from "./chunk-EJKAN7HK.js";
14
14
  import "./chunk-OAN4BXEW.js";
15
15
  import "./chunk-DJH6LMBT.js";
16
16
  import "./chunk-PHR64A6U.js";
@@ -92,4 +92,4 @@ export {
92
92
  stepDoneTool,
93
93
  validateToolAction
94
94
  };
95
- //# sourceMappingURL=tools-MRC27SZG.js.map
95
+ //# sourceMappingURL=tools-NIOESJYT.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-2OMGR7LN.js";
4
4
  import {
5
5
  VERSION
6
- } from "./chunk-65KDNVRA.js";
6
+ } from "./chunk-DKHY5UNR.js";
7
7
  import "./chunk-24YKXKCG.js";
8
8
  import "./chunk-CQGTEGKL.js";
9
9
  import "./chunk-YLJ4XMA6.js";
@@ -73,4 +73,4 @@ async function runUpdate(options = {}) {
73
73
  export {
74
74
  runUpdate
75
75
  };
76
- //# sourceMappingURL=update-MLDVVG3D.js.map
76
+ //# sourceMappingURL=update-X6BS6MUF.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "2.0.147",
3
+ "version": "2.0.148",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +0,0 @@
1
- // src/constants.ts
2
- var VERSION = "2.0.147";
3
-
4
- export {
5
- VERSION
6
- };
7
- //# sourceMappingURL=chunk-65KDNVRA.js.map