Skip to content

Python: preserve Unicode paths in in-memory file discovery - #8630

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
Shy7777:fix/maf-memory-round1-20260922
Sep 22, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
Shy7777:fix/maf-memory-round1-20260922

Conversation

@Shy7777

Copy link
Copy Markdown
Contributor

Motivation & Context

An agent that stores İstanbul/notes.md in InMemoryAgentFileStore cannot reliably discover and read it back: the directory listing reports İstanbul/, and listing or searching inside it returns otes.md. The lookup key uses lowercase text, where İ expands to two characters, but the original display path is sliced using offsets from that key.

Description & Review Guide

  • What are the major changes? Extract relative display paths by directory-component count, then split display names at their own separators. Add regressions for original and lowercase Unicode directory spellings, normalized trailing separators, nested directory deduplication, glob filtering, recursive search, and reading returned paths back.
  • What is the impact of these changes? Listings and search results preserve the file names that were written. Existing case-insensitive lookup, path normalization, ordering, and recursive-search behavior remain unchanged; there is no public API change.
  • What do you want reviewers to focus on? Whether display-path extraction preserves names independently of the lookup key's character count, while keeping directory scoping and case-insensitive deduplication intact.

Related Issue

Fixes #8623

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.

The six regression cases fail before the fix. The file-access and file-memory suites pass with the fix: 148 passed and 2 Windows-only skips. The complete repository unit suite was not run. The core package builds, the configured hooks pass, and source/test type checks pass for the changed files. The related tests emit the existing experimental-feature warning for AgentFileStore.

Copilot AI balanced review requested due to automatic review settings September 22, 2026 07:39

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sunhy (@Shy7777) Reviewed the complete diff; no high-confidence issues found.

Merged via the queue into microsoft:main with commit bd379d1 Sep 22, 2026
52 checks passed

This branch was previously deployed

1 inactive deployment
github-app-auth — e9cdcde4 Deployed Sep 22, 2026 by Shy7777 via team_check #5016
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: [Bug]: InMemoryAgentFileStore truncates Unicode display paths after lowercasing

3 participants