[dotnet-port-fixes] Align skills prompt placeholders with .NET - #392
Conversation
Port upstream .NET behavior from microsoft/agent-framework#6706 so custom skills prompt templates only require the {skills} placeholder. Legacy resource and script instruction placeholders are no longer specially substituted; default guidance remains embedded in the default prompt. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…626034300-aaa847d41a63dd26
There was a problem hiding this comment.
Pull request overview
Aligns the Go agent/skills context provider’s prompt-template placeholder behavior with the upstream .NET implementation by making {skills} the only required placeholder in custom templates and embedding resource/script guidance directly in the default prompt.
Changes:
- Remove special substitution and validation for legacy
{resource_instructions}/{script_instructions}placeholders; only{skills}is required and substituted. - Embed resource/script usage guidance in the default skills instruction prompt instead of injecting it via placeholders.
- Update tests to validate the new behavior (custom templates don’t receive default guidance; legacy placeholders remain literal if present).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
agent/skills/provider.go |
Simplifies placeholder handling to only {skills}, embeds default resource/script guidance, and updates template validation accordingly. |
agent/skills/provider_test.go |
Updates/extends unit tests to cover acceptance of missing legacy placeholders and literal retention of legacy tokens. |
agent/skills/skills_test.go |
Adjusts the custom prompt template test to only use {skills}. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Generated by Go API Consistency Review Agent for #392 · 190.5 AIC · ⌖ 12.8 AIC · ⊞ 28.8K
…ionPrompt docstring Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
…ocstring Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
Cross-SDK parity reviewThis PR faithfully ports the .NET behavior from microsoft/agent-framework#6706. The Go implementation now aligns with .NET on the following points:
Parity gap to track — Python vs. Go/.NET on custom-template injectionThe upstream Python implementation ( # Python: _build_instructions calls str.format() with all three substitutions,
# so a custom template CAN reference these optional placeholders:
return template.format(
skills="\n".join(lines),
runner_instructions=runner_instructions or "", # SCRIPT_RUNNER_INSTRUCTIONS constant
resource_instructions=resource_instructions or "", # RESOURCE_INSTRUCTIONS constant
)Python's default template is: This means:
Additionally, Python's active placeholder for script instructions is Impact: Low for most users (default template is unchanged). Users migrating custom templates across SDKs, or adopting the Python convention of referencing Summary: No issues blocking this PR. The Go change correctly mirrors the merged .NET behavior. The Python parity gap on optional custom-template injection predates this PR and should be tracked separately against the Python SDK.
|
Port upstream .NET behavior from microsoft/agent-framework#6706 so custom skills prompt templates only require the {skills} placeholder. Legacy resource and script instruction placeholders are no longer specially substituted; default guidance remains embedded in the default prompt.