diff --git a/site/src/pages/AgentsPage/AgentChatInput.tsx b/site/src/pages/AgentsPage/AgentChatInput.tsx index 3c1aae3ad8..1ea786c582 100644 --- a/site/src/pages/AgentsPage/AgentChatInput.tsx +++ b/site/src/pages/AgentsPage/AgentChatInput.tsx @@ -13,13 +13,7 @@ import { TooltipContent, TooltipTrigger, } from "components/Tooltip/Tooltip"; -import { - ArrowUpIcon, - ListPlusIcon, - Loader2Icon, - Square, - XIcon, -} from "lucide-react"; +import { ArrowUpIcon, Loader2Icon, Square, XIcon } from "lucide-react"; import { memo, type ReactNode, useCallback, useRef, useState } from "react"; import { cn } from "utils/cn"; import { formatProviderLabel } from "./modelOptions"; @@ -317,8 +311,7 @@ export const AgentChatInput = memo( } }; - const sendButtonLabel = - isStreaming && editingQueuedMessageID === null ? "Queue message" : "Send"; + const sendButtonLabel = editingQueuedMessageID !== null ? "Save" : "Send"; const content = (
@@ -430,22 +423,22 @@ export const AgentChatInput = memo( Stop )} - + {!(isStreaming && editingQueuedMessageID === null) && ( + + )}
{inputStatusText && ( diff --git a/site/src/pages/AgentsPage/AgentsPage.tsx b/site/src/pages/AgentsPage/AgentsPage.tsx index 9b8955e790..409bc561d4 100644 --- a/site/src/pages/AgentsPage/AgentsPage.tsx +++ b/site/src/pages/AgentsPage/AgentsPage.tsx @@ -814,6 +814,10 @@ export const AgentsEmptyState: FC = ({ const handleSend = useCallback( (message: string) => { + // Clear the draft synchronously before the async + // onCreateChat call so that editor change events + // firing during the async gap cannot re-persist it. + localStorage.removeItem(emptyInputStorageKey); void onCreateChat({ message, workspaceId: selectedWorkspaceIdRef.current ?? undefined,