Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

Refactor ChatAPIClient to remove turn ID from error handling and content delivery

Salman-Ahamed96db6a59e0b7
diff --git a/packages/app/src/react/features/ai-chat/clients/chat-api.client.ts b/packages/app/src/react/features/ai-chat/clients/chat-api.client.ts
index f6cb1b61..103a2ab1 100644
--- a/packages/app/src/react/features/ai-chat/clients/chat-api.client.ts
+++ b/packages/app/src/react/features/ai-chat/clients/chat-api.client.ts
@@ -244,14 +244,10 @@ export class ChatAPIClient {
const { onContent, onMetaMessages } = callbacks;
const processed = parseChunk(chunk);
- // Extract conversation turn ID from chunk
- const turnId = chunk.conversationTurnId;
-
// Handle errors - throw to stop stream processing, catch block will handle error notification
if (processed.hasError) {
const error: TChatError = {
type: 'stream',
- turnId, // Include turn ID in error
message: processed.error || 'Unknown error occurred',
};
throw error;
@@ -265,8 +261,7 @@ export class ChatAPIClient {
// Handle content (final response)
if (processed.hasContent) {
- // Deliver content with turn ID
- onContent(processed.content, turnId);
+ onContent(processed.content);
}
}