[dotnet-port-api] Port harness file memory provider - #1001
[dotnet-port-api] Port harness file memory provider#1001Michelle Clayton (michelle-clayton-work) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
There are a couple of correctness/API-surface issues (nondeterministic directory casing in ListChildren, silent invalid glob handling, and inconsistent JSON field naming) that should be addressed before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Ports the .NET FileMemoryProvider concept into Go by introducing a session-scoped file-memory harness provider and its underlying file-store primitives, plus tests and an example demonstrating the new tools.
Changes:
- Added
agent/harness/filestoreprimitives and an in-memoryFileStoreimplementation with search/edit helpers. - Added
agent/harness/filememoryprovider exposingfile_memory_*tools with session-scoped state and index injection. - Updated feature parity documentation and added a compiled example (
step23_file_memory).
File summaries
| File | Description |
|---|---|
| agent/harness/filestore/filestore.go | New file-store abstractions + in-memory implementation, search/glob, and edit helpers used by file memory. |
| agent/harness/filestore/filestore_test.go | Tests for path normalization, list/search behavior, and invalid path rejection. |
| agent/harness/filememory/filememory.go | New session-scoped file-memory context provider exposing file_memory_* tools and index injection. |
| agent/harness/filememory/filememory_test.go | Tests covering tool presence, instructions, indexing, file ops, and name validation. |
| examples/02-agents/agents/step23_file_memory/main.go | Example wiring the provider and calling write/read/ls tools. |
| docs/dotnet-go-sdk-feature-comparison.md | Updates feature parity table to reflect new filestore/filememory harness support. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Scope: public API, examples Changed Go contract: New packages Upstream evidence reviewed: Result: aligned. Verified default instructions, tool names/descriptions, index-rebuild logic (
|
Summary
Port the .NET
FileMemoryProvidersurface into Go by adding two new harness packages:agent/harness/filestorewith public file-store primitives (FileStore,Entry,SearchResult,SearchMatch,LineEdit) plus an in-memory implementation for provider and test use.agent/harness/filememorywith a session-scoped file-memory context provider, exported state/options types,file_memory_*tools, memory-index injection, and working-folder state initialization.This was selected from upstream commit
f19a129b55e8ea86624a93227954cf43a0890e8f(microsoft/agent-framework@f19a129) because it adds a user-facing capability and exported API surface that Go did not have. The PR also adds a small compiled example and updates the feature-comparison doc to reflect the new parity.Ported .NET PRs
FileMemoryProviderBreaking Changes
No.
Tests and Examples
agent/harness/filestoreagent/harness/filememoryexamples/02-agents/agents/step23_file_memorygo test ./agent/harness/filestore ./agent/harness/filememory ./examples/02-agents/agents/step23_file_memorygo test ./...Notes
Closes #757