Skip to content

Commit 9dcc079

Browse files
committed
fix: refine message handling for assistant role in chat and update shell component props
1 parent b8c5cb9 commit 9dcc079

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/components/chat/hooks/useChatRealtimeHandlers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export function useChatRealtimeHandlers({
344344
return;
345345
}
346346

347-
if (structuredMessageData && Array.isArray(structuredMessageData.content)) {
347+
if (structuredMessageData && Array.isArray(structuredMessageData.content) && structuredMessageData.role === 'assistant') {
348348
const parentToolUseId = rawStructuredData?.parentToolUseId;
349349

350350
structuredMessageData.content.forEach((part: any) => {
@@ -415,7 +415,7 @@ export function useChatRealtimeHandlers({
415415
]);
416416
}
417417
});
418-
} else if (structuredMessageData && typeof structuredMessageData.content === 'string' && structuredMessageData.content.trim()) {
418+
} else if (structuredMessageData && structuredMessageData.role === 'assistant' && typeof structuredMessageData.content === 'string' && structuredMessageData.content.trim()) {
419419
let content = decodeHtmlEntities(structuredMessageData.content);
420420
content = formatUsageLimitText(content);
421421
setChatMessages((previous) => [

src/components/main-content/view/MainContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function MainContent({
139139

140140
{activeTab === 'shell' && (
141141
<div className="h-full w-full overflow-hidden">
142-
<AnyStandaloneShell project={selectedProject} session={selectedSession} showHeader={false} />
142+
<AnyStandaloneShell project={selectedProject} session={selectedSession} isPlainShell={true} showHeader={false} />
143143
</div>
144144
)}
145145

0 commit comments

Comments
 (0)