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
Add runtime_instructions system message section to all SDKs (#1377)
* Add runtime_instructions system message section to all SDKs
Add support for the new runtime_instructions section added by the latest
copilot-agent-runtime. This section targets runtime-provided context and
instructions assembled from sources such as systemMessage.content, system
notifications, memories, workspace context, mode-specific instructions,
and content-exclusion policy.
Changes across SDKs (excluding Java):
- Node.js: Add to SystemMessageSection type union and SYSTEM_MESSAGE_SECTIONS
- Python: Add to SystemMessageSection Literal type and SYSTEM_MESSAGE_SECTIONS
- Go: Add SectionRuntimeInstructions constant with doc comments on all constants
- .NET: Add SystemMessageSection.RuntimeInstructions using string-backed struct
pattern (replaces former static class with string constants)
- Rust: Comment-only update (uses raw strings, no predefined constants)
Also renames SystemPromptSection/SYSTEM_PROMPT_SECTIONS to
SystemMessageSection/SYSTEM_MESSAGE_SECTIONS across all SDKs for
consistency, since these are sections of SystemMessageConfig.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix README: SystemMessageSection is a struct, not an enum
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix PublicDtoTests to handle non-string dictionary keys
The test's TryCreateGenericCollection only handled dictionaries with
string keys. With SystemMessageSection now being a struct used as a
dictionary key, the test fell through to the IEnumerable path which
created a List<KeyValuePair<...>> incompatible with IDictionary<...>.
Generalized the dictionary handling to support any key type.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Each override supports four actions: `replace`, `remove`, `append`, and `prepend`. Unknown section IDs are handled gracefully—content is appended to additional instructions and a warning is emitted; `remove` on unknown sections is silently ignored.
[SystemPromptSections.Tone] =new() { Action=SectionOverrideAction.Replace, Content="Respond in a warm, professional tone. Be thorough in explanations." },
[SystemPromptSections.Guidelines] =new() { Action=SectionOverrideAction.Append, Content="\n* Always cite data sources" },
632
+
[SystemMessageSection.Tone] =new() { Action=SectionOverrideAction.Replace, Content="Respond in a warm, professional tone. Be thorough in explanations." },
[SystemMessageSection.Guidelines] =new() { Action=SectionOverrideAction.Append, Content="\n* Always cite data sources" },
635
635
},
636
636
Content="Focus on financial analysis and reporting."
637
637
}
638
638
});
639
639
```
640
640
641
-
Available section IDs are defined as constants on `SystemPromptSections`: `Identity`, `Tone`, `ToolEfficiency`, `EnvironmentContext`, `CodeChangeRules`, `Guidelines`, `Safety`, `ToolInstructions`, `CustomInstructions`, `LastInstructions`.
641
+
Available section IDs are defined as static properties on the `SystemMessageSection` struct: `Identity`, `Tone`, `ToolEfficiency`, `EnvironmentContext`, `CodeChangeRules`, `Guidelines`, `Safety`, `ToolInstructions`, `CustomInstructions`, `RuntimeInstructions`, `LastInstructions`.
642
642
643
643
Each section override supports four actions: `Replace`, `Remove`, `Append`, and `Prepend`. Unknown section IDs are handled gracefully: content is appended to additional instructions, and `Remove` overrides are silently ignored.
0 commit comments