@holon-run/agentinbox 1.5.0 → 1.5.1
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/src/service.js +15 -2
- package/package.json +1 -1
package/dist/src/service.js
CHANGED
|
@@ -2243,9 +2243,15 @@ class AgentInboxService {
|
|
|
2243
2243
|
return;
|
|
2244
2244
|
}
|
|
2245
2245
|
const state = this.store.getActivationDispatchState(buffer.agentId, buffer.targetId);
|
|
2246
|
+
// Within an active notify lease, buffered entries merge into the pending
|
|
2247
|
+
// set (below) instead of re-dispatching. Webhook targets used to
|
|
2248
|
+
// re-dispatch every flush window during the lease, which queued one
|
|
2249
|
+
// wake per window downstream and produced empty wake turns when the
|
|
2250
|
+
// consuming turn acked everything (issue #233). Merge semantics now
|
|
2251
|
+
// match terminal targets: re-dispatch happens on ack (when pending new
|
|
2252
|
+
// items exist) or lease expiry.
|
|
2246
2253
|
const shouldAttemptDispatch = !state
|
|
2247
|
-
|| (state.status === "dirty" && state.leaseExpiresAt == null)
|
|
2248
|
-
|| (state.status === "notified" && buffer.targetKind === "webhook");
|
|
2254
|
+
|| (state.status === "dirty" && state.leaseExpiresAt == null);
|
|
2249
2255
|
if (shouldAttemptDispatch) {
|
|
2250
2256
|
const pendingState = state?.status === "dirty" ? state : null;
|
|
2251
2257
|
const inbox = this.ensureInboxForAgent(buffer.agentId);
|
|
@@ -2427,6 +2433,13 @@ class AgentInboxService {
|
|
|
2427
2433
|
if (reason === "ack" && state.status !== "dirty") {
|
|
2428
2434
|
return;
|
|
2429
2435
|
}
|
|
2436
|
+
if (reason === "ack" && target.kind === "webhook" && state.pendingNewItemCount <= 0) {
|
|
2437
|
+
// Ack-driven re-dispatch for webhook targets requires items that no
|
|
2438
|
+
// previous notification covered. Without new information a POST would
|
|
2439
|
+
// only wake the runtime about entries it already knows. Terminal
|
|
2440
|
+
// targets keep ack-driven re-render behavior.
|
|
2441
|
+
return;
|
|
2442
|
+
}
|
|
2430
2443
|
if (reason === "lease" && state.status === "notified") {
|
|
2431
2444
|
// No new items since last notification — just renew lease for both
|
|
2432
2445
|
// terminal and webhook targets. Re-dispatching would cause an infinite
|