@adhdev/daemon-core 0.9.76-rc.46 → 0.9.76-rc.48

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.
package/dist/index.js CHANGED
@@ -20593,7 +20593,7 @@ function formatCompletionMetadata(event) {
20593
20593
  function buildMeshSystemMessage(args) {
20594
20594
  const metadata = formatCompletionMetadata(args.metadataEvent);
20595
20595
  if (args.event === "agent:generating_completed") {
20596
- return `[System] ${args.nodeLabel} has completed its task and is now idle${metadata}. You may use mesh_read_chat to review its progress.`;
20596
+ return `[System] ${args.nodeLabel} has completed its task and is now idle${metadata}. This completion came from the agent status event path; use mesh_read_chat once to review its final progress, but do not poll repeatedly.`;
20597
20597
  }
20598
20598
  if (args.event === "agent:waiting_approval") {
20599
20599
  return `[System] ${args.nodeLabel} is waiting for approval to proceed${metadata}. You may use mesh_read_chat and mesh_approve to handle it.`;
@@ -21546,6 +21546,7 @@ var DaemonCommandRouter = class {
21546
21546
  const stoppedSessionIds = [];
21547
21547
  const deletedSessionIds = [];
21548
21548
  const skippedSessionIds = [];
21549
+ const deleteUnsupportedSessionIds = [];
21549
21550
  const errors = [];
21550
21551
  for (const record of matched) {
21551
21552
  const sessionId = String(record.sessionId);
@@ -21575,7 +21576,22 @@ var DaemonCommandRouter = class {
21575
21576
  continue;
21576
21577
  }
21577
21578
  } catch (e) {
21578
- errors.push({ sessionId, error: e?.message || String(e) });
21579
+ const message = e?.message || String(e);
21580
+ if (message.includes("Unsupported session host request: delete_session") && (args.mode === "delete_stopped" || args.mode === "stop_and_delete")) {
21581
+ deleteUnsupportedSessionIds.push(sessionId);
21582
+ if (args.mode === "stop_and_delete" && !completed) {
21583
+ try {
21584
+ await this.deps.sessionHostControl.stopSession(sessionId);
21585
+ stoppedSessionIds.push(sessionId);
21586
+ } catch (stopError) {
21587
+ errors.push({ sessionId, error: stopError?.message || String(stopError) });
21588
+ continue;
21589
+ }
21590
+ }
21591
+ skippedSessionIds.push(sessionId);
21592
+ continue;
21593
+ }
21594
+ errors.push({ sessionId, error: message });
21579
21595
  }
21580
21596
  }
21581
21597
  return {
@@ -21586,6 +21602,7 @@ var DaemonCommandRouter = class {
21586
21602
  stoppedSessionIds,
21587
21603
  deletedSessionIds,
21588
21604
  skippedSessionIds,
21605
+ ...deleteUnsupportedSessionIds.length ? { deleteUnsupportedSessionIds } : {},
21589
21606
  ...errors.length ? { errors } : {}
21590
21607
  };
21591
21608
  }