Skip to content

Python: drop the memory placeholder only when it is the sole entry - #9726

Open
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
microsoft:mainfrom
ManoharPaturi:fix/memory-none-yet-placeholder
Open

Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
microsoft:mainfrom
ManoharPaturi:fix/memory-none-yet-placeholder

Conversation

@ManoharPaturi

Copy link
Copy Markdown
Contributor

Motivation & Context

to_markdown() writes - none yet as the placeholder for an empty memory list, and from_markdown() filtered every bullet equal to that text so the placeholder would not become a memory. The filter could not tell the placeholder from a real memory whose text happened to be exactly none yet, so that memory was silently dropped on every read. Reproduced on main: a topic written with ["none yet", "real fact"] reads back as ["real fact"], and the loss repeats on every reparsing pass.

Description & Review Guide

  • What are the major changes? Parsing now keeps every bullet, and the placeholder is removed once after the loop, only when it is the sole entry.
  • What is the impact of these changes? That sole-entry shape is the only one the write side produces for an empty memory list, so empty lists still round trip to empty. A genuine memory equal to the placeholder text survives.
  • What do you want reviewers to focus on? The two round trip tests: the mixed list keeps both memories (fails on main), and the empty list still reads back empty.

Related Issue

Fixes #9725

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

from_markdown filtered every bullet equal to the empty-list placeholder, so a genuine memory whose text happened to equal it was silently dropped on every read. The placeholder is now filtered once after parsing, and only when it is the sole entry, which is the only shape the write side emits for an empty memory list.

Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
github-app-auth — 7ab1db89 Deployed Oct 26, 2026 by ManoharPaturi via team_check #7561
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: a memory whose text equals the none yet placeholder is silently dropped on read

1 participant