Skip to content

Fix memory consolidation race, whisper import, and chat sidebar sync#1160

Open
PaoloC68 wants to merge 3 commits intoagent0ai:developmentfrom
PaoloC68:fix/misc-bugfixes
Open

Fix memory consolidation race, whisper import, and chat sidebar sync#1160
PaoloC68 wants to merge 3 commits intoagent0ai:developmentfrom
PaoloC68:fix/misc-bugfixes

Conversation

@PaoloC68
Copy link

@PaoloC68 PaoloC68 commented Mar 1, 2026

Fixes #1163

Summary

Three independent bug fixes for stability:

  • Memory consolidation data loss: Concurrent fragment consolidation could overwrite each other's results. Switched from full-dict replacement to targeted key updates so parallel consolidations merge safely.
  • Whisper import crash: Environments without OpenAI Whisper installed crash on import. Added graceful fallback that logs a warning and disables STT instead of crashing the server.
  • Chat sidebar stale after load: Loading a chat via API didn't call mark_dirty_all(), so the sidebar list didn't refresh. Added the missing call.

Changes

File Change
plugins/_memory/helpers/memory_consolidation.py Use targeted key updates instead of full dict replacement
helpers/whisper.py Wrap whisper import in try/except with fallback
api/chat_load.py Add mark_dirty_all() call after chat load

Testing

Each fix addresses a specific production issue. Changes are minimal and isolated.

When _handle_update encounters a memory ID that was deleted by a
concurrent consolidation task (fragments + solutions run in parallel
on the same background event loop), the updated content was silently
discarded via 'continue'. Now the insert always runs — only the
delete is skipped when the original is already gone.
Every other chat mutation API (chat_create, chat_reset, chat_remove) calls
mark_dirty_all() to push sidebar updates via WebSocket. chat_load was the
only one missing it, causing loaded chats to not appear until full restart.
@PaoloC68 PaoloC68 force-pushed the fix/misc-bugfixes branch from c8b0a1a to 7ac08d6 Compare March 12, 2026 10:55
@PaoloC68
Copy link
Author

Updated the PR description to reflect the file paths after the recent refactor (python/ → root, plugins/memory → plugins/_memory). The branch was already rebased onto current development — code is up to date, just the description was stale. Ready for review when you get a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant