@adhdev/daemon-core 0.9.82-rc.225 → 0.9.82-rc.226

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
@@ -1887,6 +1887,7 @@ function buildRulesSection(coordinatorCliType) {
1887
1887
  - **Refinery is config-driven.** \`mesh_refine_node\` must run validation from \`.adhdev/refine.{json,yaml,yml}\` or \`repo-mesh.refine.*\`. Heuristics are scaffolding only.
1888
1888
  - **Submodule reachability = publish-needed.** \`submodule_reachability_failed\` \u2192 classify as \`blocked_review\`, request user approval to push to submodule main, then rerun \`mesh_refine_node\`.
1889
1889
  - **Honor per-node instructions.** When a node carries a \u{1F4CC} Node instruction in the nodes section, include the relevant parts of that instruction in the task message you send to that node. Don't paraphrase the instruction into your own words \u2014 quote it verbatim so the worker agent sees exactly what the user wrote.
1890
+ - **Mission status does not update itself.** When a mission's tasks are all done or the work is abandoned, explicitly call \`mesh_mission_upsert\` to set status \`completed\` or \`abandoned\`. Never leave a finished mission in \`active\`. All-cancelled tasks with no further work \u2192 \`abandoned\`.
1890
1891
  - **Never fabricate tool results.** Always call the actual tool.
1891
1892
  - **Keep the user informed.** One or two sentences after each delegation round.${coordinatorNote}`;
1892
1893
  }
@@ -6694,6 +6695,13 @@ function tryAssignQueueTask(components, meshId, nodeId, sessionId, providerType)
6694
6695
  return true;
6695
6696
  }
6696
6697
  }
6698
+ try {
6699
+ const inst = components.instanceManager.getInstance(sessionId);
6700
+ if (inst && typeof inst.updateSettings === "function") {
6701
+ inst.updateSettings({ meshNodeFor: meshId, meshNodeId: nodeId, launchedByCoordinator: true });
6702
+ }
6703
+ } catch {
6704
+ }
6697
6705
  const delivery = createSessionDelivery({
6698
6706
  meshId,
6699
6707
  nodeId,
@@ -30599,7 +30607,8 @@ var CliProviderInstance = class {
30599
30607
  typeof adapterStatus?.providerSessionId === "string" ? adapterStatus.providerSessionId : ""
30600
30608
  );
30601
30609
  const autoApproveActive = this.maybeAutoApproveStatus(adapterStatus, Date.now());
30602
- let visibleStatus = parseErrorMessage || parsedStatus?.status === "error" ? "error" : autoApproveActive ? "generating" : adapterStatus.status;
30610
+ const autoApproveHoldIdle = this.autoApproveBusy && adapterStatus.status === "idle";
30611
+ let visibleStatus = parseErrorMessage || parsedStatus?.status === "error" ? "error" : autoApproveActive || autoApproveHoldIdle ? "generating" : adapterStatus.status;
30603
30612
  const externalNativeFinal = this.getExternalNativeFinalReconciliation(parsedStatus?.messages, adapterStatus);
30604
30613
  if (externalNativeFinal && isCliGeneratingLikeStatus(visibleStatus)) {
30605
30614
  visibleStatus = "idle";
@@ -30686,7 +30695,7 @@ var CliProviderInstance = class {
30686
30695
  summaryMetadata: this.summaryMetadata,
30687
30696
  controlValues: this.controlValues
30688
30697
  });
30689
- const activeChatStatus = parseErrorMessage ? "error" : autoApproveActive && parsedStatus?.status === "waiting_approval" ? "generating" : adapterStatus.status !== "idle" ? visibleStatus : suppressStaleParsedBusyStatus ? visibleStatus : parsedChatStatus || visibleStatus;
30698
+ const activeChatStatus = parseErrorMessage ? "error" : autoApproveActive && parsedStatus?.status === "waiting_approval" || autoApproveHoldIdle ? "generating" : adapterStatus.status !== "idle" ? visibleStatus : suppressStaleParsedBusyStatus ? visibleStatus : parsedChatStatus || visibleStatus;
30690
30699
  const hasInteractivePrompt = !!this.activeInteractivePrompt;
30691
30700
  const finalStatus = hasInteractivePrompt ? "waiting_choice" : visibleStatus;
30692
30701
  const finalChatStatus = hasInteractivePrompt ? "waiting_choice" : activeChatStatus;
@@ -30701,7 +30710,7 @@ var CliProviderInstance = class {
30701
30710
  title: parsedStatus?.title || dirName,
30702
30711
  status: finalChatStatus,
30703
30712
  messages: statusMessages,
30704
- activeModal: autoApproveActive ? null : parsedStatus?.activeModal ?? adapterStatus.activeModal,
30713
+ activeModal: autoApproveActive || autoApproveHoldIdle ? null : parsedStatus?.activeModal ?? adapterStatus.activeModal,
30705
30714
  activeInteractivePrompt: this.activeInteractivePrompt,
30706
30715
  inputContent: ""
30707
30716
  },
@@ -30743,7 +30752,8 @@ var CliProviderInstance = class {
30743
30752
  getHotChatSessionState() {
30744
30753
  const adapterStatus = this.adapter.getStatus({ allowParse: false });
30745
30754
  const autoApproveActive = adapterStatus.status === "waiting_approval" && this.shouldAutoApprove();
30746
- const visibleStatus = autoApproveActive ? "generating" : adapterStatus.status;
30755
+ const autoApproveHoldIdle = this.autoApproveBusy && adapterStatus.status === "idle";
30756
+ const visibleStatus = autoApproveActive || autoApproveHoldIdle ? "generating" : adapterStatus.status;
30747
30757
  const runtime = this.adapter.getRuntimeMetadata();
30748
30758
  return {
30749
30759
  id: this.instanceId,
@@ -30757,7 +30767,8 @@ var CliProviderInstance = class {
30757
30767
  getSessionModalState(sessionId) {
30758
30768
  const adapterStatus = this.adapter.getStatus({ allowParse: true });
30759
30769
  const autoApproveActive = adapterStatus.status === "waiting_approval" && this.shouldAutoApprove();
30760
- const visibleStatus = autoApproveActive ? "generating" : adapterStatus.status;
30770
+ const autoApproveHoldIdle = this.autoApproveBusy && adapterStatus.status === "idle";
30771
+ const visibleStatus = autoApproveActive || autoApproveHoldIdle ? "generating" : adapterStatus.status;
30761
30772
  const dirName = this.workingDir.split("/").filter(Boolean).pop() || "session";
30762
30773
  return {
30763
30774
  // Honor the caller-supplied sessionId — InstanceMgr rejects the
@@ -30767,7 +30778,7 @@ var CliProviderInstance = class {
30767
30778
  id: sessionId ?? this.instanceId,
30768
30779
  status: visibleStatus,
30769
30780
  title: dirName,
30770
- activeModal: autoApproveActive ? null : adapterStatus.activeModal
30781
+ activeModal: autoApproveActive || autoApproveHoldIdle ? null : adapterStatus.activeModal
30771
30782
  };
30772
30783
  }
30773
30784
  updateSettings(newSettings) {