agent-relay-runner 0.84.0 → 0.85.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay-runner",
3
- "version": "0.84.0",
3
+ "version": "0.85.0",
4
4
  "description": "Unified provider lifecycle runner for Agent Relay",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,7 +20,7 @@
20
20
  "directory": "runner"
21
21
  },
22
22
  "dependencies": {
23
- "agent-relay-sdk": "0.2.64"
23
+ "agent-relay-sdk": "0.2.65"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/bun": "latest",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-relay-runner",
3
3
  "description": "Thin Agent Relay runner bridge for Claude Code",
4
- "version": "0.84.0",
4
+ "version": "0.85.0",
5
5
  "agentRelayContracts": {
6
6
  "providerPluginProtocol": 1
7
7
  }
@@ -224,6 +224,11 @@ export class AgentRunner {
224
224
  private readonly mcpProxySecret: string;
225
225
  private process?: ManagedProcess;
226
226
  private stopped = false;
227
+ // #633 — set when the provider terminally exits but the runner stays alive (Claude native
228
+ // auto-compaction / manual-resume hold). Rides on the offline status frame so the server fires a
229
+ // terminal `agent.exited` event with a #636 diagnosis instead of the death going silent. Cleared
230
+ // on any genuine restart back to busy/idle.
231
+ private terminalProviderExit?: Record<string, unknown>;
227
232
  private exitCommandInProgress = false;
228
233
  private restartInProgress = false;
229
234
  // Set for the whole unexpected-exit restart, including the pre-restart backoff
@@ -1010,6 +1015,14 @@ export class AgentRunner {
1010
1015
  },
1011
1016
  });
1012
1017
  this.process = undefined;
1018
+ // #633: the runner stays alive (manual-resume hold), so neither the orchestrator tmux-gone
1019
+ // path nor the heartbeat reaper will ever fire. Stamp the terminal marker so the SAME offline
1020
+ // status frame (published by setProviderStatus below) carries it; the server's bus status
1021
+ // handler turns that edge into a terminal `agent.exited` event with a #636 diagnosis.
1022
+ this.terminalProviderExit = {
1023
+ reason: hasResumeId ? "claude-exit-manual-resume-available" : "claude-exit-manual-intervention-required",
1024
+ ...diagnostics,
1025
+ };
1013
1026
  this.setProviderStatus({
1014
1027
  status,
1015
1028
  reason: "provider-turn",
@@ -1241,6 +1254,9 @@ export class AgentRunner {
1241
1254
  // re-inject any pending spawner obligation so it surfaces the /reply command.
1242
1255
  if (this.options.provider !== "claude") void this.reInjectPendingObligation();
1243
1256
  }
1257
+ // A genuine restart back to forward progress clears the terminal-exit marker so a later offline
1258
+ // doesn't re-announce a stale provider exit.
1259
+ if (status === "busy" || status === "idle") this.terminalProviderExit = undefined;
1244
1260
  if (status === "busy") {
1245
1261
  this.claims.clearTerminalStatus();
1246
1262
  this.claims.startWork(reason, id, typeof update === "string" ? {} : {
@@ -1828,6 +1844,14 @@ export class AgentRunner {
1828
1844
  terminalFailureReason: terminalFailure.reason,
1829
1845
  terminalFailureMessage: terminalFailure.message,
1830
1846
  } : {}),
1847
+ // #633 — terminal provider-exit marker (runner alive, provider gone). Drives the server's
1848
+ // silent-death terminal event + #636 post-mortem.
1849
+ ...(this.terminalProviderExit ? {
1850
+ terminalProviderExit: this.terminalProviderExit,
1851
+ ...(typeof this.terminalProviderExit.claudeResumeId === "string"
1852
+ ? { lastError: `Claude provider exited; resume id ${this.terminalProviderExit.claudeResumeId} captured for manual recovery` }
1853
+ : { lastError: "Claude provider exited; manual intervention required" }),
1854
+ } : {}),
1831
1855
  busyReasons: this.claims.reasons(),
1832
1856
  activeWork,
1833
1857
  activeSubagents,