[PR #17] [MERGED] fix: concurrent generation across chats + UI bug fixes #4396

Closed
opened 2026-10-22 04:07:15 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/17
Author: @SpicyMarinara
Created: 3/23/2026
Status: ✅ Merged
Merged: 3/23/2026
Merged by: @SpicyMarinara

Base: main ← Head: fix/concurrent-generation-and-ui-bugs


📝 Commits (3)

  • cd905de fix: concurrent generation across chats + UI bug fixes
  • 1e4d39f fix: address Copilot PR review comments
  • baf035e fix: agents, preset variables, background persistence, timestamp stripping

📊 Changes

12 files changed (+290 additions, -138 deletions)

View changed files

📝 README.md (+7 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+8 -8)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+10 -2)
📝 packages/client/src/components/chat/ChatSetupWizard.tsx (+47 -8)
📝 packages/client/src/components/chat/ConversationView.tsx (+2 -2)
📝 packages/client/src/components/layout/ChatSidebar.tsx (+2 -2)
📝 packages/client/src/hooks/use-autonomous-messaging.ts (+4 -4)
📝 packages/client/src/hooks/use-background-autonomous.ts (+5 -5)
📝 packages/client/src/hooks/use-generate.ts (+100 -69)
📝 packages/client/src/stores/chat.store.ts (+77 -9)
📝 packages/client/src/stores/ui.store.ts (+9 -0)
📝 packages/server/src/routes/generate.routes.ts (+19 -29)

📄 Description

Summary

Fixes cross-chat generation corruption where sending a message to one DnD chat and switching to another would cause messages to vanish or UI state to get corrupted.

Concurrent Generation Isolation

  • Added isActiveChat() helper in use-generate.ts that gates all global UI state updates behind an active-chat check
  • SSE events from background generations no longer corrupt the active chat view
  • Per-chat perChatTyping and perChatDelayed maps in chat.store.ts track indicator state independently
  • setActiveChatId restores typing/delayed indicators AND streaming state when switching to a chat with an active generation
  • Typewriter setStreamBuffer calls gated behind isActiveChat() to prevent buffer corruption

Bug Fixes from QA

  • chat_summary event now invalidates the correct chat (generating chat, not active chat)
  • reset() now clears streamingChatId and regenerateMessageId

Other UI Fixes

  • Mobile delete button visibility in ChatSidebar
  • Save conversation prompt as default across new conversations
  • New conversation wizard scroll fix
  • User status persistence across page refresh

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/17 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 3/23/2026 **Status:** ✅ Merged **Merged:** 3/23/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `fix/concurrent-generation-and-ui-bugs` --- ### 📝 Commits (3) - [`cd905de`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cd905dedbabfeb1d003c655f784a9836fc7436a0) fix: concurrent generation across chats + UI bug fixes - [`1e4d39f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1e4d39ffa237a1e009c1f7dd8ae8fc29e8def605) fix: address Copilot PR review comments - [`baf035e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/baf035eda98b807685dc278063edefbc0500760b) fix: agents, preset variables, background persistence, timestamp stripping ### 📊 Changes **12 files changed** (+290 additions, -138 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+7 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+8 -8) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+10 -2) 📝 `packages/client/src/components/chat/ChatSetupWizard.tsx` (+47 -8) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+2 -2) 📝 `packages/client/src/components/layout/ChatSidebar.tsx` (+2 -2) 📝 `packages/client/src/hooks/use-autonomous-messaging.ts` (+4 -4) 📝 `packages/client/src/hooks/use-background-autonomous.ts` (+5 -5) 📝 `packages/client/src/hooks/use-generate.ts` (+100 -69) 📝 `packages/client/src/stores/chat.store.ts` (+77 -9) 📝 `packages/client/src/stores/ui.store.ts` (+9 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+19 -29) </details> ### 📄 Description ## Summary Fixes cross-chat generation corruption where sending a message to one DnD chat and switching to another would cause messages to vanish or UI state to get corrupted. ### Concurrent Generation Isolation - Added `isActiveChat()` helper in `use-generate.ts` that gates all global UI state updates behind an active-chat check - SSE events from background generations no longer corrupt the active chat view - Per-chat `perChatTyping` and `perChatDelayed` maps in `chat.store.ts` track indicator state independently - `setActiveChatId` restores typing/delayed indicators AND streaming state when switching to a chat with an active generation - Typewriter `setStreamBuffer` calls gated behind `isActiveChat()` to prevent buffer corruption ### Bug Fixes from QA - `chat_summary` event now invalidates the correct chat (generating chat, not active chat) - `reset()` now clears `streamingChatId` and `regenerateMessageId` ### Other UI Fixes - Mobile delete button visibility in ChatSidebar - Save conversation prompt as default across new conversations - New conversation wizard scroll fix - User status persistence across page refresh --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:07:15 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4396
No description provided.