Feature/memcube log structured logs rework#516
Merged
Conversation
- Replace fullwidth colon (:) with halfwidth colon (:) in all content fields - Update example file to use English UI text instead of Chinese for consistency - Ensure backend sends neutral data format for frontend i18n handling Changes: - scheduler_logger.py: Use halfwidth colon in content formatting - general_scheduler.py: Use halfwidth colon in content formatting - memos_w_scheduler.py: Replace Chinese UI text with English equivalents
Replace list(merged_target_ids)[0] with next(iter(merged_target_ids)) for better performance and readability.
- Format long lines for better readability - Align dictionary entries and function parameters - Follow project code style guidelines
- Fix API compatibility: replace self.dispatcher._group_messages_by_user_and_mem_cube() with standalone group_messages_by_user_and_mem_cube() function - Add graceful handling for uninitialized preference memory (pref_mem = None) - Improve error messages with mem_cube_id context Fixes: - AttributeError: SchedulerDispatcher object has no attribute _group_messages_by_user_and_mem_cube - TypeError: Expected PreferenceTextMemory but got NoneType Affected handlers: - _query_message_consumer - _answer_message_consumer - _add_message_consumer - _pref_add_message_consumer Tests: All handler tests passed (3/3)
…om:MemTensor/MemOS into feature/memcube-log-structured-logs-rework
- Add exchange_name and exchange_type fields to RabbitMQConfig - Support both fanout (Playground) and direct (Cloud Service) exchange types - Load exchange config from environment variables if provided - Maintain backward compatibility with default values (memos-fanout, fanout) - Enable multi-environment deployment (Playground + Cloud Service)
- Skip logging scheduleMemory events when no memory changes occur - Only generate logs when memcube_log_content is not empty - Applies to both working memory and activation memory updates - Improves frontend UX by reducing noise from empty scheduling events
…work - Resolved conflicts in scheduler files - Fixed group_messages_by_user_and_mem_cube usage (now standalone function) - Added pref_mem None check - Preserved RabbitMQ config enhancements (exchange_name, exchange_type) - Preserved empty scheduleMemory log filtering - Integrated latest dev changes (API refactor, LLM updates, multi_mem_cube)
tianxing02
pushed a commit
to tianxing02/MemOS
that referenced
this pull request
Feb 24, 2026
* feat: reapply structured memcube logs * refactor: replace fullwidth punctuation with halfwidth in log content - Replace fullwidth colon (:) with halfwidth colon (:) in all content fields - Update example file to use English UI text instead of Chinese for consistency - Ensure backend sends neutral data format for frontend i18n handling Changes: - scheduler_logger.py: Use halfwidth colon in content formatting - general_scheduler.py: Use halfwidth colon in content formatting - memos_w_scheduler.py: Replace Chinese UI text with English equivalents * style: fix RUF015 linter warning Replace list(merged_target_ids)[0] with next(iter(merged_target_ids)) for better performance and readability. * style: apply ruff formatting - Format long lines for better readability - Align dictionary entries and function parameters - Follow project code style guidelines * style: format server_router.py (inherited from dev branch) * feat: add debug console * feat: add debug console * fix: resolve scheduler handler compatibility issues - Fix API compatibility: replace self.dispatcher._group_messages_by_user_and_mem_cube() with standalone group_messages_by_user_and_mem_cube() function - Add graceful handling for uninitialized preference memory (pref_mem = None) - Improve error messages with mem_cube_id context Fixes: - AttributeError: SchedulerDispatcher object has no attribute _group_messages_by_user_and_mem_cube - TypeError: Expected PreferenceTextMemory but got NoneType Affected handlers: - _query_message_consumer - _answer_message_consumer - _add_message_consumer - _pref_add_message_consumer Tests: All handler tests passed (3/3) * feat: add debug console * feat: support configurable RabbitMQ exchange name and type - Add exchange_name and exchange_type fields to RabbitMQConfig - Support both fanout (Playground) and direct (Cloud Service) exchange types - Load exchange config from environment variables if provided - Maintain backward compatibility with default values (memos-fanout, fanout) - Enable multi-environment deployment (Playground + Cloud Service) * feat: filter empty scheduleMemory logs - Skip logging scheduleMemory events when no memory changes occur - Only generate logs when memcube_log_content is not empty - Applies to both working memory and activation memory updates - Improves frontend UX by reducing noise from empty scheduling events --------- Co-authored-by: glin1993@outlook.com <> Co-authored-by: harvey_xiang <harvey_xiang22@163.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary
Implement structured logging system for MemCube operations with enhanced observability and frontend integration.
实现 MemCube 操作的结构化日志系统,增强可观测性和前端集成能力。
Key Changes:
memcube_log_content,metadata,memcube_name,memory_lenfields for six event types (addMessage,addMemory,updateMemory,mergeMemory,archiveMemory,scheduleMemory)scheduleMemoryevents to reduce frontend noise主要变更:
Fix: N/A (Feature enhancement)
Reviewer: @CarltonXiang @tangg555 @CaralHsi
Deployment Notes
Cloud Service only: Add environment variables:
MEMSCHEDULER_RABBITMQ_EXCHANGE_NAME=memos-memory-change
MEMSCHEDULER_RABBITMQ_EXCHANGE_TYPE=directPlayground: No changes needed (uses defaults)
云服务部署: 添加上述环境变量
Playground: 无需修改
Checklist: