Skip to content

Python: preserve metadata-like text in memory topic summaries - #9079

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
ktz03:fix/memory-topic-summary-metadata
Oct 9, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
ktz03:fix/memory-topic-summary-metadata

Conversation

@ktz03

Copy link
Copy Markdown
Contributor

Motivation & Context

A memory topic summary starting with Updated: or Sessions: is currently parsed as metadata on reload. The summary disappears, and its text replaces the stored timestamp or originating session IDs. File-store reads and rebuilt index summaries inherit the same loss.

Description & Review Guide

  • What are the major changes? Parse Updated: and Sessions: as metadata only before entering a content section. Add regressions for public record and file-store round trips, index rebuilding, multiline summaries, and ordinary content controls.
  • What is the impact of these changes? Valid summary text is preserved alongside the original timestamp and session IDs. The canonical Markdown format and public API remain unchanged.
  • What do you want reviewers to focus on? The metadata/content boundary and preservation of existing preamble, bullet, and heading behavior. Seven focused cases reproduce four failures before the fix and all pass afterward. On Windows/Python 3.14.3, the core non-integration suite passed 8,298 tests with 40 skips and two expected failures (91.70% coverage); source Pyright, all five test type checkers, Ruff, changed-file hooks, and wheel/sdist builds passed. The suite also emitted existing OpenTelemetry exporter errors during process shutdown, reproduced on untouched main observability tests; they did not fail tests. No live-model or service integration run was performed.

Related Issue

Fixes #9078

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 18:54
@ktz03
LI (ktz03) deployed to github-app-auth October 5, 2026 18:54 — with GitHub Actions Active
@ktz03
LI (ktz03) deployed to github-app-auth October 5, 2026 18:54 — with GitHub Actions Active
@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Oct 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused parser change correctly addresses the reported data corruption and is thoroughly covered by regression tests.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes memory Markdown parsing so metadata-like summary text is preserved during reloads and index rebuilding.

Changes:

  • Restricts metadata parsing to the pre-content section.
  • Adds round-trip, file-store, multiline summary, and index regression tests.
File Description
python/​packages/​core/​agent_framework/​_harness/​_memory.py Enforces the metadata/content parsing boundary.
python/​packages/​core/​tests/​core/​test_harness_memory.py Covers affected summaries and storage workflows.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Merged via the queue into microsoft:main with commit 708b1ab Oct 9, 2026
53 checks passed

This branch was successfully deployed

1 active deployment
github-app-auth — dfb90119 Deployed Oct 9, 2026 by ktz03 via team_check #6419
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: memory topic summary labels overwrite stored metadata on reload

3 participants