@songsid/agend 2.1.4-beta.38 → 2.1.4-beta.39

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.
@@ -3149,6 +3149,39 @@ export class FleetManager {
3149
3149
  else if (msg.type === "instance_progress") {
3150
3150
  this.cacheInstanceProgress(name, msg.progress || null);
3151
3151
  }
3152
+ else if (msg.type === "cross_instance_delivery_failed") {
3153
+ const senderSession = String(msg.senderSession ?? "");
3154
+ const targetInstance = String(msg.targetInstance ?? name);
3155
+ const correlationId = String(msg.correlationId ?? "unknown");
3156
+ const error = String(msg.error ?? "unknown delivery failure");
3157
+ const senderInstance = this.instanceIpcClients.has(senderSession)
3158
+ ? senderSession
3159
+ : this.sessionRegistry.get(senderSession);
3160
+ this.logger.error({ senderSession, targetInstance, correlationId, error }, "Cross-instance pane delivery failed after queue acceptance");
3161
+ this.eventLog?.insert(targetInstance, "cross_instance_delivery_failed", {
3162
+ from: senderSession, correlation_id: correlationId, error,
3163
+ });
3164
+ if (senderInstance) {
3165
+ this.notifyInstanceTopic(senderInstance, t("cross_instance.delivery_failed_notice", targetInstance, error, correlationId));
3166
+ void this.deliverToInstance(senderInstance, {
3167
+ type: "fleet_inbound",
3168
+ targetSession: senderSession,
3169
+ content: t("cross_instance.delivery_failed_agent", targetInstance, error, correlationId),
3170
+ meta: {
3171
+ chat_id: "",
3172
+ message_id: `delivery-failed-${Date.now()}`,
3173
+ user: "AgEnD",
3174
+ user_id: "system:agend",
3175
+ ts: new Date().toISOString(),
3176
+ thread_id: "",
3177
+ request_kind: "update",
3178
+ correlation_id: correlationId,
3179
+ },
3180
+ }, { waitForIdle: true }).catch(deliveryError => {
3181
+ this.logger.error({ err: deliveryError, senderSession, correlationId }, "Could not deliver cross-instance failure status back to sender");
3182
+ });
3183
+ }
3184
+ }
3152
3185
  else if (msg.type === "instance_state" || msg.type === "instance_state_response") {
3153
3186
  this.cacheInstanceExecutionState(name, msg);
3154
3187
  if (msg.type === "instance_state_response") {