@parhelia/core 0.1.12744 → 0.1.12749

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.
@@ -5554,6 +5554,25 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
5554
5554
  : "completed");
5555
5555
  return;
5556
5556
  }
5557
+ // Backstop: if the backend reports an error but we never received the
5558
+ // agent:run:error lifecycle event (e.g. it was missed or the broadcast
5559
+ // path failed to fire), surface the error locally instead of waiting
5560
+ // for the user to reload.
5561
+ if (normalizeServerExecutionStatus(serverStatus) === "error") {
5562
+ const rawError = diagnostics.execution?.error ?? null;
5563
+ const errorMsg = toUserFacingAgentErrorMessage(rawError) ||
5564
+ rawError ||
5565
+ "AI could not complete this request.";
5566
+ clearHeartbeatMessages();
5567
+ setLastRunStatusReason(null);
5568
+ setError(errorMsg);
5569
+ setAgent((prev) => prev ? { ...prev, status: "error", statusMessage: errorMsg } : prev);
5570
+ setIsWaitingForResponse(false);
5571
+ isWaitingRef.current = false;
5572
+ setIsConnecting(false);
5573
+ setIsAgentThinking(false);
5574
+ return;
5575
+ }
5557
5576
  const serverLastSeq = diagnostics.currentSession?.lastDelivery?.lastSeq ??
5558
5577
  diagnostics.transport?.lastSeq ??
5559
5578
  null;
@@ -5621,6 +5640,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
5621
5640
  isActive,
5622
5641
  isExecuting,
5623
5642
  appendToolUiEvent,
5643
+ clearHeartbeatMessages,
5624
5644
  loadAgent,
5625
5645
  settleCompletedRun,
5626
5646
  ]);