Skip to content

Commit 45a9176

Browse files
committed
refactor(workspaces): simplify AI response wrapper
1 parent a33fd84 commit 45a9176

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/features/workspaces/components/ai-chat/AiChatMessageResponse.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { ComponentProps } from "react";
44
import { Streamdown, type StreamdownProps } from "streamdown";
55
import "katex/dist/katex.min.css";
66
import { MarkdownCodeBlock } from "#/features/workspaces/components/ai-chat/ai-chat-code-block";
7-
import { cn } from "#/lib/utils";
87

98
type AiChatMessageResponseProps = ComponentProps<typeof Streamdown> & {
109
isStreaming?: boolean;
@@ -33,7 +32,7 @@ export function AiChatMessageResponse({
3332
return (
3433
<Streamdown
3534
animated={streamdownAnimation}
36-
className={cn("w-full max-w-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className)}
35+
className={className}
3736
components={{ ...streamdownComponents, ...components }}
3837
isAnimating={isStreaming}
3938
mode="streaming"

src/features/workspaces/components/ai-chat/ai-chat-tool-receipts.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ function summarizeFailedTool(toolName: string, output: unknown, toolInput: unkno
9292
getBaseName(getString(outputRecord.path) ?? getPathFromToolInput(toolInput)),
9393
)}`;
9494
case "workspace_list_items":
95+
return failedCount > 0
96+
? `Couldn’t list ${formatCount(failedCount, "item")}`
97+
: "Couldn’t list workspace";
9598
case "workspace_read_items":
9699
return failedCount > 0
97100
? `Couldn’t read ${formatCount(failedCount, "item")}`

0 commit comments

Comments
 (0)