@adhdev/daemon-core 0.9.82-rc.290 → 0.9.82-rc.292

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.
@@ -14,6 +14,7 @@ import { queuePendingMeshCoordinatorEvent, drainPendingMeshCoordinatorEvents } f
14
14
  import type { PendingMeshCoordinatorEvent } from './mesh-events-pending.js';
15
15
  import { resolveWorkerDelegateRouting, recordUnroutableDelegateEvent, isUnroutableDelegateRejection } from './mesh-routing.js';
16
16
  import { resolveDelegatedWorkerAutoApprove } from '../repo-mesh-types.js';
17
+ import { normalizeMeshNodeId, meshNodeIdMatches } from '@adhdev/mesh-shared';
17
18
  import {
18
19
  findRecentTerminalLedgerEvidence,
19
20
  hasDispatchAfterTerminal,
@@ -610,9 +611,11 @@ async function resolveUsableProvider(
610
611
  // target-routed task permanently pending with a misleading
611
612
  // `no_node_satisfies_required_tags` skip.
612
613
  function readMeshNodeId(node: any): string {
613
- return readNonEmptyString(node?.id)
614
- || readNonEmptyString(node?.nodeId)
615
- || readNonEmptyString(node?.node_id);
614
+ // Delegate to the shared 3-way (id / nodeId / node_id) normalizer so this
615
+ // and every other mesh node-id read agree on identity. Coalesce to '' to
616
+ // preserve the existing string return contract for callers that do
617
+ // `=== task.targetNodeId` / `if (!nodeId)`.
618
+ return normalizeMeshNodeId(node) ?? '';
616
619
  }
617
620
 
618
621
  async function maybeAutoLaunchOneQueueSession(components: DaemonComponents, meshId: string, mesh: any): Promise<boolean> {
@@ -895,7 +898,7 @@ async function maybeAutoFastForwardIdleNode(components: DaemonComponents, args:
895
898
  providerType?: string;
896
899
  }): Promise<void> {
897
900
  const mesh = getMeshWithCache(components, args.meshId);
898
- const node = mesh?.nodes?.find((candidate: any) => candidate?.id === args.nodeId || candidate?.nodeId === args.nodeId);
901
+ const node = mesh?.nodes?.find((candidate: any) => meshNodeIdMatches(candidate, args.nodeId));
899
902
  const workspace = readNonEmptyString(node?.workspace);
900
903
  if (!workspace) return;
901
904
  if (!existsSync(workspace)) return;