Repository navigation
Description
Description
InMemoryAgentFileStore.list_children() and search() return incorrect display paths when a directory contains a Unicode character whose lowercase representation has a different length. For example, İ (U+0130) lowercases to i followed by a combining dot.
After writing İstanbul/notes.md, the root listing reports a directory named İstanbul/, and listing or searching that directory returns otes.md. Reading the returned search path then returns None, even though the original file is present.
Expected: root listing returns İstanbul; child listing and search return notes.md, which can be read using the returned name. The existing case-insensitive lookup behavior should remain unchanged.
Actual: the methods use character offsets from lowercased lookup keys to slice the original display paths. Those offsets no longer refer to the same positions after length-changing Unicode lowercasing.
Code Sample
import asyncio
from agent_framework import InMemoryAgentFileStore
async def main() -> None:
store = InMemoryAgentFileStore()
directory = "\u0130stanbul"
await store.write(f"{directory}/notes.md", "memory")
print([(entry.name, entry.type) for entry in await store.list_children()])
print([(entry.name, entry.type) for entry in await store.list_children(directory)])
for result in await store.search(directory, "memory"):
print(result.file_name, await store.read(f"{directory}/{result.file_name}"))
asyncio.run(main())Observed output:
[('İstanbul/', 'directory')]
[('otes.md', 'file')]
otes.md None
Error Messages / Stack Traces
No exception is raised. The returned file names are incorrect and cannot be used to retrieve the stored content.
Package Versions
agent-framework-core 1.19.0, installed from the source checkout at a8acb4e0e9d7e4712b01b9c888cf943a2dfbee91 on 2026-09-22.
Python Version
Python 3.12.14, macOS 15.5, arm64.
Additional Context
I would like to fix the relative display-path extraction in the existing list_children() and search() methods by using path components rather than lowercased character offsets, with regression coverage for root and nested listings, case-variant lookups, and reading search results back. This does not change path normalization, key comparison rules, or the public API.
I searched existing issues and pull requests for InMemoryAgentFileStore Unicode, file store casing, and Unicode path and did not find a matching report. #8567 concerns file/directory write collisions; this report concerns display-path extraction for otherwise valid stored files.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Sep 22, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
The bug occurs in
python/packages/core/agent_framework/_harness/_file_access.py::InMemoryAgentFileStore.list_childrenaround lines 1113-1135 andsearcharound lines 1165-1184. It triggers when a directory contains a character such as U+0130 whose lowercase representation changes length, because a lowercased prefix offset slices the original display path. Minimal repro: writeİstanbul/notes.md, list or searchİstanbul, and verify the returnedotes.mdcannot be read back.python/packages/core/tests/core/test_harness_file_memory.py1.19.01.19.0