diff --git a/apps/rowboat/app/projects/[projectId]/playground/app.tsx b/apps/rowboat/app/projects/[projectId]/playground/app.tsx index 7a0e94a1..fc920276 100644 --- a/apps/rowboat/app/projects/[projectId]/playground/app.tsx +++ b/apps/rowboat/app/projects/[projectId]/playground/app.tsx @@ -11,7 +11,7 @@ import { apiV1 } from "rowboat-shared"; import { TestProfile } from "@/app/lib/types/testing_types"; import { WithStringId } from "@/app/lib/types/types"; import { ProfileSelector } from "@/app/projects/[projectId]/test/[[...slug]]/components/selectors/profile-selector"; -import { CheckIcon, CopyIcon, PlusIcon, UserIcon, InfoIcon } from "lucide-react"; +import { CheckIcon, CopyIcon, PlusIcon, UserIcon, InfoIcon, BugIcon, BugOffIcon } from "lucide-react"; import { USE_TESTING_FEATURE } from "@/app/lib/feature_flags"; import { clsx } from "clsx"; @@ -39,6 +39,7 @@ export function App({ const [counter, setCounter] = useState(0); const [testProfile, setTestProfile] = useState> | null>(null); const [systemMessage, setSystemMessage] = useState(defaultSystemMessage); + const [showDebugMessages, setShowDebugMessages] = useState(true); const [chat, setChat] = useState>({ projectId, createdAt: new Date().toISOString(), @@ -116,6 +117,20 @@ export function App({ > + } rightActions={ @@ -169,6 +184,7 @@ export function App({ mcpServerUrls={mcpServerUrls} toolWebhookUrl={toolWebhookUrl} onCopyClick={(fn) => { getCopyContentRef.current = fn; }} + showDebugMessages={showDebugMessages} /> diff --git a/apps/rowboat/app/projects/[projectId]/playground/components/chat.tsx b/apps/rowboat/app/projects/[projectId]/playground/components/chat.tsx index 14347e08..16d07fb8 100644 --- a/apps/rowboat/app/projects/[projectId]/playground/components/chat.tsx +++ b/apps/rowboat/app/projects/[projectId]/playground/components/chat.tsx @@ -28,6 +28,7 @@ export function Chat({ mcpServerUrls, toolWebhookUrl, onCopyClick, + showDebugMessages = true, }: { chat: z.infer; projectId: string; @@ -40,6 +41,7 @@ export function Chat({ mcpServerUrls: Array>; toolWebhookUrl: string; onCopyClick: (fn: () => string) => void; + showDebugMessages?: boolean; }) { const [messages, setMessages] = useState[]>(chat.messages); const [loadingAssistantResponse, setLoadingAssistantResponse] = useState(false); @@ -285,6 +287,7 @@ export function Chat({ systemMessage={systemMessage} onSystemMessageChange={onSystemMessageChange} showSystemMessage={false} + showDebugMessages={showDebugMessages} /> diff --git a/apps/rowboat/app/projects/[projectId]/playground/components/messages.tsx b/apps/rowboat/app/projects/[projectId]/playground/components/messages.tsx index af6530a9..693cc11b 100644 --- a/apps/rowboat/app/projects/[projectId]/playground/components/messages.tsx +++ b/apps/rowboat/app/projects/[projectId]/playground/components/messages.tsx @@ -35,12 +35,15 @@ function InternalAssistantMessage({ content, sender, latency, delta }: { content // Show plus icon and duration const deltaDisplay = ( - - - {Math.round(delta / 1000)}s + + +{Math.round(delta / 1000)}s ); + // Get first line preview + const firstLine = content.split('\n')[0].trim(); + const preview = firstLine.length > 50 ? firstLine.substring(0, 50) + '...' : firstLine; + return (
@@ -49,15 +52,20 @@ function InternalAssistantMessage({ content, sender, latency, delta }: { content
+ : 'bg-gray-50 dark:bg-zinc-800 px-4 py-2.5 rounded-2xl rounded-bl-lg text-sm leading-relaxed text-gray-700 dark:text-gray-200 border-none shadow-sm animate-slideUpAndFade w-fit'}> {!expanded ? ( -
- -
- {deltaDisplay} +
+
+ {preview} +
+
+ +
+ {deltaDisplay} +
) : ( @@ -207,9 +215,8 @@ function TransferToAgentToolCall({ return <>; } const deltaDisplay = ( - - - {Math.round(delta / 1000)}s + + +{Math.round(delta / 1000)}s ); return ( @@ -333,6 +340,7 @@ export function Messages({ systemMessage, onSystemMessageChange, showSystemMessage, + showDebugMessages = true, }: { projectId: string; messages: z.infer[]; @@ -343,6 +351,7 @@ export function Messages({ systemMessage: string | undefined; onSystemMessageChange: (message: string) => void; showSystemMessage: boolean; + showDebugMessages?: boolean; }) { const messagesEndRef = useRef(null); let lastUserMessageTimestamp = 0; @@ -363,6 +372,12 @@ export function Messages({ // Helper: is this message a transfer pill or internal message? const isTransferPill = 'tool_calls' in message && message.tool_calls.some(tc => tc.function.name.startsWith('transfer_to_')); const isInternal = message.agenticResponseType === 'internal'; + + // Skip internal messages and transfer pills if debug mode is off + if (!showDebugMessages && (isTransferPill || isInternal)) { + return null; + } + if (isTransferPill || isInternal) { // Find previous message that is either a transfer pill or internal message let delta = latency; @@ -442,11 +457,17 @@ export function Messages({ return (
- {messages.map((message, index) => ( -
- {renderMessage(message, index)} -
- ))} + {messages.map((message, index) => { + const renderedMessage = renderMessage(message, index); + if (renderedMessage) { + return ( +
+ {renderedMessage} +
+ ); + } + return null; + })} {loadingAssistantResponse && }