Skip to content

Realign todo and agentmode harness default prompt strings with current .NET#707

Open
PratikDhanave wants to merge 1 commit into
microsoft:mainfrom
PratikDhanaveFork:realign-harness-default-prompts
Open

Realign todo and agentmode harness default prompt strings with current .NET#707
PratikDhanave wants to merge 1 commit into
microsoft:mainfrom
PratikDhanaveFork:realign-harness-default-prompts

Conversation

@PratikDhanave

Copy link
Copy Markdown
Contributor

What

Realign two harness context-provider default prompt strings with the current .NET implementation. Both ship as the runtime system prompt via WithInstructions, so drift here changes agent behavior relative to the .NET SDK.

  • agent/harness/todo/todo.godefaultInstructions was the old flat text. The current .NET TodoProvider.DefaultInstructions was reworked into a numbered simple-vs-complex decision (1-3) plus a ### General TODO Guidelines heading. Copied verbatim. The todos_* tool bullets already matched and are unchanged.
  • agent/harness/agentmode/agentmode.go — the execute-mode Description began with Use this mode when carrying out approved plans.... The current .NET AgentModeProvider execute description now begins with Determine the type of ask: (1. simple question → answer directly; 2. other work → autonomous), preceding the same numbered 1-5 process. Copied verbatim. Plan-mode description and the mode_* tool descriptions already matched and are untouched.

Why

Cross-SDK parity. The .NET strings are the source of truth for the Go port's harness prompts; the previous strings predate the .NET rework. Same class of fix as the accepted #621, which realigned the top-level agentmode default instructions. Strings were fetched from raw.githubusercontent.com/microsoft/agent-framework/main and copied verbatim:

  • dotnet/src/Microsoft.Agents.AI/Harness/Todo/TodoProvider.cs
  • dotnet/src/Microsoft.Agents.AI/Harness/AgentMode/AgentModeProvider.cs

Tests

Extended the existing black-box table assertions in the canonical test files:

  • todo_test.go: default instructions contain ### General TODO Guidelines and just complete the task directly.
  • agentmode_test.go: default execute-mode instructions contain Determine the type of ask: and no longer contain carrying out approved plans.

go build ./..., go vet, and go test ./agent/harness/todo/... ./agent/harness/agentmode/... all pass.

Copilot AI review requested due to automatic review settings July 24, 2026 02:36
@PratikDhanave
PratikDhanave requested a review from a team as a code owner July 24, 2026 02:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 Go harness’s built-in system prompt strings for the Todo and AgentMode context providers to stay aligned with the current .NET SDK “source of truth,” and extends the existing black-box tests to assert on key substrings to detect future drift.

Changes:

  • Update todo provider default instructions to the current .NET structure (simple-vs-complex decision + “### General TODO Guidelines” heading).
  • Update agentmode execute-mode description to the current .NET opener (“Determine the type of ask: …”) preceding the existing execute workflow steps.
  • Extend provider tests to assert the updated instruction text is present (and that obsolete phrasing is absent for execute-mode).

Reviewed changes

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

File Description
agent/harness/todo/todo.go Updates the Todo provider’s defaultInstructions template to match current .NET wording/structure.
agent/harness/todo/todo_test.go Adds assertions ensuring the updated Todo default instructions contain key new headings/phrases.
agent/harness/agentmode/agentmode.go Updates the execute-mode Description text to match current .NET wording.
agent/harness/agentmode/agentmode_test.go Adds a test asserting the execute-mode description includes the new opener and omits the old phrasing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 90 to 94
Name: "execute",
Description: `Use this mode when carrying out approved plans. Work autonomously using your best judgment — do not ask the user questions or wait for feedback.
Description: `Determine the type of ask:
1. Simple question that doesn't require any further work to answer.
2. Any other work, including complex user request that requires a multi-step process to satisfy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This branch already includes the #621 change: commit 71edad1 ("harness/agentmode: remove extra hardcoded bullet from default instructions (#621)") is in this branch's history, and the current defaultInstructions no longer contains the "check the current mode after any user input" bullet or the hardcoded 'plan'/'execute' prose. TestDefaultInstructions_OmitExtraHardcodedBullet locks that removal, so there's no drift to reintroduce here.

Comment on lines +609 to +625
func TestDefaultInstructions_ExecuteModeDescription(t *testing.T) {
p := agentmode.New(agentmode.Config{})
opts := sessionOpts()

_, outOpts, err := invokeProvider(p, context.Background(), newMessages("hi"), opts...)
if err != nil {
t.Fatal(err)
}

instructions := collectInstructions(outOpts)
if !strings.Contains(instructions, "Determine the type of ask:") {
t.Error("expected execute-mode instructions to contain 'Determine the type of ask:'")
}
if strings.Contains(instructions, "carrying out approved plans") {
t.Error("expected execute-mode instructions to no longer contain 'carrying out approved plans'")
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The PR is actually based on a post-#621 version: #621 (commit 71edad1) is present in this branch's history, and both alignment updates are locked by tests — TestDefaultInstructions_OmitExtraHardcodedBullet asserts the extra bullet is gone, and TestDefaultInstructions_ExecuteModeDescription asserts the new execute-mode opener. go build/vet/test all pass, so there's no #621 regression or merge conflict to reconcile here.

@github-actions

This comment has been minimized.

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Jul 24, 2026
@PratikDhanave
PratikDhanave force-pushed the realign-harness-default-prompts branch from 5304fdf to 1dc176b Compare July 24, 2026 03:01
@github-actions

This comment has been minimized.

Update the todo provider default instructions to the reworked .NET
TodoProvider text (numbered simple-vs-complex decision plus a General
TODO Guidelines heading) and the agentmode execute-mode description to
the current .NET AgentModeProvider text (Determine the type of ask
1/2 branch preceding the numbered process). These strings ship as the
runtime system prompt via WithInstructions, so the prior drift changed
agent behavior relative to .NET. Plan-mode text and the todos_* / mode_*
tool descriptions already matched and are left untouched.
@PratikDhanave
PratikDhanave force-pushed the realign-harness-default-prompts branch from 1dc176b to 6810a35 Compare July 24, 2026 09:33
@github-actions

Copy link
Copy Markdown
Contributor

Parity Review: ✅ No issues

This PR aligns unexported defaultInstructions constants and internal mode description strings in agent/harness/todo/todo.go and agent/harness/agentmode/agentmode.go with the current .NET TodoProvider.DefaultInstructions and AgentModeProvider execute description.

Scope check: All modified identifiers (defaultInstructions, internal modes[].Description) are unexported. No exported Go API surface changed — public-api-change label not added.

Parity check: The PR explicitly copies the current .NET strings verbatim from dotnet/src/Microsoft.Agents.AI/Harness/Todo/TodoProvider.cs and dotnet/src/Microsoft.Agents.AI/Harness/AgentMode/AgentModeProvider.cs. This moves Go closer to .NET, not away from it. No divergence with Python — harness prompt strings are not part of the Python implementation.

No cross-repo consistency issues found.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Go API Consistency Review Agent · 28.8 AIC · ⌖ 5.56 AIC · ⊞ 5.9K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity-approved Go API consistency review found no parity issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants