Skip to content

Commit 92785b5

Browse files
committed
test(harness): account for session dir in nested-path rejection test
The upstream #8507 assertion expected list_children("") to stay empty, which held while create_directory was a no-op. This PR makes explicit directories listable, so the session-1 directory created during before_run now appears at the root. The invariant the test protects, that a rejected nested write leaves nothing behind, is preserved: the session directory exists and stays empty, with no notes child.
1 parent 2b6c5cb commit 92785b5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎python/packages/core/tests/core/test_harness_file_memory.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,11 @@ async def test_tools_reject_nested_paths() -> None:
305305

306306
saved = await tools["file_memory_write"].invoke(arguments={"file_name": "notes/plan.md", "content": "x"})
307307
assert "subdirectory" in _text(saved)
308-
# Nothing should have been written for the nested name.
309-
assert await store.list_children("") == []
308+
# Nothing should have been written for the nested name. The session
309+
# directory created during before_run is the only root entry, and the
310+
# rejected write leaves it empty (no "notes" child).
311+
assert [entry.name for entry in await store.list_children("")] == ["session-1"]
312+
assert await store.list_children("session-1") == []
310313

311314
# Backslash separators are normalized to "/" and rejected the same way.
312315
saved_backslash = await tools["file_memory_write"].invoke(arguments={"file_name": "notes\\plan.md", "content": "x"})

0 commit comments

Comments
 (0)