Repository navigation
fix(memory): require semantic valid_at timestamp - #18462
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 (2)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe semantic prompt now directs undated facts to use the conversation time for ChangesSemantic timestamp guidance
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This PR makes the semantic-memory timestamp requirement explicit and adds focused regression coverage; no actionable merge-blocking risk remains beyond normal checks and review. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Lynn-Inf
left a comment
There was a problem hiding this comment.
No need to enforce valid_at default in templates — it's already defined in prompt_util.py#L48. Also, good to see the or empty removed on line 80 — thanks!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18462 +/- ##
=======================================
Coverage 90.65% 90.65%
=======================================
Files 10 10
Lines 717 717
Branches 118 118
=======================================
Hits 650 650
Misses 39 39
Partials 28 28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
## Summary - allow ISO 8601 normalization callers to provide an explicit fallback while preserving the existing default behavior - use the extraction conversation time when `valid_at` is missing or invalid - clear an invalid optional `invalid_at` instead of writing an unparseable value - include the rejected timestamp value in the error log This addresses the timestamp write-through portion of #18415. It is intentionally separate from #18462, which fixes the semantic output prompt. Co-authored-by: Loong <[email protected]>
Summary
valid_attimestamp in the semantic-memory output schemaThis addresses the deterministic prompt inconsistency reported in #18415. The invalid-timestamp fallback is intentionally left unchanged because selecting its replacement policy requires a separate design decision.
Testing
uvx --from pytest --with pytest-asyncio pytest --noconftest -q test/unit_test/memory/utils/test_prompt_util.pyuvx ruff check test/unit_test/memory/utils/test_prompt_util.pyuvx ruff format --check memory/utils/prompt_util.py test/unit_test/memory/utils/test_prompt_util.pypython -m py_compile memory/utils/prompt_util.py test/unit_test/memory/utils/test_prompt_util.py