@adhdev/daemon-core 0.9.82-rc.159 → 0.9.82-rc.160
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 +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/router.ts +17 -5
package/package.json
CHANGED
package/src/commands/router.ts
CHANGED
|
@@ -5556,7 +5556,13 @@ export class DaemonCommandRouter {
|
|
|
5556
5556
|
const meshHost = resolveMeshHostStatus(mesh);
|
|
5557
5557
|
|
|
5558
5558
|
const refreshRequested = args?.refresh === true || args?.forceRefresh === true;
|
|
5559
|
-
|
|
5559
|
+
// See (B3) below: scope the peek to this daemon when the
|
|
5560
|
+
// caller doesn't tell us, otherwise scoped events look
|
|
5561
|
+
// missing and we falsely return a stale cache.
|
|
5562
|
+
const peekScope = typeof args?.coordinatorDaemonId === 'string' && args.coordinatorDaemonId.trim()
|
|
5563
|
+
? args.coordinatorDaemonId.trim()
|
|
5564
|
+
: (this.deps.statusInstanceId || undefined);
|
|
5565
|
+
const pendingCoordinatorEventCount = getPendingMeshCoordinatorEvents(meshId, peekScope).length;
|
|
5560
5566
|
const hadAggregateCache = this.aggregateMeshStatusCache.has(meshId);
|
|
5561
5567
|
if (!refreshRequested && pendingCoordinatorEventCount === 0) {
|
|
5562
5568
|
const cachedStatus = this.getCachedAggregateMeshStatus(meshId, mesh, { requireDirectPeerTruth: args?.requireDirectPeerTruth === true });
|
|
@@ -5903,12 +5909,18 @@ export class DaemonCommandRouter {
|
|
|
5903
5909
|
nodeStatuses.push(status);
|
|
5904
5910
|
}
|
|
5905
5911
|
|
|
5906
|
-
// (B3)
|
|
5907
|
-
//
|
|
5908
|
-
//
|
|
5912
|
+
// (B3) Resolve the coordinator daemon scope for the drain.
|
|
5913
|
+
// Emit-time always tags events with the worker's
|
|
5914
|
+
// targetCoordinatorDaemonId and writes them to the
|
|
5915
|
+
// scoped pending-events file. If the caller (MCP tool,
|
|
5916
|
+
// dashboard, etc.) doesn't tell us which coordinator
|
|
5917
|
+
// they're running under, fall back to *this daemon's*
|
|
5918
|
+
// ID — the caller reached us over our IPC/WS, so they
|
|
5919
|
+
// are by definition under this daemon. Falling back to
|
|
5920
|
+
// undefined would silently miss every scoped event.
|
|
5909
5921
|
const callerCoordinatorDaemonId = typeof args?.coordinatorDaemonId === 'string' && args.coordinatorDaemonId.trim()
|
|
5910
5922
|
? args.coordinatorDaemonId.trim()
|
|
5911
|
-
: undefined;
|
|
5923
|
+
: (this.deps.statusInstanceId || undefined);
|
|
5912
5924
|
const pendingCoordinatorEvents = drainPendingMeshCoordinatorEvents(meshId, callerCoordinatorDaemonId);
|
|
5913
5925
|
const previewFreshness = (() => {
|
|
5914
5926
|
const localRepoRoot = nodeStatuses
|