Realign todo and agentmode harness default prompt strings with current .NET#707
Realign todo and agentmode harness default prompt strings with current .NET#707PratikDhanave wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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
todoprovider default instructions to the current .NET structure (simple-vs-complex decision + “### General TODO Guidelines” heading). - Update
agentmodeexecute-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.
| 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. | ||
|
|
There was a problem hiding this comment.
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.
| 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'") | ||
| } | ||
| } |
There was a problem hiding this comment.
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.
This comment has been minimized.
This comment has been minimized.
5304fdf to
1dc176b
Compare
This comment has been minimized.
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.
1dc176b to
6810a35
Compare
Parity Review: ✅ No issuesThis PR aligns unexported Scope check: All modified identifiers ( Parity check: The PR explicitly copies the current .NET strings verbatim from No cross-repo consistency issues found. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
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.go—defaultInstructionswas the old flat text. The current .NETTodoProvider.DefaultInstructionswas reworked into a numbered simple-vs-complex decision (1-3) plus a### General TODO Guidelinesheading. Copied verbatim. Thetodos_*tool bullets already matched and are unchanged.agent/harness/agentmode/agentmode.go— the execute-modeDescriptionbegan withUse this mode when carrying out approved plans.... The current .NETAgentModeProviderexecute description now begins withDetermine 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 themode_*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/mainand copied verbatim:dotnet/src/Microsoft.Agents.AI/Harness/Todo/TodoProvider.csdotnet/src/Microsoft.Agents.AI/Harness/AgentMode/AgentModeProvider.csTests
Extended the existing black-box table assertions in the canonical test files:
todo_test.go: default instructions contain### General TODO Guidelinesandjust complete the task directly.agentmode_test.go: default execute-mode instructions containDetermine the type of ask:and no longer containcarrying out approved plans.go build ./...,go vet, andgo test ./agent/harness/todo/... ./agent/harness/agentmode/...all pass.