Skip to content

.NET: Harness: Improve prompts and add FileSystem store#5365

Merged
westey-m merged 2 commits intomicrosoft:feature-harnessfrom
westey-m:harness-file-system-store-and-prompts
Apr 21, 2026
Merged

.NET: Harness: Improve prompts and add FileSystem store#5365
westey-m merged 2 commits intomicrosoft:feature-harnessfrom
westey-m:harness-file-system-store-and-prompts

Conversation

@westey-m
Copy link
Copy Markdown
Contributor

Motivation and Context

Description

  • Improve the harness prompts
  • Add a File System based agent file store.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings April 20, 2026 16:40
@moonbox3 moonbox3 added the .NET label Apr 20, 2026
@github-actions github-actions Bot changed the title Harness: Improve prompts and add FileSystem store .NET: Harness: Improve prompts and add FileSystem store Apr 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the .NET Harness experience by strengthening the agent-mode and research harness prompts, and introducing a new disk-backed AgentFileStore implementation for file memory persistence.

Changes:

  • Added FileSystemAgentFileStore (file-system-backed AgentFileStore) plus unit tests validating core behaviors and traversal rejection.
  • Updated AgentModeProvider instructions to better distinguish interactive “plan” vs autonomous “execute” behavior.
  • Updated the Harness research sample to use the file-system store and expanded the prompt guidance around planning, todo management, and file memory usage.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
dotnet/src/Microsoft.Agents.AI/Harness/FileMemory/FileSystemAgentFileStore.cs Adds a disk-backed AgentFileStore with path validation, listing, and regex search.
dotnet/tests/Microsoft.Agents.AI.UnitTests/Harness/FileMemory/FileSystemAgentFileStoreTests.cs Adds unit tests for the new file-system store (CRUD, listing, search, traversal rejection).
dotnet/src/Microsoft.Agents.AI/Harness/AgentMode/AgentModeProvider.cs Improves plan/execute mode instructions in the harness context.
dotnet/samples/02-agents/Harness/Harness_Step01_Research/Program.cs Updates the research sample to use file-backed memory and enhanced operational prompts.

Comment thread dotnet/src/Microsoft.Agents.AI/Harness/FileMemory/FileSystemAgentFileStore.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI/Harness/FileMemory/FileSystemAgentFileStore.cs Outdated
Comment thread dotnet/samples/02-agents/Harness/Harness_Step01_Research/Program.cs Outdated
@westey-m westey-m merged commit 7f661e8 into microsoft:feature-harness Apr 21, 2026
12 checks passed
pull Bot pushed a commit to nagyist/ms-agent-framework that referenced this pull request May 1, 2026
* .NET: Add a TODO AIContextProvider (microsoft#5233)

* Add a TODO AIContextProvider

* Add unit tests

* Address PR comments

* Address PR comments

* Fix test after removing one tool

* .NET: Add a ModeProvider for managing agent modes (microsoft#5247)

* Add a ModeProvider for managing agent modes

* Fix typo

* Fix typo

* Fix typo

* Address PR comments

* .NET: Add sample to show how to build a harness (microsoft#5268)

* Add sample to show how to build a harness

* Improve sample

* Sample max output tokens and model

* Fix encoding

* Fix model name in readme

* Address PR comments

* .NET: Add context window size compaction strategy for harness (microsoft#5304)

* Add context window size compaction strategy for harness

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Address PR comments

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* .NET: Add a file memory provider (microsoft#5315)

* Add a file memory provider

* Address PR comments

* Fix review comments.

* Add additional unit tests

* Addressing PR comments.

* .NET:  Harness: Improve prompts and add FileSystem store (microsoft#5365)

* Harness: Improve prompts and add FileSystem store

* Address PR comments

* .NET: Harness: Improve path validation (microsoft#5404)

* Harness: Improve path validation

* Address PR comments

* .NET: Add always approve helpers, improve sample and fix bug (microsoft#5451)

* Add always approve helpers, improve sample and fix bug

* Address PR comments

* .NET: Make Todo, Mode and FileMemory providers more configurable (microsoft#5477)

* Make Todo, Mode and FileMemory providers more configurable

* Address PR comments.

* .NET: Add subagents provider and sample (microsoft#5518)

* Add subagents provider and sample

* Addressing PR comments.

* .NET: Harness filememory index plus instructions consistency (microsoft#5540)

* Add FileMemoryProvider index and improve instruction consistency

* Address PR comments.

* Address PR comments

* Address PR comments.

* Apply suggestion from @rogerbarreto

Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>

---------

Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>

* .NET: Refactor harness console to be more extensible and easy to understand with better UX (microsoft#5573)

* Refactor harness console to be more extensible and easy to understand with better UX.

* Fix formatting issues.

* Allow multiple clarifications in one response

* Address PR comments

* .NET: Add FileAccessProvdider and concurrency fix for FileMemoryProvider (microsoft#5583)

* Add FileAccessProvdider and concurrency fix for FileMemoryProvider

* Address PR comments

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants