agent-relay-server 0.91.2 → 0.91.3

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/docs/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Agent Relay API",
5
- "version": "0.91.2",
5
+ "version": "0.91.3",
6
6
  "description": "Real-time message bus for inter-agent communication. Agent-first: this spec is designed for machine consumption — agents can self-discover the full API surface via GET /api/spec.",
7
7
  "license": {
8
8
  "name": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay-server",
3
- "version": "0.91.2",
3
+ "version": "0.91.3",
4
4
  "description": "Lightweight HTTP message relay for inter-agent communication across machines",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
@@ -99,6 +99,11 @@ export function registrationTimeoutMsFromEnv(): number {
99
99
  return Number.isFinite(parsed) && parsed > 0 ? parsed : 60_000;
100
100
  }
101
101
 
102
+ export function nativeSelfResumeTimeoutMsFromEnv(): number {
103
+ const parsed = Number(process.env.AGENT_RELAY_NATIVE_SELF_RESUME_TIMEOUT_MS);
104
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : 120_000;
105
+ }
106
+
102
107
  export function agentProfileNameFromEnv(): string | undefined {
103
108
  return process.env.AGENT_RELAY_AGENT_PROFILE;
104
109
  }
@@ -173,6 +173,10 @@ export function classifyAgentDeath(ev: DeathEvidence): AgentDeathDiagnosis {
173
173
  pushUnique(evidence, "log/error text matched a crash pattern (panic/segfault/traceback)");
174
174
  return verdict("provider-crash", "medium", "Likely provider crash (log pattern)");
175
175
  }
176
+ if (/self-resume-(?:exit-before-resume|relaunch-failed)/i.test(text)) {
177
+ pushUnique(evidence, "native self-resume exited before Relay observed a resumed provider");
178
+ return verdict("provider-crash", "high", "Self-resume failed before relaunch completed");
179
+ }
176
180
 
177
181
  // 5) killed — external SIGKILL/SIGTERM that isn't OOM and isn't a parent-initiated shutdown.
178
182
  if (signal && /KILL|TERM|INT|HUP|QUIT/i.test(signal)) {
@@ -8,6 +8,7 @@ import { isRecord } from "agent-relay-sdk";
8
8
  import { clearAgentMetaKeys } from "../db";
9
9
  import { notifyAgentOffline } from "../agent-lifecycle-events";
10
10
  import { diagnoseAgentDeath } from "../agent-death-diagnosis";
11
+ import { routeNotification } from "../notification-router";
11
12
  import type { AgentCard } from "../types";
12
13
 
13
14
  /**
@@ -29,5 +30,27 @@ export function reconcileTerminalProviderExit(agentId: string, before: AgentCard
29
30
  if (!isRecord(marker)) return;
30
31
  const reasonText = typeof marker.reason === "string" ? marker.reason : "provider exited";
31
32
  const reason = `provider exited (${reasonText})`;
32
- notifyAgentOffline(agentId, reason, diagnoseAgentDeath({ agent: after, reason }));
33
+ const diagnosis = diagnoseAgentDeath({ agent: after, reason });
34
+ notifyAgentOffline(agentId, reason, diagnosis);
35
+ if (!after.spawnedBy && reasonText.startsWith("self-resume-")) {
36
+ routeNotification({
37
+ type: "agent.exited",
38
+ scope: { agentId },
39
+ recipients: ["user"],
40
+ message: {
41
+ subject: "Self-resume failed",
42
+ body: `Agent \`${agentId}\` exited during self-resume before the resumed session was confirmed. Manual recovery may need the provider resume id from the runner log.`,
43
+ payload: {
44
+ kind: "agent.self_resume_failed",
45
+ agentId,
46
+ reason,
47
+ diagnosis,
48
+ ...(typeof marker.claudeResumeId === "string" ? { claudeResumeId: marker.claudeResumeId } : {}),
49
+ ...(typeof marker.selfResumeCommandId === "string" ? { commandId: marker.selfResumeCommandId } : {}),
50
+ ...(typeof marker.selfResumeGeneration === "number" ? { generation: marker.selfResumeGeneration } : {}),
51
+ },
52
+ replyExpected: false,
53
+ },
54
+ });
55
+ }
33
56
  }