diff --git a/site/src/pages/AgentsPage/AgentChatPage.stories.tsx b/site/src/pages/AgentsPage/AgentChatPage.stories.tsx
index d541491887..619a796822 100644
--- a/site/src/pages/AgentsPage/AgentChatPage.stories.tsx
+++ b/site/src/pages/AgentsPage/AgentChatPage.stories.tsx
@@ -1242,10 +1242,10 @@ export const WithWaitAgentComputerUseVNC: Story = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
- // The wait_agent card should show "Waiting for" (running state)
- // rendered via SubagentTool with VNC preview.
+ // The wait_agent card should show "Using the computer..." (running
+ // state) rendered via SubagentTool with VNC preview.
await waitFor(() => {
- expect(canvas.getByText(/Waiting for/)).toBeInTheDocument();
+ expect(canvas.getByText(/Using the computer/)).toBeInTheDocument();
});
},
};
diff --git a/site/src/pages/AgentsPage/components/ChatElements/tools/InlineDesktopPreview.tsx b/site/src/pages/AgentsPage/components/ChatElements/tools/InlineDesktopPreview.tsx
index 9f0191be3d..775e13dc84 100644
--- a/site/src/pages/AgentsPage/components/ChatElements/tools/InlineDesktopPreview.tsx
+++ b/site/src/pages/AgentsPage/components/ChatElements/tools/InlineDesktopPreview.tsx
@@ -1,4 +1,4 @@
-import { ExternalLinkIcon } from "lucide-react";
+import { PanelRightOpenIcon } from "lucide-react";
import type React from "react";
import { useEffect, useRef, useState } from "react";
import { Spinner } from "#/components/Spinner/Spinner";
@@ -10,6 +10,9 @@ import {
/** Default aspect ratio used before the remote framebuffer size is known. */
const DEFAULT_ASPECT = "16 / 9";
+/** Fixed pixel height for the compact preview thumbnail. */
+const PREVIEW_HEIGHT = 128;
+
/**
* Non-interactive inline VNC desktop preview. The noVNC canvas is
* blocked from receiving pointer/keyboard events so it acts as a
@@ -75,19 +78,22 @@ export const InlineDesktopPreview: React.FC<{
}, [status]);
const wrapWithOverlay = (children: React.ReactNode) => (
-
+
{children}
{/* Transparent overlay — dims the preview on hover and shows
- an external-link icon so it's clear clicking opens the
+ a "View desktop" label so it's clear clicking opens the
sidebar desktop tab. */}
{onClick && (
)}
{
const canvas = within(canvasElement);
- expect(canvas.getByText(/Waiting for/)).toBeInTheDocument();
- // Running state shows the spinner icon.
- expect(canvasElement.querySelector(".lucide-loader")).not.toBeNull();
+ expect(canvas.getByText(/Using the computer/)).toBeInTheDocument();
+ // Running state shows the monitor icon instead of a spinner.
+ expect(canvasElement.querySelector(".lucide-monitor")).not.toBeNull();
// The VNC preview container should mount (the connection will
// stay in "connecting" state without a real WebSocket, which
// is expected — we only verify the container renders).
diff --git a/site/src/pages/AgentsPage/components/ChatElements/tools/Tool.tsx b/site/src/pages/AgentsPage/components/ChatElements/tools/Tool.tsx
index 846eaf14bf..b97060341b 100644
--- a/site/src/pages/AgentsPage/components/ChatElements/tools/Tool.tsx
+++ b/site/src/pages/AgentsPage/components/ChatElements/tools/Tool.tsx
@@ -333,6 +333,18 @@ const SubagentRenderer: FC = ({
(resultStr.toLowerCase().includes("timed out") ||
errorStr.toLowerCase().includes("timed out"));
+ // Postpone rendering wait_agent / message_agent until the
+ // chat_id has been parsed from the streaming args. Without it
+ // we can't determine variant or title, which causes a brief
+ // flash of the generic "Waiting for Sub-agent" text.
+ if (
+ !chatId &&
+ status === "running" &&
+ (name === "wait_agent" || name === "message_agent")
+ ) {
+ return null;
+ }
+
const variant =
name === "spawn_computer_use_agent" || computerUseSubagentIds?.has(chatId)
? "computer-use"