diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml
index b2861bd..9d0774b 100644
--- a/.github/workflows/cd.yaml
+++ b/.github/workflows/cd.yaml
@@ -109,7 +109,7 @@ jobs:
- name: Update deployment image tag
run: |
- DEPLOYMENT_FILE="flux-repo/dev/bricks/composable-ui/deployment.yaml"
+ DEPLOYMENT_FILE="flux-repo/dev/composables/composable-ui/deployment.yaml"
if [ -f "$DEPLOYMENT_FILE" ]; then
sed -i 's|image: kaiohz/pickpro:composable-ui-.*|image: kaiohz/pickpro:composable-ui-${{ steps.sha.outputs.result }}|g' "$DEPLOYMENT_FILE"
else
@@ -122,6 +122,6 @@ jobs:
cd flux-repo
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- git add dev/bricks/composable-ui/deployment.yaml
+ git add dev/composables/composable-ui/deployment.yaml
git commit -m "Update composable-ui image to ${{ steps.sha.outputs.result }}" || echo "No changes to commit"
git push https://x-access-token:${{ secrets.FLUX_REPO_TOKEN }}@github.com/SoluDevTech/flux.git main
diff --git a/src/application/components/agent/AgentConfigViewer.tsx b/src/application/components/agent/AgentConfigViewer.tsx
index b26da6b..a96e8be 100644
--- a/src/application/components/agent/AgentConfigViewer.tsx
+++ b/src/application/components/agent/AgentConfigViewer.tsx
@@ -50,7 +50,7 @@ export default function AgentConfigViewer({
return (
{
if (e.key === "Escape") onOpenChange(false);
@@ -59,13 +59,12 @@ export default function AgentConfigViewer({
aria-modal="true"
aria-labelledby="agent-viewer-title"
>
-
);
}
diff --git a/src/application/components/agent/CreateAgentDialog.tsx b/src/application/components/agent/CreateAgentDialog.tsx
index 402e8dc..ce3ccc7 100644
--- a/src/application/components/agent/CreateAgentDialog.tsx
+++ b/src/application/components/agent/CreateAgentDialog.tsx
@@ -54,7 +54,7 @@ export default function CreateAgentDialog({
return (
{
if (e.key === "Escape") onOpenChange(false);
@@ -63,10 +63,9 @@ export default function CreateAgentDialog({
aria-modal="true"
aria-labelledby="create-agent-title"
>
-
-
+
);
}
diff --git a/src/application/components/chat/ChatInput.tsx b/src/application/components/chat/ChatInput.tsx
index 2a41508..abe2774 100644
--- a/src/application/components/chat/ChatInput.tsx
+++ b/src/application/components/chat/ChatInput.tsx
@@ -1,5 +1,6 @@
import { useState, type KeyboardEvent } from "react";
import { useQueryClient } from "@tanstack/react-query";
+import { toast } from "sonner";
import { cn } from "@/application/lib/utils";
import { useStreamChat } from "@/application/hooks/chat/useStreamChat";
import { useSendMessage } from "@/application/hooks/chat/useSendMessage";
@@ -31,16 +32,17 @@ export default function ChatInput({ threadId }: Readonly) {
sendMessage.mutate(
{ message: trimmed },
{
- onSuccess: () => {
- useChatStore.getState().setPendingUserMessage(null);
- useChatStore.getState().setStreaming(false);
- queryClient.invalidateQueries({
+ onSuccess: async () => {
+ await queryClient.invalidateQueries({
queryKey: ["messages", threadId],
});
+ useChatStore.getState().setPendingUserMessage(null);
+ useChatStore.getState().setStreaming(false);
},
onError: () => {
useChatStore.getState().setPendingUserMessage(null);
useChatStore.getState().setStreaming(false);
+ toast.error("Failed to send message");
},
},
);
diff --git a/src/application/components/layout/ThreadSidebar.tsx b/src/application/components/layout/ThreadSidebar.tsx
index 659ad39..95e9887 100644
--- a/src/application/components/layout/ThreadSidebar.tsx
+++ b/src/application/components/layout/ThreadSidebar.tsx
@@ -132,7 +132,7 @@ export default function ThreadSidebar({
{/* Agent selection dialog */}
{showAgentDialog && (
setShowAgentDialog(false)}
onKeyDown={(e) => {
if (e.key === "Escape") setShowAgentDialog(false);
@@ -141,16 +141,12 @@ export default function ThreadSidebar({
aria-modal="true"
aria-labelledby="agent-dialog-title"
>
-
)}
diff --git a/src/application/hooks/chat/useStreamChat.ts b/src/application/hooks/chat/useStreamChat.ts
index 0528cd5..b8ea279 100644
--- a/src/application/hooks/chat/useStreamChat.ts
+++ b/src/application/hooks/chat/useStreamChat.ts
@@ -1,5 +1,6 @@
import { useCallback, useEffect, useRef } from "react";
import { useQueryClient } from "@tanstack/react-query";
+import { toast } from "sonner";
import { chatApi } from "@/infrastructure/api/chat/chatApi";
import { useChatStore } from "@/application/stores/useChatStore";
import type { ChatRequest } from "@/domain/entities/chat/chatRequest";
@@ -23,15 +24,23 @@ export function useStreamChat(threadId: string | null) {
(chunk) => {
appendStreamChunk(chunk);
},
- () => {
- useChatStore.getState().setPendingUserMessage(null);
- setStreaming(false);
- queryClient.invalidateQueries({ queryKey: ["messages", threadId] });
+ async () => {
+ try {
+ await queryClient.invalidateQueries({
+ queryKey: ["messages", threadId],
+ });
+ } finally {
+ useChatStore.getState().setPendingUserMessage(null);
+ setStreaming(false);
+ }
},
(error) => {
console.error("Stream error:", error);
useChatStore.getState().setPendingUserMessage(null);
setStreaming(false);
+ toast.error("Stream error", {
+ description: error.message || "An error occurred while streaming.",
+ });
},
);
},
diff --git a/src/infrastructure/api/chat/chatApi.ts b/src/infrastructure/api/chat/chatApi.ts
index 4da7ee4..872d067 100644
--- a/src/infrastructure/api/chat/chatApi.ts
+++ b/src/infrastructure/api/chat/chatApi.ts
@@ -39,6 +39,7 @@ export const chatApi: IChatPort = {
const response = await apiClient.post(
`/api/v1/chat/${threadId}`,
request,
+ { timeout: 300000 },
);
return response.data;
},