fix: honor realtime setting for V2 learning - #233
Merged
EterUltimate merged 3 commits intoJul 1, 2026
Merged
Conversation
Contributor
Reviewer's GuideAdjusts persona review polling logs to use DEBUG instead of INFO for routine dashboard polling, and adds a regression test to ensure these diagnostic messages no longer appear at INFO level. Sequence diagram for dashboard persona update polling with DEBUG loggingsequenceDiagram
actor Dashboard
participant WebServer
participant PersonaReviewService
participant PersonaUpdater
participant DatabaseManager
participant Logger
Dashboard->>WebServer: GET /api/persona_updates
WebServer->>PersonaReviewService: get_pending_persona_updates(limit, offset)
opt persona_updater available
PersonaReviewService->>Logger: debug("正在获取传统人格更新...")
PersonaReviewService->>PersonaUpdater: get_pending_persona_updates()
PersonaUpdater-->>PersonaReviewService: traditional_updates
PersonaReviewService->>Logger: debug("获取到 {len(traditional_updates)} 个传统人格更新")
end
opt database_manager available (persona learning)
PersonaReviewService->>Logger: debug("正在获取人格学习审查...")
PersonaReviewService->>DatabaseManager: get_pending_persona_learning_reviews()
DatabaseManager-->>PersonaReviewService: persona_learning_reviews
PersonaReviewService->>Logger: debug("获取到 {len(persona_learning_reviews)} 个人格学习审查")
end
opt database_manager available (style learning)
PersonaReviewService->>Logger: debug("正在获取风格学习审查...")
PersonaReviewService->>DatabaseManager: get_pending_style_reviews()
DatabaseManager-->>PersonaReviewService: style_reviews
PersonaReviewService->>Logger: debug("获取到 {len(style_reviews)} 个风格学习审查")
end
PersonaReviewService->>Logger: debug("共 {total} 条人格更新记录 ...")
PersonaReviewService->>Logger: debug("分页返回: offset={offset}, limit={limit}, 本页 {len(paged_updates)} 条")
PersonaReviewService-->>WebServer: paged_updates
WebServer-->>Dashboard: JSON persona updates
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The regression test hardcodes all the Chinese log message substrings, which makes it brittle to future rewording; consider asserting on log level and a smaller number of distinctive markers (or using a pattern) rather than the full text for each step.
- Instead of monkeypatching the module-level
loggerwith a customFakeLogger, you could use pytest'scaplogfixture to assert on log levels and messages, which would keep the test closer to the real logging behavior and reduce boilerplate.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The regression test hardcodes all the Chinese log message substrings, which makes it brittle to future rewording; consider asserting on log level and a smaller number of distinctive markers (or using a pattern) rather than the full text for each step.
- Instead of monkeypatching the module-level `logger` with a custom `FakeLogger`, you could use pytest's `caplog` fixture to assert on log levels and messages, which would keep the test closer to the real logging behavior and reduce boilerplate.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
EterUltimate
force-pushed
the
codex/reduce-persona-review-log-noise
branch
from
July 1, 2026 09:06
43ae82a to
17ae8c4
Compare
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
enable_realtime_learningbefore V2 per-message processing so realtime-off setups do not keep triggering V2 tiered learning on every messageenable_realtime_v2_processingin config/schema as an explicit opt-in for users who still want V2 realtime ingestion while realtime learning is off/api/persona_updatespolling logs at DEBUG so dashboard refreshes no longer look like learning jobsEvidence
services/learning/message_pipeline.pypreviously calledself._v2_integration.process_message(...)for every inbound message whenever V2 integration existed, independent ofenable_realtime_learning.services/core_learning/v2_learning_integration.pyregisters Tier 2 LLM-heavy operations including LightRAG/Mem0 ingestion flush every 5 messages or 60 seconds and jargon inference every 20 messages or 180 seconds usingllm.generate_response.services/learning/group_orchestrator.pystill respectslearning_interval_hours, so the high-frequency path is the V2 realtime/tiered trigger, not the 6-hour scheduler./api/persona_updatespolling; those diagnostics remain downgraded from INFO to DEBUG.Tests
python -m pytest tests\unit\test_learning_chain_regressions.py tests\unit\test_config.py tests\unit\test_config_service.py tests\unit\test_persona_review_service.py -q(159 passed)python -m py_compile services\learning\message_pipeline.py config.py tests\unit\test_learning_chain_regressions.py tests\unit\test_config.py webui\services\persona_review_service.py tests\unit\test_persona_review_service.pypython -m ruff check services\learning\message_pipeline.py config.py tests\unit\test_learning_chain_regressions.py tests\unit\test_config.py webui\services\persona_review_service.py tests\unit\test_persona_review_service.pygit diff --checkInstall validation
C:\Users\zacza\Desktop\x\AstrBot\data\plugins\astrbot_plugin_self_learning, run py_compile, import smoke, and pre-review.Access deniedreading/writing the installed plugin directory; no permission changes attempted.Refs #232