Fix and simplify ComputerUse sample#5075
Merged
SergeyMenshykh merged 4 commits intomicrosoft:mainfrom Apr 7, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Agent_Step15_ComputerUse .NET sample to use AIProjectClient.AsAIAgent(...), expands the README to explain the simulated “computer use” state machine, and changes how screenshots are provided to the model (currently via uploaded OpenAI file IDs).
Changes:
- Refactors the sample program flow to use
AIProjectClient.AsAIAgent(...)with a computer tool loop. - Reworks screenshot handling utilities (upload/delete + mapping state transitions to screenshots).
- Expands README documentation with a state-transition table and interaction loop description.
Reviewed changes
Copilot reviewed 4 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/README.md | Adds a detailed explanation of the simulated computer-use loop and updates prerequisites/env var guidance. |
| dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/Program.cs | Refactors the sample to AsAIAgent(...) and implements a computer-action loop (currently using uploaded image file IDs). |
| dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/ComputerUseUtil.cs | Implements screenshot upload/delete and state-to-screenshot mapping for the loop. |
| dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/Agent_Step15_ComputerUse.csproj | Updates asset inclusion to .jpg screenshots copied to output. |
| dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/Assets/*.jpg | Adds/updates screenshot assets used by the simulation. |
dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/Program.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/Program.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/Program.cs
Show resolved
Hide resolved
dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/README.md
Show resolved
Hide resolved
dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/ComputerUseUtil.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/README.md
Show resolved
Hide resolved
westey-m
approved these changes
Apr 3, 2026
rogerbarreto
reviewed
Apr 7, 2026
dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/ComputerUseUtil.cs
Outdated
Show resolved
Hide resolved
rogerbarreto
reviewed
Apr 7, 2026
dotnet/samples/02-agents/AgentsWithFoundry/Agent_Step15_ComputerUse/Program.cs
Outdated
Show resolved
Hide resolved
rogerbarreto
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Simplifies the \Agent_Step15_ComputerUse\ sample to improve readability, reduces asset sizes, and expands the README with a detailed explanation of the simulation flow.