Feat/merge api refactor to dev#542
Merged
CaralHsi merged 30 commits intoMemTensor:devfrom Nov 27, 2025
Merged
Conversation
glin93
pushed a commit
that referenced
this pull request
Nov 27, 2025
* new type * llm reconstruct and add search api modify * llm construction * add delete and get, modify chat * modify code * modify code * modify code * coding chat * fix bug in get and delete * add internet reference in playground chat stream * remove moscube * modify code * fix pre_commit * fix make test * finish info transfer * add info and custom tags * modify model product fileds * fix get api bug * fix bug * fix bug in pref add info --------- Co-authored-by: yuan.wang <yuan.wang@yuanwangdebijibendiannao.local> Co-authored-by: CaralHsi <caralhsi@gmail.com>
glin93
pushed a commit
that referenced
this pull request
Nov 27, 2025
* new type * llm reconstruct and add search api modify * llm construction * add delete and get, modify chat * modify code * modify code * modify code * coding chat * fix bug in get and delete * add internet reference in playground chat stream * remove moscube * modify code * fix pre_commit * fix make test * finish info transfer * add info and custom tags * modify model product fileds * fix get api bug * fix bug * fix bug in pref add info --------- Co-authored-by: yuan.wang <yuan.wang@yuanwangdebijibendiannao.local> Co-authored-by: CaralHsi <caralhsi@gmail.com>
glin93
added a commit
that referenced
this pull request
Nov 28, 2025
* feat: implement task_id monitoring system with Redis-based status tracking
Core Changes:
- Add task_id field to ScheduleMessageItem and ScheduleLogForWebItem schemas
- Implement TaskStatusTracker with Redis backend for task status persistence
- Support task_id to item_id mapping (one task can have multiple items)
- Add /scheduler/status endpoint with task_id query support
Status Tracking:
- TaskStatusTracker records task lifecycle: waiting -> in_progress -> completed/failed
- Redis keys: memos:task_meta:{user_id} for item status
- Redis keys: memos:task_items:{user_id}:{task_id} for task->items mapping
- Aggregated status query: returns 'in_progress' if any item is active
API Changes:
- Add task_id field to MemoryCreateRequest for /product/add monitoring
- Wrap product_router.create_memory() with status tracking
- Update scheduler_handler to query by business task_id or item_id
Integration Fixes:
- Fix single_cube.py to use scheduler.submit_messages() instead of direct queue access
- Fix chat_handler.py to use scheduler.submit_messages() for proper monitoring
- Ensure all messages pass through BaseScheduler for metrics and status tracking
Benefits:
- Frontend can query task status via /scheduler/status?user_id=xxx&task_id=yyy
- Support batch operations monitoring (one task_id, multiple async operations)
- Unified monitoring for add/chat/scheduler operations
- No performance impact (<1ms overhead per task)
* Feat/merge api refactor to dev (#542)
* new type
* llm reconstruct and add search api modify
* llm construction
* add delete and get, modify chat
* modify code
* modify code
* modify code
* coding chat
* fix bug in get and delete
* add internet reference in playground chat stream
* remove moscube
* modify code
* fix pre_commit
* fix make test
* finish info transfer
* add info and custom tags
* modify model product fileds
* fix get api bug
* fix bug
* fix bug in pref add info
---------
Co-authored-by: yuan.wang <yuan.wang@yuanwangdebijibendiannao.local>
Co-authored-by: CaralHsi <caralhsi@gmail.com>
* fix: Complete task_id propagation for addMemory and updateMemory logs
* feat: Refactor task ID handling for clarity and correctness
This commit refactors the handling of task IDs throughout the system to ensure
consistency and correctness, addressing previous ambiguities and potential issues.
Key changes include:
- Streamlining the ScheduleMessageItem to use a single 'task_id' field,
representing the business-level identifier, thereby removing redundancy and
Pydantic field clashes.
- Modifying the /product/add API endpoint to correctly distinguish between the
internal item_id (UUID) and the business-level task_id provided in the request,
ensuring proper tracking in the status monitoring system.
- Propagating the task_id consistently through MOSProduct, MOSCore, and
SingleCubeView components, ensuring it reaches the ScheduleMessageItem.
- Verifying that both the Redis-based status monitoring and the web logging
systems correctly receive and utilize the business-level task_id, eliminating
race conditions and ensuring accurate tracking.
* fix: Correct SyntaxError in MOSProduct.add method
The previous commit introduced a SyntaxError in the MOSProduct.add method due
to incorrect multi-line argument formatting for the super().add() call. This
commit fixes the syntax by properly enclosing the arguments in parentheses
for multi-line continuation. It also incorporates minor formatting changes
identified by ruff.
* feat: Pass user_name to get_current_memory_size
Modify the call to in to
include . This ensures that memory sizes are retrieved
for the correct MemCube/tenant context, aligning with multi-tenant monitoring
requirements outlined in design documents. Previously, this call did not pass
the user context, potentially leading to incorrect memory size reporting in
multi-tenant environments.
* feat: Implement Knowledge Base logging format in GeneralScheduler
This commit implements the new logging format for the 'Knowledge Base'
scenario within the function of the
.
Key changes:
- Introduced a conditional logging path based on the
environment variable,
distinguishing between Knowledge Base logging and existing Playground/Default logging.
- Refactored the memory processing loop to correctly fetch the
for operations by querying the graph store for the existing memory item's content.
- Ensured that and operations for the Knowledge Base scenario
produce a single, structured with
adhering to the new design document, including the
and the correctly populated for updates.
- Maintained backward compatibility for existing Playground/Default logging paths
by reconstructing their expected data structures.
* fix: Resolve F821 error and duplicate timestamp; enhance KB logging
This commit addresses two new issues introduced in recent changes:
- Corrected an F821 'Undefined name os' error in by adding the missing import.
- Fixed a in which was a result of an incorrect merge during rebase.
Additionally, this commit finalizes the implementation of the 'Knowledge Base'
logging format in by ensuring that
for operations is correctly fetched from the graph store. This
guarantees that the new log format fully adheres to the design specifications,
providing complete and accurate information for update events.
* fix: Finalize general_scheduler.py and single_cube.py changes
This commit finalizes the changes to and .
In :
- The method has been fully refactored to correctly
handle Knowledge Base logging, including fetching for
UPDATE operations and ensuring proper conditional logging based on
environment variables.
- The module is now correctly imported.
In :
- The duplicate keyword argument in the method
has been removed, resolving a .
These changes address all identified issues and ensure the code is clean,
correct, and fully compatible with both Knowledge Base and Playground logging
requirements, adhering to the specified design principles.
* fix(scheduler): Correct misleading logs in reorganize consumer
The and its helper function
contained several logging errors
due to being copied from the 'mem_read' consumer without modification.
This commit corrects the following:
- The handler info log now correctly uses the .
- All log messages now refer to 'mem_reorganize' instead of 'mem_read'.
- Exception logs now correctly cite
and as the source of the error.
These changes ensure that the logs for the reorganize functionality are
accurate and not misleading, which is critical for monitoring and debugging.
The core business logic of the function, which appears to be missing,
has not been altered.
* refactor(format): Reformat general_scheduler.py with ruff
This commit reformats
to adhere to the project's Ruff formatting standards. This resolves
the 942 files already formatted failure in the CI pipeline.
* fix: restore user_name on async mem_read submission
---------
Co-authored-by: glin1993@outlook.com <>
Co-authored-by: Wang Daoji <75928131+Wang-Daoji@users.noreply.github.com>
Co-authored-by: yuan.wang <yuan.wang@yuanwangdebijibendiannao.local>
Co-authored-by: CaralHsi <caralhsi@gmail.com>
tianxing02
pushed a commit
to tianxing02/MemOS
that referenced
this pull request
Feb 24, 2026
* new type * llm reconstruct and add search api modify * llm construction * add delete and get, modify chat * modify code * modify code * modify code * coding chat * fix bug in get and delete * add internet reference in playground chat stream * remove moscube * modify code * fix pre_commit * fix make test * finish info transfer * add info and custom tags * modify model product fileds * fix get api bug * fix bug * fix bug in pref add info --------- Co-authored-by: yuan.wang <yuan.wang@yuanwangdebijibendiannao.local> Co-authored-by: CaralHsi <caralhsi@gmail.com>
tianxing02
pushed a commit
to tianxing02/MemOS
that referenced
this pull request
Feb 24, 2026
* feat: implement task_id monitoring system with Redis-based status tracking
Core Changes:
- Add task_id field to ScheduleMessageItem and ScheduleLogForWebItem schemas
- Implement TaskStatusTracker with Redis backend for task status persistence
- Support task_id to item_id mapping (one task can have multiple items)
- Add /scheduler/status endpoint with task_id query support
Status Tracking:
- TaskStatusTracker records task lifecycle: waiting -> in_progress -> completed/failed
- Redis keys: memos:task_meta:{user_id} for item status
- Redis keys: memos:task_items:{user_id}:{task_id} for task->items mapping
- Aggregated status query: returns 'in_progress' if any item is active
API Changes:
- Add task_id field to MemoryCreateRequest for /product/add monitoring
- Wrap product_router.create_memory() with status tracking
- Update scheduler_handler to query by business task_id or item_id
Integration Fixes:
- Fix single_cube.py to use scheduler.submit_messages() instead of direct queue access
- Fix chat_handler.py to use scheduler.submit_messages() for proper monitoring
- Ensure all messages pass through BaseScheduler for metrics and status tracking
Benefits:
- Frontend can query task status via /scheduler/status?user_id=xxx&task_id=yyy
- Support batch operations monitoring (one task_id, multiple async operations)
- Unified monitoring for add/chat/scheduler operations
- No performance impact (<1ms overhead per task)
* Feat/merge api refactor to dev (MemTensor#542)
* new type
* llm reconstruct and add search api modify
* llm construction
* add delete and get, modify chat
* modify code
* modify code
* modify code
* coding chat
* fix bug in get and delete
* add internet reference in playground chat stream
* remove moscube
* modify code
* fix pre_commit
* fix make test
* finish info transfer
* add info and custom tags
* modify model product fileds
* fix get api bug
* fix bug
* fix bug in pref add info
---------
Co-authored-by: yuan.wang <yuan.wang@yuanwangdebijibendiannao.local>
Co-authored-by: CaralHsi <caralhsi@gmail.com>
* fix: Complete task_id propagation for addMemory and updateMemory logs
* feat: Refactor task ID handling for clarity and correctness
This commit refactors the handling of task IDs throughout the system to ensure
consistency and correctness, addressing previous ambiguities and potential issues.
Key changes include:
- Streamlining the ScheduleMessageItem to use a single 'task_id' field,
representing the business-level identifier, thereby removing redundancy and
Pydantic field clashes.
- Modifying the /product/add API endpoint to correctly distinguish between the
internal item_id (UUID) and the business-level task_id provided in the request,
ensuring proper tracking in the status monitoring system.
- Propagating the task_id consistently through MOSProduct, MOSCore, and
SingleCubeView components, ensuring it reaches the ScheduleMessageItem.
- Verifying that both the Redis-based status monitoring and the web logging
systems correctly receive and utilize the business-level task_id, eliminating
race conditions and ensuring accurate tracking.
* fix: Correct SyntaxError in MOSProduct.add method
The previous commit introduced a SyntaxError in the MOSProduct.add method due
to incorrect multi-line argument formatting for the super().add() call. This
commit fixes the syntax by properly enclosing the arguments in parentheses
for multi-line continuation. It also incorporates minor formatting changes
identified by ruff.
* feat: Pass user_name to get_current_memory_size
Modify the call to in to
include . This ensures that memory sizes are retrieved
for the correct MemCube/tenant context, aligning with multi-tenant monitoring
requirements outlined in design documents. Previously, this call did not pass
the user context, potentially leading to incorrect memory size reporting in
multi-tenant environments.
* feat: Implement Knowledge Base logging format in GeneralScheduler
This commit implements the new logging format for the 'Knowledge Base'
scenario within the function of the
.
Key changes:
- Introduced a conditional logging path based on the
environment variable,
distinguishing between Knowledge Base logging and existing Playground/Default logging.
- Refactored the memory processing loop to correctly fetch the
for operations by querying the graph store for the existing memory item's content.
- Ensured that and operations for the Knowledge Base scenario
produce a single, structured with
adhering to the new design document, including the
and the correctly populated for updates.
- Maintained backward compatibility for existing Playground/Default logging paths
by reconstructing their expected data structures.
* fix: Resolve F821 error and duplicate timestamp; enhance KB logging
This commit addresses two new issues introduced in recent changes:
- Corrected an F821 'Undefined name os' error in by adding the missing import.
- Fixed a in which was a result of an incorrect merge during rebase.
Additionally, this commit finalizes the implementation of the 'Knowledge Base'
logging format in by ensuring that
for operations is correctly fetched from the graph store. This
guarantees that the new log format fully adheres to the design specifications,
providing complete and accurate information for update events.
* fix: Finalize general_scheduler.py and single_cube.py changes
This commit finalizes the changes to and .
In :
- The method has been fully refactored to correctly
handle Knowledge Base logging, including fetching for
UPDATE operations and ensuring proper conditional logging based on
environment variables.
- The module is now correctly imported.
In :
- The duplicate keyword argument in the method
has been removed, resolving a .
These changes address all identified issues and ensure the code is clean,
correct, and fully compatible with both Knowledge Base and Playground logging
requirements, adhering to the specified design principles.
* fix(scheduler): Correct misleading logs in reorganize consumer
The and its helper function
contained several logging errors
due to being copied from the 'mem_read' consumer without modification.
This commit corrects the following:
- The handler info log now correctly uses the .
- All log messages now refer to 'mem_reorganize' instead of 'mem_read'.
- Exception logs now correctly cite
and as the source of the error.
These changes ensure that the logs for the reorganize functionality are
accurate and not misleading, which is critical for monitoring and debugging.
The core business logic of the function, which appears to be missing,
has not been altered.
* refactor(format): Reformat general_scheduler.py with ruff
This commit reformats
to adhere to the project's Ruff formatting standards. This resolves
the 942 files already formatted failure in the CI pipeline.
* fix: restore user_name on async mem_read submission
---------
Co-authored-by: glin1993@outlook.com <>
Co-authored-by: Wang Daoji <75928131+Wang-Daoji@users.noreply.github.com>
Co-authored-by: yuan.wang <yuan.wang@yuanwangdebijibendiannao.local>
Co-authored-by: CaralHsi <caralhsi@gmail.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: (summary)
Fix: #(issue)
Docs Issue/PR: (docs-issue-or-pr-link)
Reviewer: @(reviewer)
Checklist: