@ponythewhite/base-context 1.0.9 → 1.0.11

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 (80) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/base-context-runtime/pyproject.toml +1 -1
  3. package/dist/base-context-runtime/uv.lock +1 -1
  4. package/dist/build-info.json +1 -1
  5. package/dist/bundle/{bundled-modules-5JRM6P4T.js → bundled-modules-PEFT72QN.js} +2 -2
  6. package/dist/bundle/{chunk-VVI3UKGR.js → chunk-JZHGOOFM.js} +87 -57
  7. package/dist/bundle/{chunk-NEHLB7JV.js → chunk-TOOVREMP.js} +596 -102
  8. package/dist/bundle/{cli-main-YUDBEYE2.js → cli-main-BRXGYTGK.js} +2 -2
  9. package/dist/bundle/cli.js +1 -1
  10. package/dist/bundle/{main-ZLGGAAGU.js → main-POUXGEL6.js} +2 -2
  11. package/dist/core/agent-session.d.ts +0 -1
  12. package/dist/core/agent-session.d.ts.map +1 -1
  13. package/dist/core/agent-session.js +85 -45
  14. package/dist/core/agent-session.js.map +1 -1
  15. package/dist/core/canonical-context.d.ts +19 -3
  16. package/dist/core/canonical-context.d.ts.map +1 -1
  17. package/dist/core/canonical-context.js +245 -39
  18. package/dist/core/canonical-context.js.map +1 -1
  19. package/dist/core/context-epoch-copy.d.ts +1 -1
  20. package/dist/core/context-epoch-copy.d.ts.map +1 -1
  21. package/dist/core/context-epoch-copy.js +18 -7
  22. package/dist/core/context-epoch-copy.js.map +1 -1
  23. package/dist/core/context-epoch.d.ts +18 -3
  24. package/dist/core/context-epoch.d.ts.map +1 -1
  25. package/dist/core/context-epoch.js +13 -2
  26. package/dist/core/context-epoch.js.map +1 -1
  27. package/dist/core/context-tree.d.ts +1 -1
  28. package/dist/core/context-tree.d.ts.map +1 -1
  29. package/dist/core/context-tree.js +98 -8
  30. package/dist/core/context-tree.js.map +1 -1
  31. package/dist/core/history-index-worker.d.ts.map +1 -1
  32. package/dist/core/history-index-worker.js +59 -6
  33. package/dist/core/history-index-worker.js.map +1 -1
  34. package/dist/core/history-index.d.ts +17 -0
  35. package/dist/core/history-index.d.ts.map +1 -1
  36. package/dist/core/history-index.js +22 -0
  37. package/dist/core/history-index.js.map +1 -1
  38. package/dist/core/inference-coordinator.d.ts.map +1 -1
  39. package/dist/core/inference-coordinator.js +5 -1
  40. package/dist/core/inference-coordinator.js.map +1 -1
  41. package/dist/core/public-context.d.ts.map +1 -1
  42. package/dist/core/public-context.js +20 -8
  43. package/dist/core/public-context.js.map +1 -1
  44. package/dist/core/request-view-selection.d.ts +2 -1
  45. package/dist/core/request-view-selection.d.ts.map +1 -1
  46. package/dist/core/request-view-selection.js +29 -2
  47. package/dist/core/request-view-selection.js.map +1 -1
  48. package/dist/core/session-fork-messages.d.ts +5 -0
  49. package/dist/core/session-fork-messages.d.ts.map +1 -1
  50. package/dist/core/session-fork-messages.js +44 -0
  51. package/dist/core/session-fork-messages.js.map +1 -1
  52. package/dist/core/session-history-index.d.ts +5 -0
  53. package/dist/core/session-history-index.d.ts.map +1 -1
  54. package/dist/core/session-history-index.js +7 -0
  55. package/dist/core/session-history-index.js.map +1 -1
  56. package/dist/core/session-manager.d.ts +2 -0
  57. package/dist/core/session-manager.d.ts.map +1 -1
  58. package/dist/core/session-manager.js +155 -13
  59. package/dist/core/session-manager.js.map +1 -1
  60. package/dist/core/session-tree.d.ts +9 -0
  61. package/dist/core/session-tree.d.ts.map +1 -1
  62. package/dist/core/session-tree.js +71 -11
  63. package/dist/core/session-tree.js.map +1 -1
  64. package/dist/modes/agent-connection/in-process-agent-connection.d.ts.map +1 -1
  65. package/dist/modes/agent-connection/in-process-agent-connection.js +4 -4
  66. package/dist/modes/agent-connection/in-process-agent-connection.js.map +1 -1
  67. package/dist/modes/daemon/daemon-mode.d.ts.map +1 -1
  68. package/dist/modes/daemon/daemon-mode.js +19 -34
  69. package/dist/modes/daemon/daemon-mode.js.map +1 -1
  70. package/dist/modes/daemon/daemon-socket.d.ts +5 -0
  71. package/dist/modes/daemon/daemon-socket.d.ts.map +1 -1
  72. package/dist/modes/daemon/daemon-socket.js +19 -0
  73. package/dist/modes/daemon/daemon-socket.js.map +1 -1
  74. package/dist/modes/daemon/daemon-supervisor.d.ts.map +1 -1
  75. package/dist/modes/daemon/daemon-supervisor.js +6 -7
  76. package/dist/modes/daemon/daemon-supervisor.js.map +1 -1
  77. package/dist/modes/daemon/daemon-worker-client.d.ts.map +1 -1
  78. package/dist/modes/daemon/daemon-worker-client.js +5 -5
  79. package/dist/modes/daemon/daemon-worker-client.js.map +1 -1
  80. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.11] - 2026-09-20
4
+
5
+ - Fixed recovery compaction in long-running sessions that use `prime_context` without a request-budget profile.
6
+ - Fixed automatic recovery after reopening a session without a saved replay contract.
7
+ - Fixed recovery summaries after an over-budget request or a previous compaction while preserving native replay checks.
8
+ - Fixed opening large sessions from the session tree, listing sessions, and loading snapshots when a journal exceeds 64 MiB.
9
+ - Fixed optional replay-contract capture rejecting otherwise valid full-native requests with payload-hook metadata.
10
+ - Fixed `/tree`, `/context`, and the fork-message picker reading unrelated private request bodies from large session journals.
11
+ - Fixed refinement history loading failing on large unrelated session archives.
12
+ - Fixed small selected forks failing because unrelated history exceeded the source-read limit, while preserving required copy dependencies and output limits.
13
+
14
+ ## [1.0.10] - 2026-09-19
15
+
16
+ - Fixed session attachment disconnecting during concurrent transcript updates.
17
+ - Fixed worker request timeouts and connection closure hanging behind blocked socket writes.
18
+ - Fixed daemon shutdown waiting indefinitely for half-open client connections.
19
+ - Fixed idle eviction blocking the release of an existing session input pause.
20
+ - Fixed cold resume after an interruption before tool admission, preserving incomplete tool calls as historical data without rerunning them.
21
+
3
22
  ## [1.0.9] - 2026-09-19
4
23
 
5
24
  - Fixed compaction and context checkpoint adoption rejecting concurrent child usage and session bookkeeping updates as branch changes. Real conversation, source, and branch changes still invalidate stale summaries.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "base-context-runtime"
3
- version = "1.0.9"
3
+ version = "1.0.11"
4
4
  description = "Kernel-side runtime shim for Base Context recursion"
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE", "NOTICE"]
@@ -367,7 +367,7 @@ wheels = [
367
367
 
368
368
  [[package]]
369
369
  name = "base-context-runtime"
370
- version = "1.0.9"
370
+ version = "1.0.11"
371
371
  source = { editable = "." }
372
372
  dependencies = [
373
373
  { name = "mcp" },
@@ -1,5 +1,5 @@
1
1
  {
2
- "sourceCommit": "f789ed267456bc355aee0445e27fa0fd5ba45dd1",
2
+ "sourceCommit": "67d926ccc3c680e5197852b7ac34dd2cc69c61f9",
3
3
  "sourceDirty": false,
4
4
  "buildHost": {
5
5
  "platform": "linux",
@@ -51,7 +51,7 @@ import {
51
51
  oauth_exports,
52
52
  runPrintMode,
53
53
  runRpcMode
54
- } from "./chunk-VVI3UKGR.js";
54
+ } from "./chunk-JZHGOOFM.js";
55
55
  import {
56
56
  AgentSession,
57
57
  CURRENT_SESSION_VERSION,
@@ -143,7 +143,7 @@ import {
143
143
  withFileMutationQueue,
144
144
  wrapRegisteredTool,
145
145
  wrapRegisteredTools
146
- } from "./chunk-NEHLB7JV.js";
146
+ } from "./chunk-TOOVREMP.js";
147
147
  import "./chunk-CFNASUYO.js";
148
148
  import "./chunk-QKIFBA7N.js";
149
149
  import {
@@ -140,6 +140,7 @@ import {
140
140
  clearOrphanProcessJournal,
141
141
  clippedFullscreenDockHeight,
142
142
  cloneUsage,
143
+ closeDaemonServer,
143
144
  closeWatcher,
144
145
  collectDaemonClientEnv,
145
146
  collectDaemonLaunchEnv,
@@ -295,7 +296,7 @@ import {
295
296
  readSessionBootstrap,
296
297
  readSessionInfo,
297
298
  readSessionJournalHeader,
298
- readUserMessagesForForking,
299
+ readVisibleUserMessagesForForking,
299
300
  renderDiff,
300
301
  renderDiffSeparator,
301
302
  renderRichDiff,
@@ -348,7 +349,7 @@ import {
348
349
  watchWithErrorHandler,
349
350
  workerRosterEntryFromSummary,
350
351
  wrapTextWithAnsi
351
- } from "./chunk-NEHLB7JV.js";
352
+ } from "./chunk-TOOVREMP.js";
352
353
  import {
353
354
  array,
354
355
  boolean,
@@ -17361,16 +17362,14 @@ var DaemonWorkerClient = class {
17361
17362
  }, timeoutMs);
17362
17363
  this.pending.set(id, { resolve: resolve26, reject, timeout });
17363
17364
  });
17364
- try {
17365
- await this.channel.send({ kind: "command", requestId: id, commandType: command.type }, Buffer.from(serializeJsonLine(fullCommand)));
17366
- } catch (error) {
17365
+ void this.channel.send({ kind: "command", requestId: id, commandType: command.type }, Buffer.from(serializeJsonLine(fullCommand))).catch((error) => {
17367
17366
  const pending = this.pending.get(id);
17368
17367
  if (pending) {
17369
17368
  clearTimeout(pending.timeout);
17370
17369
  this.pending.delete(id);
17371
17370
  pending.reject(error instanceof Error ? error : new Error(String(error)));
17372
17371
  }
17373
- }
17372
+ });
17374
17373
  return response;
17375
17374
  }
17376
17375
  handleFrame(frame) {
@@ -31876,6 +31875,67 @@ function buildSessionTreeFromFlatNodes(flatNodes) {
31876
31875
  }
31877
31876
  return roots;
31878
31877
  }
31878
+ function applyTreeUsageOverlays(entries2) {
31879
+ const assistants = new Map(entries2.filter((entry) => entry.type === "message" && entry.message.role === "assistant").map((entry) => [entry.id, entry]));
31880
+ for (const entry of entries2) {
31881
+ if (entry.type !== "child_usage_attributed")
31882
+ continue;
31883
+ const target = assistants.get(entry.targetId);
31884
+ if (target?.type === "message" && target.message.role === "assistant")
31885
+ target.message.usage = cloneUsage(entry.aggregateUsage);
31886
+ }
31887
+ }
31888
+ async function readVisibleSessionTreeFlatNodes(manager, limits = DEFAULT_SESSION_TREE_LIMITS) {
31889
+ const { maxEntries, maxSourceBytes } = limits;
31890
+ if (!Number.isSafeInteger(maxEntries) || maxEntries <= 0 || !Number.isSafeInteger(maxSourceBytes) || maxSourceBytes <= 0)
31891
+ throw new Error("Invalid history materialization limits");
31892
+ if (!manager.supportsCapturedHistoryReads())
31893
+ return readSessionTreeFlatNodes(manager, { maxEntries, maxSourceBytes });
31894
+ return manager.readSourceHistory(async (history) => {
31895
+ const entries2 = [];
31896
+ const visibleIds = /* @__PURE__ */ new Set();
31897
+ let sourceBytes = 0;
31898
+ let after = 0;
31899
+ for (; ; ) {
31900
+ const page = await history.page(after);
31901
+ if (page.indexedThrough < history.source.sourceSequence)
31902
+ throw new Error("Captured history has incomplete index coverage");
31903
+ for (const ref of page.events) {
31904
+ if (ref.kind === "request" || ref.kind === "tool_intent")
31905
+ continue;
31906
+ if (entries2.length >= maxEntries)
31907
+ throw new Error("History entry budget exceeded");
31908
+ if (sourceBytes + ref.locator.length > maxSourceBytes)
31909
+ throw new Error("History source byte budget exceeded");
31910
+ const hydrated = await history.hydrateEntry(ref.id, maxSourceBytes - sourceBytes);
31911
+ if (!hydrated)
31912
+ throw new Error("Session tree entry source is unavailable");
31913
+ sourceBytes += ref.locator.length;
31914
+ let parentId = ref.parentId;
31915
+ while (parentId !== null && !visibleIds.has(parentId)) {
31916
+ const parent = await history.get(parentId);
31917
+ if (!parent || parent.kind !== "request" && parent.kind !== "tool_intent")
31918
+ break;
31919
+ parentId = parent.parentId;
31920
+ }
31921
+ hydrated.entry.parentId = parentId;
31922
+ entries2.push(hydrated.entry);
31923
+ visibleIds.add(ref.id);
31924
+ }
31925
+ if (page.nextAfter === null)
31926
+ break;
31927
+ after = page.nextAfter;
31928
+ }
31929
+ applyTreeUsageOverlays(entries2);
31930
+ const result = { flatNodes: buildSessionTreeFlatNodes(entries2), leafId: history.source.leafId };
31931
+ stringifyBoundedJson(result, maxSourceBytes);
31932
+ return result;
31933
+ });
31934
+ }
31935
+ async function readVisibleSessionTree(manager, limits = DEFAULT_SESSION_TREE_LIMITS) {
31936
+ const { flatNodes, leafId } = await readVisibleSessionTreeFlatNodes(manager, limits);
31937
+ return { tree: buildSessionTreeFromFlatNodes(flatNodes), leafId };
31938
+ }
31879
31939
  async function readSessionTreeFlatNodes(manager, limits = DEFAULT_SESSION_TREE_LIMITS) {
31880
31940
  const capturedLimits = { ...limits };
31881
31941
  let entries2;
@@ -31884,14 +31944,7 @@ async function readSessionTreeFlatNodes(manager, limits = DEFAULT_SESSION_TREE_L
31884
31944
  const history = await manager.materializeSourceHistory(capturedLimits);
31885
31945
  entries2 = history.entries.map(({ entry }) => entry);
31886
31946
  leafId = history.source.leafId;
31887
- const assistants = new Map(entries2.filter((entry) => entry.type === "message" && entry.message.role === "assistant").map((entry) => [entry.id, entry]));
31888
- for (const entry of entries2) {
31889
- if (entry.type !== "child_usage_attributed")
31890
- continue;
31891
- const target = assistants.get(entry.targetId);
31892
- if (target?.type === "message" && target.message.role === "assistant")
31893
- target.message.usage = cloneUsage(entry.aggregateUsage);
31894
- }
31947
+ applyTreeUsageOverlays(entries2);
31895
31948
  } else {
31896
31949
  const history = manager.materializeResidentHistory(capturedLimits);
31897
31950
  entries2 = history.entries;
@@ -31899,10 +31952,6 @@ async function readSessionTreeFlatNodes(manager, limits = DEFAULT_SESSION_TREE_L
31899
31952
  }
31900
31953
  return { flatNodes: buildSessionTreeFlatNodes(entries2), leafId };
31901
31954
  }
31902
- async function readSessionTree(manager, limits = DEFAULT_SESSION_TREE_LIMITS) {
31903
- const { flatNodes, leafId } = await readSessionTreeFlatNodes(manager, limits);
31904
- return { tree: buildSessionTreeFromFlatNodes(flatNodes), leafId };
31905
- }
31906
31955
 
31907
31956
  // dist/core/side-question.js
31908
31957
  var SIDE_QUESTION_INSTRUCTION = "Answer this side question using only the conversation context above. Do not use tools. The user may send follow-up side questions; none of this side conversation is added to the main session.";
@@ -32406,7 +32455,7 @@ var InProcessAgentConnection = class {
32406
32455
  return this.session.buildSessionContext();
32407
32456
  }
32408
32457
  async getSessionTree() {
32409
- return readSessionTree(this.session.sessionManager);
32458
+ return readVisibleSessionTree(this.session.sessionManager);
32410
32459
  }
32411
32460
  async listSavedSessions(scope, callbacks) {
32412
32461
  const sessionDir = this.session.sessionManager.getSessionDir() || void 0;
@@ -32491,7 +32540,7 @@ var InProcessAgentConnection = class {
32491
32540
  throw new Error("Agent messaging requires daemon mode");
32492
32541
  }
32493
32542
  async getUserMessagesForForking() {
32494
- return readUserMessagesForForking(this.session.sessionManager);
32543
+ return readVisibleUserMessagesForForking(this.session.sessionManager);
32495
32544
  }
32496
32545
  async getLastAssistantText() {
32497
32546
  return this.session.getLastAssistantText();
@@ -63467,7 +63516,7 @@ var AgentDaemon = class {
63467
63516
  });
63468
63517
  }
63469
63518
  if (streamsSnapshot) {
63470
- const snapshotId = `${state.activeSessionId}-${state.eventGeneration}-${state.lastEventSequence}`;
63519
+ const snapshotId = `${result.activeSessionId}-${result.lastEventCursor?.generation}-${result.lastEventSequence}`;
63471
63520
  let transcript;
63472
63521
  try {
63473
63522
  transcript = createSnapshotTranscriptChunks({
@@ -64384,12 +64433,12 @@ var AgentDaemon = class {
64384
64433
  }
64385
64434
  case "get_session_tree": {
64386
64435
  const state = this.getSessionState(command.activeSessionId);
64387
- return success(command.id, "get_session_tree", await readSessionTreeFlatNodes(state.runtime.session.sessionManager));
64436
+ return success(command.id, "get_session_tree", await readVisibleSessionTreeFlatNodes(state.runtime.session.sessionManager));
64388
64437
  }
64389
64438
  case "get_user_messages_for_forking": {
64390
64439
  const state = this.getSessionState(command.activeSessionId);
64391
64440
  return success(command.id, "get_user_messages_for_forking", {
64392
- messages: await readUserMessagesForForking(state.runtime.session.sessionManager)
64441
+ messages: await readVisibleUserMessagesForForking(state.runtime.session.sessionManager)
64393
64442
  });
64394
64443
  }
64395
64444
  case "get_last_assistant_text": {
@@ -64445,16 +64494,14 @@ var AgentDaemon = class {
64445
64494
  }
64446
64495
  async createAttachResult(client, state, command) {
64447
64496
  const snapshot = await this.createSessionSnapshot(state);
64497
+ const { lastEventSequence, lastEventCursor } = snapshot;
64448
64498
  const replay = command.resumeCursor?.activeSessionId && command.resumeCursor.activeSessionId !== state.activeSessionId ? {
64449
64499
  status: "unavailable",
64450
64500
  fromSequence: "sequence" in command.resumeCursor ? command.resumeCursor.sequence : command.resumeCursor.eventSequence,
64451
- toSequence: state.lastEventSequence,
64452
- toCursor: {
64453
- generation: state.eventGeneration,
64454
- sequence: state.lastEventSequence
64455
- },
64501
+ toSequence: lastEventSequence,
64502
+ toCursor: lastEventCursor,
64456
64503
  reason: "resume_cursor_session_mismatch"
64457
- } : createDaemonReplayInfo(command.resumeCursor, state.lastEventSequence, state.eventGeneration);
64504
+ } : createDaemonReplayInfo(command.resumeCursor, lastEventSequence, lastEventCursor?.generation);
64458
64505
  const capabilities = daemonClientCapabilitiesForSession(client, state.activeSessionId);
64459
64506
  const slim = capabilities.has("slim_attach");
64460
64507
  return {
@@ -64463,11 +64510,8 @@ var AgentDaemon = class {
64463
64510
  ...slim ? {} : { state: snapshot.summary, messages: snapshot.messages },
64464
64511
  snapshot,
64465
64512
  replay,
64466
- lastEventSequence: state.lastEventSequence,
64467
- lastEventCursor: {
64468
- generation: state.eventGeneration,
64469
- sequence: state.lastEventSequence
64470
- },
64513
+ lastEventSequence,
64514
+ lastEventCursor,
64471
64515
  client: {
64472
64516
  id: client.id,
64473
64517
  capabilities: [...capabilities]
@@ -65780,9 +65824,8 @@ Use prime_context read/search with selected lines or a query.`;
65780
65824
  }
65781
65825
  }
65782
65826
  beginReplacementSnapshot(client, state, message) {
65783
- const snapshotId = `${state.activeSessionId}-${state.eventGeneration}-${state.lastEventSequence}`;
65784
65827
  const snapshotSignal = markClientSnapshotStreaming(client, state.activeSessionId);
65785
- void this.prepareReplacementSnapshot(client, state, message, snapshotId, snapshotSignal).catch((error) => {
65828
+ void this.prepareReplacementSnapshot(client, state, message, snapshotSignal).catch((error) => {
65786
65829
  finishClientSnapshotStreaming(client, state.activeSessionId);
65787
65830
  this.log(`could not prepare replacement snapshot: ${String(error)}`);
65788
65831
  if (!client.socket.destroyed && this.sessions.get(state.activeSessionId) === state) {
@@ -65793,7 +65836,7 @@ Use prime_context read/search with selected lines or a query.`;
65793
65836
  }
65794
65837
  });
65795
65838
  }
65796
- async prepareReplacementSnapshot(client, state, message, snapshotId, snapshotSignal) {
65839
+ async prepareReplacementSnapshot(client, state, message, snapshotSignal) {
65797
65840
  const result = await this.createAttachResult(client, state, {
65798
65841
  type: "attach",
65799
65842
  activeSessionId: state.activeSessionId
@@ -65805,6 +65848,7 @@ Use prime_context read/search with selected lines or a query.`;
65805
65848
  }
65806
65849
  return;
65807
65850
  }
65851
+ const snapshotId = `${result.activeSessionId}-${result.lastEventCursor?.generation}-${result.lastEventSequence}`;
65808
65852
  const transcript = createSnapshotTranscriptChunks({
65809
65853
  activeSessionId: state.activeSessionId,
65810
65854
  snapshotId,
@@ -66147,10 +66191,10 @@ Use prime_context read/search with selected lines or a query.`;
66147
66191
  state: result.snapshot.state,
66148
66192
  messages: [],
66149
66193
  snapshotFollows: true,
66150
- meta: createDaemonEventMeta(activeSessionId, state.lastEventSequence, void 0, state.eventGeneration)
66194
+ meta: createDaemonEventMeta(activeSessionId, result.lastEventSequence, void 0, result.lastEventCursor?.generation)
66151
66195
  });
66152
66196
  }
66153
- const snapshotId = `${activeSessionId}-${state.eventGeneration}-${state.lastEventSequence}`;
66197
+ const snapshotId = `${result.activeSessionId}-${result.lastEventCursor?.generation}-${result.lastEventSequence}`;
66154
66198
  const snapshotSignal = markClientSnapshotStreaming(client, activeSessionId);
66155
66199
  let transcript;
66156
66200
  try {
@@ -66177,7 +66221,7 @@ Use prime_context read/search with selected lines or a query.`;
66177
66221
  }, transcript, purpose === "replacement" ? "replacement" : "catchup", snapshotSignal, true);
66178
66222
  continue;
66179
66223
  }
66180
- const meta = createDaemonEventMeta(activeSessionId, state.lastEventSequence, void 0, state.eventGeneration);
66224
+ const meta = createDaemonEventMeta(activeSessionId, result.lastEventSequence, void 0, result.lastEventCursor?.generation);
66181
66225
  const catchup = purpose === "replacement" ? {
66182
66226
  type: "session_replaced",
66183
66227
  activeSessionId,
@@ -66341,17 +66385,7 @@ Use prime_context read/search with selected lines or a query.`;
66341
66385
  shutdownFailure = true;
66342
66386
  this.log(`RLM journal shutdown failed: ${error instanceof Error ? error.message : String(error)}`);
66343
66387
  }
66344
- for (const client of this.clients) {
66345
- client.detachInput();
66346
- client.socket.end();
66347
- }
66348
- await new Promise((resolveClose) => {
66349
- if (!this.server) {
66350
- resolveClose();
66351
- return;
66352
- }
66353
- this.server.close(() => resolveClose());
66354
- });
66388
+ await closeDaemonServer(this.server, this.clients);
66355
66389
  this.cleanupSocketPath();
66356
66390
  process.exit(exitCode || (shutdownFailure ? 1 : 0));
66357
66391
  }
@@ -68077,7 +68111,7 @@ var DaemonSupervisor = class {
68077
68111
  this.write(client, failure(command.id, command.type, "Daemon is preparing an update restart"));
68078
68112
  return;
68079
68113
  }
68080
- if (mutation && !UPDATE_RESTART_DRAIN_COMMANDS.has(command.type)) {
68114
+ if (mutation && command.type !== "release_session_input_pause" && !UPDATE_RESTART_DRAIN_COMMANDS.has(command.type)) {
68081
68115
  const idleEvictionFence = this.idleEvictionFence;
68082
68116
  if (idleEvictionFence) {
68083
68117
  await idleEvictionFence;
@@ -72477,11 +72511,7 @@ var DaemonSupervisor = class {
72477
72511
  }
72478
72512
  }
72479
72513
  await this.catalog.stop();
72480
- for (const client of this.clients) {
72481
- client.detachInput();
72482
- client.socket.end();
72483
- }
72484
- await new Promise((resolveClose) => this.server?.close(() => resolveClose()) ?? resolveClose());
72514
+ await closeDaemonServer(this.server, this.clients);
72485
72515
  await this.runCleanupStep("daemon socket", () => this.cleanupSocket());
72486
72516
  await this.runCleanupStep("supervisor cache", () => {
72487
72517
  rmSync13(this.snapshotCacheRoot, { recursive: true, force: true });