@adhdev/daemon-core 0.9.82-rc.390 → 0.9.82-rc.392

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.mjs CHANGED
@@ -378,10 +378,10 @@ function readInjected(value) {
378
378
  }
379
379
  function getDaemonBuildInfo() {
380
380
  if (cached) return cached;
381
- const commit = readInjected(true ? "25bb0512a5fd46999cb1fe21ef4ab7e2ed23a6c6" : void 0) ?? "unknown";
382
- const commitShort = readInjected(true ? "25bb0512" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
383
- const version = readInjected(true ? "0.9.82-rc.390" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
384
- const builtAt = readInjected(true ? "2026-06-26T09:55:40.652Z" : void 0);
381
+ const commit = readInjected(true ? "62225119ccdbf6c3c153a4225ff6ba2032ad87e1" : void 0) ?? "unknown";
382
+ const commitShort = readInjected(true ? "62225119" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
383
+ const version = readInjected(true ? "0.9.82-rc.392" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
384
+ const builtAt = readInjected(true ? "2026-06-26T12:23:33.380Z" : void 0);
385
385
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
386
386
  return cached;
387
387
  }
@@ -14574,21 +14574,32 @@ function injectMeshSystemMessage(components, args) {
14574
14574
  }
14575
14575
  }
14576
14576
  if (sessionId && nodeId && providerType) {
14577
+ let worktreeBootstrapPending = false;
14578
+ try {
14579
+ const mesh = getMeshWithCache(components, args.meshId);
14580
+ const node = mesh?.nodes?.find((n) => meshNodeIdMatches(n, nodeId));
14581
+ worktreeBootstrapPending = node?.worktreeBootstrap?.status === "running";
14582
+ } catch {
14583
+ }
14577
14584
  sweepExpiredRemoteIdleSessions();
14578
14585
  try {
14579
14586
  MeshRuntimeStore.getInstance().setRemoteIdleSession(args.meshId, nodeId, sessionId, providerType, Date.now() + REMOTE_IDLE_SESSION_TTL_MS);
14580
14587
  } catch {
14581
14588
  }
14582
- setImmediate(() => {
14583
- maybeAutoFastForwardIdleNode(components, { meshId: args.meshId, nodeId, sessionId, providerType }).finally(() => {
14584
- try {
14585
- const assigned = tryAssignQueueTask(components, args.meshId, nodeId, sessionId, providerType);
14586
- if (assigned) MeshRuntimeStore.getInstance().deleteRemoteIdleSession(args.meshId, nodeId, sessionId);
14587
- } catch (e) {
14588
- LOG.warn("MeshQueue", `Failed to assign idle queue task after maintenance for ${nodeId}: ${e?.message || e}`);
14589
- }
14589
+ if (worktreeBootstrapPending) {
14590
+ LOG.info("MeshQueue", `Deferring queue claim for worktree node ${nodeId} (${sessionId}): worktree bootstrap still running \u2014 early agent:ready precedes bootstrap completion; the idle session is registered and the claim will re-fire once bootstrap finishes (guards against dispatching into a half-built worktree \u2192 empty session / work leaking to the base node)`);
14591
+ } else {
14592
+ setImmediate(() => {
14593
+ maybeAutoFastForwardIdleNode(components, { meshId: args.meshId, nodeId, sessionId, providerType }).finally(() => {
14594
+ try {
14595
+ const assigned = tryAssignQueueTask(components, args.meshId, nodeId, sessionId, providerType);
14596
+ if (assigned) MeshRuntimeStore.getInstance().deleteRemoteIdleSession(args.meshId, nodeId, sessionId);
14597
+ } catch (e) {
14598
+ LOG.warn("MeshQueue", `Failed to assign idle queue task after maintenance for ${nodeId}: ${e?.message || e}`);
14599
+ }
14600
+ });
14590
14601
  });
14591
- });
14602
+ }
14592
14603
  }
14593
14604
  } else if (args.event === "agent:generating_started") {
14594
14605
  const sessionId = resolveEventSessionId(args.metadataEvent, args.sourceInstanceId);