Commit ab1ef1c
committed
fix(session-memory): deduplicate assistant messages when thinking is stripped
When a model with thinking/reasoning is used, the session JSONL persists
two copies of each assistant response: the raw version (with thinking
blocks + text) and a cleaned version (text only). The session-memory
hook's getRecentSessionContent() treated both as valid, producing
duplicate lines in generated memory files.
Fix by tracking the last assistant text and skipping consecutive
duplicates. This handles the dedup at the consumer level without
changing the storage layer.
Fixes #92563.1 parent 59950f7 commit ab1ef1c
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
50 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
51 | 62 | | |
52 | 63 | | |
53 | 64 | | |
| |||
0 commit comments