@adhdev/daemon-core 0.9.82-rc.401 → 0.9.82-rc.402

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.82-rc.401",
3
+ "version": "0.9.82-rc.402",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -46,7 +46,7 @@
46
46
  "author": "vilmire",
47
47
  "license": "AGPL-3.0-or-later",
48
48
  "dependencies": {
49
- "@adhdev/mesh-shared": "0.9.82-rc.401",
49
+ "@adhdev/mesh-shared": "0.9.82-rc.402",
50
50
  "@adhdev/session-host-core": "*",
51
51
  "@agentclientprotocol/sdk": "^0.16.1",
52
52
  "ajv": "^8.20.0",
@@ -7,6 +7,7 @@ import { getMesh } from '../config/mesh-config.js';
7
7
  import { LOG } from '../logging/logger.js';
8
8
  import { appendLedgerEntry } from './mesh-ledger.js';
9
9
  import type { MeshLedgerKind } from './mesh-ledger.js';
10
+ import { createSessionDelivery } from './mesh-delivery-policy.js';
10
11
 
11
12
  export type MeshTaskStatus = 'pending' | 'assigned' | 'completed' | 'failed' | 'cancelled';
12
13
  export type MeshActiveTaskStatus = Extract<MeshTaskStatus, 'pending' | 'assigned'>;
@@ -836,6 +837,28 @@ export function recordDirectDispatchTask(
836
837
  updatedAt: now,
837
838
  };
838
839
  MeshRuntimeStore.getInstance().insertQueueEntry(entry);
840
+ // R2 / NOTIF-DROP: a mission-attributed DIRECT dispatch (mesh_send_task) has
841
+ // already been handed to the transport by the time we materialise this assigned
842
+ // row — unlike a queue claim, there is no later delivery-confirmation write for
843
+ // it. Without a confirmed delivery record keyed by this taskId, the assigned-
844
+ // stranded watchdog (recoverStrandedAssignedDispatches → taskHasConfirmedDelivery)
845
+ // sees the row as never-confirmed after ASSIGNED_STRANDED_DEADLINE_MS and reclaims
846
+ // a task the worker already COMPLETED, dropping its agent:generating_completed
847
+ // (live PROBE-B repro: "never confirmed delivered → pending"). Record a confirmed
848
+ // delivery here so taskHasConfirmedDelivery() is true and the watchdog leaves the
849
+ // row to PHASE 4 completion reconcile. This point is only reached after the direct
850
+ // dispatch's result.success, so 'delivered' is the accurate state.
851
+ try {
852
+ createSessionDelivery({
853
+ meshId,
854
+ ...(opts.assignedNodeId ? { nodeId: opts.assignedNodeId } : {}),
855
+ ...(opts.assignedSessionId ? { sessionId: opts.assignedSessionId } : {}),
856
+ taskId,
857
+ kind: 'task',
858
+ message,
859
+ status: 'delivered',
860
+ });
861
+ } catch { /* best-effort — the assigned row is already recorded */ }
839
862
  return entry;
840
863
  });
841
864
  }