Repository navigation
feat(memory): add semantic maintenance rebuild - #631
Conversation
|
Warning Review limit reached
More reviews will be available in 50 minutes and 22 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds a semantic memory maintainer for rebuilding and reporting semantic memory state, adds offset-based topic listing to the topic store, and extends tests for paginated rebuilds, unstable scans, status reporting, and query ordering. ChangesSemantic maintenance and pagination
Sequence Diagram(s)sequenceDiagram
participant SemanticMemoryMaintainer
participant TopicListingStore
participant ReviewedMemoryListingStore
participant SemanticMemorySyncer
SemanticMemoryMaintainer->>TopicListingStore: list_topics(limit=batch_size, offset=0)
loop scan finalized topics
TopicListingStore-->>SemanticMemoryMaintainer: TopicRecord page
SemanticMemoryMaintainer->>TopicListingStore: list_topics(limit=batch_size, offset=next_offset)
end
SemanticMemoryMaintainer->>ReviewedMemoryListingStore: list_memories
SemanticMemoryMaintainer->>SemanticMemorySyncer: rebuild(topics, reviewed_memories)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@coding-agent/src/coding_agent/topics/semantic_maintenance.py`:
- Around line 95-116: The full rebuild scan in semantic_maintenance.py is using
offset-based paging, which causes repeated rescans and poor scaling in large
finalized-topic sets. Update the rebuild loop in the topic scan logic (the
iterator around list_topics in the semantic maintenance flow) to use
keyset/cursor pagination or a snapshot-aware iterator instead of offset +=
len(page), and keep the duplicate-topic safety check in place while switching to
a stable resume key such as created_at/topic_id or an equivalent cursor from the
topic store.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: d007165b-d01f-4b31-ba90-970b83acc9c2
📒 Files selected for processing (4)
coding-agent/src/coding_agent/topics/semantic_maintenance.pycoding-agent/src/coding_agent/topics/store.pycoding-agent/tests/coding_agent/test_semantic_maintenance.pycoding-agent/tests/coding_agent/test_topic_store.py
Summary
SemanticMemoryMaintainerservice for destructive semantic memory rebuild/status operationsPGTopicStore.list_topics(..., offset=...)support with stablecreated_at, topic_idorderingVerification
uv run ruff check src/coding_agent/topics/semantic_maintenance.py src/coding_agent/topics/store.py tests/coding_agent/test_semantic_maintenance.py tests/coding_agent/test_topic_store.pyuv run pytest tests/coding_agent/test_semantic_maintenance.py tests/coding_agent/test_topic_store.py tests/coding_agent/test_semantic_sync.py -quv run pytest tests/coding_agent/ -qNotes
Summary by CodeRabbit
New Features
Bug Fixes
Tests