fix(session): extract meaningful abstract from WM v2 summaries#1868
Open
liuhang93 wants to merge 1 commit into
Open
fix(session): extract meaningful abstract from WM v2 summaries#1868liuhang93 wants to merge 1 commit into
liuhang93 wants to merge 1 commit into
Conversation
`_extract_abstract_from_summary` always returned `# Working Memory` (the heading) for WM v2 documents because the v1 regex missed and the fallback grabbed the first line. Add a v2-aware regex that extracts the Session Title content, and improve the final fallback to skip markdown headings. Co-authored-by: Cursor <cursoragent@cursor.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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
_extract_abstract_from_summaryreturned# Working Memory(the markdown heading) for all WM v2 archives because the v1 regex didn't match and the fallback simply grabbed the first lineContext
PR #1782 introduced Working Memory v2 with a
# Working Memory/## Session Titlestructure, but_extract_abstract_from_summarywas not updated to handle the new format. As a result,.abstract.mdfor every WM v2 archive is always the literal string# Working Memory, losing all semantic value.Before (bug)
After (fix)
Changes
openviking/session/session.py— 3-tier extraction:**One-sentence overview**: <text>(unchanged, backward compatible)## Session Title→ skip optional italic description → capture content#-prefixed headingstests/unit/session/test_wm_v2_guards.py— AddedTestExtractAbstractclass with 10 test cases covering v1, v2 (with/without italic descriptions), heading-skip fallback, and edge cases.Test plan
_A short and distinctive..._)# Working Memoryas abstractMade with Cursor