You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aligns the agent/harness/agentmode package with the .NET AgentModeProvider as updated in microsoft/agent-framework#6071.
Changes made:
Tool names renamed — AgentMode_Set/AgentMode_Get → mode_set/mode_get. This matches the cross-SDK alignment made in #6071 (also applied to the Python SDK at the same time).
Default instructions updated — the instructions now:
Add a bullet note: "you must check the current mode after any user input" (important behavioral guidance).
Reference mode_get/mode_set instead of the old tool names.
Add a "Mandatory Mode based Workflow" section that guides the agent on mode-based behavior for every user request.
Default mode descriptions expanded — plan and execute now have detailed step-by-step process descriptions matching .NET. Previously both descriptions were a single short sentence; now each has a 5–7 step workflow.
Mode rendering format — buildInstructions now formats each mode as a markdown section header (#### mode_name) followed by its description, matching .NET's BuildInstructions output. The old format used bullet points (- "mode_name": description).
Tests updated — existing TestToolNames updated for new names; two new tests added:
TestDefaultInstructions_ContainToolNamesAndModeCheckGuidance — verifies mode_get, mode_set, "check the current mode", and "Mandatory Mode based Workflow" are present.
TestDefaultInstructions_ModesSectionHeaderFormat — verifies #### plan / #### execute headers appear in instructions.
Feature comparison doc updated to note the alignment.
Yes. The mode_set and mode_get tool names replace AgentMode_Set and AgentMode_Get. Any agent prompts or harness configurations that reference the old tool names by string will stop matching. Since this is an intentional cross-SDK alignment (same rename was applied to Python) and the Go SDK is in beta, this breaking change is acceptable.
Upstream commits 5e097276 (docs), 383d551b (Purview), 2a345e5d (Magentic), 96d242fa (HarnessAgent compaction opt-in), and 9486c76e (ChatClientAgent reasoning merging) were inspected but are not applicable to the Go SDK — no Go equivalents for Magentic, HarnessAgent, or ChatClientAgent exist. The AgentMode misalignment was found via the Go SDK misalignment pass.
This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch dotnet-port/agentmode-tool-names-alignment-7428d9b884e17844.
To fix the permissions issue, go to Settings → Actions → General and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ
Show patch preview (194 of 194 lines)
From 754d86f885b076c995c80469f6121e7c2ce828e3 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Wed, 10 Jun 2026 10:32:03 +0000
Subject: [PATCH] harness/agentmode: align tool names and instructions with
.NET (#6071)
Rename AgentMode_Set/AgentMode_Get tools to mode_set/mode_get to match
the cross-SDK alignment made in microsoft/agent-framework#6071.
Also update the default instructions and default mode descriptions to
match the .NET AgentModeProvider as of that same PR:
- Add 'check mode after user input' note to instructions.- Add 'Mandatory Mode based Workflow' section.- Expand plan/execute default mode descriptions with step-by-step processes.- Change mode rendering in instructions from bullet points to section
headers (#### mode_name) matching .NET BuildInstructions output.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
agent/harness/agentmode/agentmode.go | 52 +++++++++++++++++------
agent/harness/agentmode/agentmode_test.go | 45 ++++++++++++++++++--
docs/dotnet-go-sdk-feature-comparison.md | 2 +-
3 files changed, 81 insertions(+), 18 deletions(-)
diff --git a/agent/harness/agentmode/agentmode.go b/agent/harness/agentmode/agentmode.go
index 2d4201af..7c0df6a5 100644
--- a/agent/harness/agentmode/agentmode.go+++ b/agent/harness/agentmode/agentmode.go@@ -25,14 +25,20 @@ const stateKey = "agentModeState"
const defaultInstructions = `## Agent Mode
-You can operate in different modes. Depending on the mode you are in, you will be required to follow different processes.+- You can operate in different modes. Depending on the mode you are in, you will be required to follow different processes.+- You must check the current mode after any user input, since the user may have changed the mode themselves,+ e.g. the user may have switched to 'plan' mode after a previous research task finished in 'execute' mode, meaning they want to review a plan first before execu
... (truncated)
Summary
Aligns the
agent/harness/agentmodepackage with the .NETAgentModeProvideras updated in microsoft/agent-framework#6071.Changes made:
Tool names renamed —
AgentMode_Set/AgentMode_Get→mode_set/mode_get. This matches the cross-SDK alignment made in #6071 (also applied to the Python SDK at the same time).Default instructions updated — the instructions now:
mode_get/mode_setinstead of the old tool names.Default mode descriptions expanded —
planandexecutenow have detailed step-by-step process descriptions matching .NET. Previously both descriptions were a single short sentence; now each has a 5–7 step workflow.Mode rendering format —
buildInstructionsnow formats each mode as a markdown section header (#### mode_name) followed by its description, matching .NET'sBuildInstructionsoutput. The old format used bullet points (- "mode_name": description).Tests updated — existing
TestToolNamesupdated for new names; two new tests added:TestDefaultInstructions_ContainToolNamesAndModeCheckGuidance— verifiesmode_get,mode_set, "check the current mode", and "Mandatory Mode based Workflow" are present.TestDefaultInstructions_ModesSectionHeaderFormat— verifies#### plan/#### executeheaders appear in instructions.Feature comparison doc updated to note the alignment.
Ported .NET PRs
AgentModeProvidertool namesAgentMode_Set→mode_set,AgentMode_Get→mode_get, plus instructions and default mode descriptions)Breaking Changes
Yes. The
mode_setandmode_gettool names replaceAgentMode_SetandAgentMode_Get. Any agent prompts or harness configurations that reference the old tool names by string will stop matching. Since this is an intentional cross-SDK alignment (same rename was applied to Python) and the Go SDK is in beta, this breaking change is acceptable.Tests and Examples
agent/harness/agentmodetests pass.go test ./...passes.TestDefaultInstructions_ContainToolNamesAndModeCheckGuidance.TestDefaultInstructions_ModesSectionHeaderFormat.Notes
Upstream commits
5e097276(docs),383d551b(Purview),2a345e5d(Magentic),96d242fa(HarnessAgent compaction opt-in), and9486c76e(ChatClientAgent reasoning merging) were inspected but are not applicable to the Go SDK — no Go equivalents for Magentic, HarnessAgent, or ChatClientAgent exist. The AgentMode misalignment was found via the Go SDK misalignment pass.Note
This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch
dotnet-port/agentmode-tool-names-alignment-7428d9b884e17844.Click here to create the pull request
To fix the permissions issue, go to Settings → Actions → General and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ
Show patch preview (194 of 194 lines)