@sjawhar/pi-legion-envoy 1.28.0 → 1.28.2

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/envoy.js CHANGED
@@ -33400,6 +33400,13 @@ function envoyExtension(pi) {
33400
33400
  };
33401
33401
  const deliver = async (subject, raw, reply) => {
33402
33402
  const rendered = renderInbound(raw, sessionID, subject);
33403
+ if (reply !== "" && subject === agentSubject(sessionID)) {
33404
+ try {
33405
+ (await ensureConnection()).publish(reply);
33406
+ } catch (error) {
33407
+ console.warn(`[envoy] failed to acknowledge envelope ${rendered.envelope?.event_id ?? "unknown"}`, error);
33408
+ }
33409
+ }
33403
33410
  for (const topic of subscriptionRemovedTopics(raw, sessionID) ?? [])
33404
33411
  closeIntentionally(topic);
33405
33412
  const dedupeKey = rendered.envelope?.dedupe_key;
@@ -33456,9 +33463,6 @@ function envoyExtension(pi) {
33456
33463
  }
33457
33464
  }
33458
33465
  }
33459
- if (reply !== "" && subject === agentSubject(sessionID)) {
33460
- (await ensureConnection()).publish(reply);
33461
- }
33462
33466
  };
33463
33467
  const RESUBSCRIBE_DELAY_MS = Number(process.env.ENVOY_RESUBSCRIBE_DELAY_MS ?? "") || 5000;
33464
33468
  let shuttingDown = false;
package/dist/legion.js CHANGED
@@ -33823,6 +33823,13 @@ function envoyExtension(pi) {
33823
33823
  };
33824
33824
  const deliver = async (subject, raw, reply) => {
33825
33825
  const rendered = renderInbound(raw, sessionID, subject);
33826
+ if (reply !== "" && subject === agentSubject(sessionID)) {
33827
+ try {
33828
+ (await ensureConnection()).publish(reply);
33829
+ } catch (error) {
33830
+ console.warn(`[envoy] failed to acknowledge envelope ${rendered.envelope?.event_id ?? "unknown"}`, error);
33831
+ }
33832
+ }
33826
33833
  for (const topic of subscriptionRemovedTopics(raw, sessionID) ?? [])
33827
33834
  closeIntentionally(topic);
33828
33835
  const dedupeKey = rendered.envelope?.dedupe_key;
@@ -33879,9 +33886,6 @@ function envoyExtension(pi) {
33879
33886
  }
33880
33887
  }
33881
33888
  }
33882
- if (reply !== "" && subject === agentSubject(sessionID)) {
33883
- (await ensureConnection()).publish(reply);
33884
- }
33885
33889
  };
33886
33890
  const RESUBSCRIBE_DELAY_MS = Number(process.env.ENVOY_RESUBSCRIBE_DELAY_MS ?? "") || 5000;
33887
33891
  let shuttingDown = false;
@@ -148,11 +148,16 @@ not construct a token from a partial issue reference.
148
148
 
149
149
  ## Legion exception lane
150
150
 
151
- `no_holder` and `delivery_failed` for a Legion role are daemon liveness signals, not reasons to
152
- add a second subscriber or manually retry. For example, treat a `delivery_failed` wake as the
153
- daemon's responsibility to revive or recreate the backing worker and re-deliver; otherwise it
154
- resurrects the root process with derived catch-up and the workspace handoffs. Raw delivery failures
155
- stay out of architect context.
151
+ `no_holder`, `delivery_failed`, and `receipt_timeout` for a Legion role are daemon liveness
152
+ signals, not reasons to add a second subscriber or manually retry. `no_holder`: no live session
153
+ holds the role. `delivery_failed`: the message was not forwarded at all — the holder lookup
154
+ failed, the holder was stale, or the publish errored. `receipt_timeout`: the listener forwarded
155
+ the message to a registered, live holder and no receipt arrived inside the window; its payload
156
+ keeps `original_topic`, `event_id`, `payload`, and the original `dedupe_key`, so the daemon can
157
+ re-send the same message and the receiver's dedupe drops a copy that did arrive. Treat any of
158
+ these wakes as the daemon's responsibility to revive or recreate the backing worker and
159
+ re-deliver; otherwise it resurrects the root process with derived catch-up and the workspace
160
+ handoffs. Raw delivery failures stay out of architect context.
156
161
 
157
162
  ## Slack
158
163
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion-envoy",
3
- "version": "1.28.0",
3
+ "version": "1.28.2",
4
4
  "type": "module",
5
5
  "omp": {
6
6
  "extensions": [