fix(memory): batch semantic processing in _process_memory_directory#1304
Merged
MaojiaSheng merged 1 commit intomainfrom Apr 8, 2026
Merged
fix(memory): batch semantic processing in _process_memory_directory#1304MaojiaSheng merged 1 commit intomainfrom
MaojiaSheng merged 1 commit intomainfrom
Conversation
…o prevent CPU spikes (#1245)
zhoujh01
approved these changes
Apr 8, 2026
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
MaojiaSheng
approved these changes
Apr 8, 2026
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.
Summary
修复记忆目录分批语义处理以防止协程调度风暴
fix: batch semantic processing in _process_memory_directory to prevent CPU spikes (#1245)
Type of Change
Testing
分批并发控制 : 在 semantic_processor.py 中,将无限制的 asyncio.gather 改造为按批次循环执行。
动态计算批大小: min(max_concurrent_llm, 10) ,确保单次提交给事件循环的任务量可控。
增加批次处理日志,提升后台任务的可观测性。
Unit tests pass
Manual testing completed
Related Issues
_process_memory_directorylaunches hundreds of concurrent coroutines viaasyncio.gather, causing 100% CPU on low-core machines #1245Checklist