@copilotkit/react-core 1.51.4-next.2 → 1.51.4-next.4

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.
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  useCopilotChatHeadless_c
3
- } from "../chunk-XZFIJ7XF.mjs";
3
+ } from "../chunk-MA3CUMCY.mjs";
4
4
  import {
5
5
  defaultSystemMessage
6
- } from "../chunk-LO4RRITI.mjs";
6
+ } from "../chunk-KNJHRVKW.mjs";
7
7
  import "../chunk-ZVF5Q6IH.mjs";
8
8
  import "../chunk-VV56AVPB.mjs";
9
9
  import "../chunk-I76HKHPJ.mjs";
@@ -974,8 +974,10 @@ function useCopilotChatInternal({
974
974
  const reload = useAsyncCallback(
975
975
  (reloadMessageId) => __async(this, null, function* () {
976
976
  var _a2;
977
+ if (!agent)
978
+ return;
977
979
  const messages = (_a2 = agent == null ? void 0 : agent.messages) != null ? _a2 : [];
978
- const isLoading = false;
980
+ const isLoading = agent.isRunning;
979
981
  if (isLoading || messages.length === 0) {
980
982
  return;
981
983
  }
@@ -1013,7 +1015,7 @@ function useCopilotChatInternal({
1013
1015
  }
1014
1016
  return;
1015
1017
  }),
1016
- [agent == null ? void 0 : agent.setMessages, copilotkit == null ? void 0 : copilotkit.runAgent]
1018
+ [agent == null ? void 0 : agent.messages.length, agent == null ? void 0 : agent.isRunning, agent == null ? void 0 : agent.setMessages, copilotkit == null ? void 0 : copilotkit.runAgent]
1017
1019
  );
1018
1020
  const latestSendMessageFunc = useAsyncCallback(
1019
1021
  (message, options) => __async(this, null, function* () {