Repository navigation
Fix: get memory size cache rightly - #18370
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change corrects the argument order in the memory-size cache lookup within ChangesMemory cache lookup correction
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This is a narrowly scoped cache fix with no actionable merge-blocking risk remaining; it is merge-ready after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
wangq8
left a comment
There was a problem hiding this comment.
Verified against the signature get_memory_size_cache(memory_id: str, uid: str) in api/db/joint_services/memory_message_service.py.
The function builds the Redis key from the first argument (memory_{memory_id}) and passes [memory_id], [uid] to MessageService.calculate_memory_size. The old call get_memory_size_cache(memory.tenant_id, memory.id) therefore:
- used the wrong Redis key (
memory_{tenant_id}instead ofmemory_{memory_id}), and - swapped the
calculate_memory_sizearguments.
The new order get_memory_size_cache(memory.id, memory.tenant_id) matches the signature and is consistent with the other call sites (init_memory_size_cache and line 341). This is a correct, minimal fix. LGTM.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18370 +/- ##
==========================================
- Coverage 94.56% 90.65% -3.91%
==========================================
Files 10 10
Lines 717 717
Branches 118 118
==========================================
- Hits 678 650 -28
- Misses 25 39 +14
- Partials 14 28 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
As title.