diff --git a/apps/desktop/layer/renderer/src/modules/ai-chat/store/chat-core/chat-actions.ts b/apps/desktop/layer/renderer/src/modules/ai-chat/store/chat-core/chat-actions.ts index 04fc40716..da4a25947 100644 --- a/apps/desktop/layer/renderer/src/modules/ai-chat/store/chat-core/chat-actions.ts +++ b/apps/desktop/layer/renderer/src/modules/ai-chat/store/chat-core/chat-actions.ts @@ -173,10 +173,16 @@ export class ChatSliceActions { } } - regenerate = async ({ messageId }: { messageId: string }) => { + regenerate = async ({ messageId, ...options }: { messageId: string } & ChatRequestOptions) => { try { // Use the AI SDK's regenerate method - const response = await this.chatInstance.regenerate({ messageId }) + const finalOptions = merge( + { + body: { scene: this.get().scene }, + }, + options, + ) + const response = await this.chatInstance.regenerate({ messageId, ...finalOptions }) return response } catch (error) { this.setError(error as Error)