Add fine-grained system prompt customization (customize mode)#816
Add fine-grained system prompt customization (customize mode)#816MackinnonBuck wants to merge 3 commits intomainfrom
Conversation
Add a new 'customize' mode for systemMessage configuration, enabling SDK consumers to selectively override individual sections of the CLI system prompt while preserving the rest. This sits between the existing 'append' and 'replace' modes. 9 configurable sections: identity, tone, tool_efficiency, environment_context, code_change_rules, guidelines, safety, tool_instructions, custom_instructions. 4 override actions per section: replace, remove, append, prepend. Unknown section IDs are handled gracefully: content-bearing overrides are appended to additional instructions with a warning, and remove on unknown sections is silently ignored. Types and constants added to all 4 SDK languages (TypeScript, Python, Go, .NET). Documentation updated across all READMEs and getting-started guide. Companion runtime PR: github/copilot-agent-runtime#4751 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-SDK Consistency Review ✅❌Great work adding the "customize" mode feature across all 4 SDKs! The core implementation is well-aligned across languages with proper naming conventions. However, I've identified some documentation and testing gaps that should be addressed for consistency. ✅ What's Consistent
❌ Inconsistencies to Address1. Critical Bug: Wrong Package Name (Node.js README)
2. Documentation Gaps: Python & Go Missing Standalone Examples
Suggestion: Add standalone "Customize Mode" subsections to Python and Go READMEs similar to TypeScript/C#, showing:
3. Testing Gap: Only Node.js Has E2E Test
Suggestion: Add equivalent E2E tests to Python, Go, and .NET test suites to ensure the feature works correctly and consistently across all SDKs. 📋 Recommended Actions
SummaryThe core feature implementation is excellent and consistent. The issues are limited to documentation quality (missing examples) and test coverage gaps. Once these are addressed, this PR will maintain full feature parity across all 4 SDKs! 🚀
|
There was a problem hiding this comment.
Generated by SDK Consistency Review Agent for issue #816
- Fix incorrect package name in nodejs/README.md (@anthropic-ai/sdk -> @github/copilot-sdk) - Add standalone 'System Message Customization' sections with full code examples to Python and Go READMEs (matching TypeScript/.NET) - Add E2E tests for customize mode to Python, Go, and .NET (matching existing Node.js E2E test coverage) - Fix 'end of the prompt' wording in docs to 'additional instructions' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…customization # Conflicts: # nodejs/src/index.ts # python/copilot/__init__.py # python/copilot/types.py
✅ Cross-SDK Consistency Review: Excellent Work!This PR demonstrates outstanding cross-SDK consistency across all 4 language implementations. The "customize mode" feature has been implemented with remarkable attention to detail and consistency. Summary of ChangesAdded fine-grained system prompt customization (
Consistency Verification✅ Section Identifiers (All identical across languages)✅ Action Names (All identical)
✅ Mode Name (Consistent)
✅ API Structure (Parallel design respecting language conventions)TypeScript (camelCase): systemMessage: {
mode: "customize",
sections: {
tone: { action: "replace", content: "..." }
}
}Python (snake_case): system_message={
"mode": "customize",
"sections": {
"tone": {"action": "replace", "content": "..."}
}
}Go (exported constants): SystemMessage: &copilot.SystemMessageConfig{
Mode: "customize",
Sections: map[string]copilot.SectionOverride{
copilot.SectionTone: {Action: "replace", Content: "..."}
}
}.NET (PascalCase + enum): SystemMessage = new SystemMessageConfig {
Mode = SystemMessageMode.Customize,
Sections = new Dictionary(string, SectionOverride) {
[SystemPromptSections.Tone] = new() {
Action = SectionOverrideAction.Replace,
Content = "..."
}
}
}Additional Consistency Points✅ Type definitions - All languages export the new types properly
✅ Graceful fallback behavior - Documented consistently across all languages VerdictNo consistency issues found. This PR is a textbook example of how to maintain feature parity across multi-language SDKs. The implementation respects each language's idioms while maintaining semantic consistency. 🎉 Great work @MackinnonBuck!
|
Add fine-grained system prompt customization (customize mode)
What
Adds a new
"customize"mode forsystemMessageconfiguration across all 4 SDK languages (TypeScript, Python, Go, .NET), enabling SDK consumers to selectively override individual sections of the CLI system prompt while preserving the rest.This sits between the existing
"append"(add to the end) and"replace"(replace everything) modes, offering fine-grained control without requiring consumers to maintain entire prompt copies.9 configurable sections with 4 actions each (
replace,remove,append,prepend):identitytonetool_efficiencyenvironment_contextcode_change_rulesguidelinessafetytool_instructionscustom_instructionsGraceful handling of unknown sections: If the runtime removes a section in a future update, content from
replace/append/prependoverrides is appended to additional instructions with a warning;removeis silently ignored.Why
Addresses #215. SDK consumers need to customize agent behavior (e.g., change identity, adjust tone, remove coding rules for non-coding agents) without replacing the entire system prompt.
Changes
nodejs/src/types.ts,nodejs/src/index.ts):SystemPromptSectiontype,SYSTEM_PROMPT_SECTIONScatalog,SectionOverride,SystemMessageCustomizeConfigpython/copilot/types.py,python/copilot/__init__.py): Matching types and exportsgo/types.go): Section constants,SectionOverridestruct,SystemMessageConfigfieldsdotnet/src/Types.cs,dotnet/src/Client.cs):SystemPromptSectionsconstants,SectionOverride,SectionOverrideActionenumnodejs/test/e2e/session.test.ts): Integration test for customize modeCompanion PR
Runtime changes: https://github.com/github/copilot-agent-runtime/pull/4751
Usage example (TypeScript)