Skip to content

v0.1.33-preview.4

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 20 Mar 17:01
005b780

Feature: fine-grained system prompt customization

A new "customize" mode for systemMessage lets you selectively override individual sections of the Copilot system prompt — without replacing the entire prompt. This sits between "append" (add to the end) and "replace" (replace everything). (#816)

Ten sections are configurable: identity, tone, tool_efficiency, environment_context, code_change_rules, guidelines, safety, tool_instructions, custom_instructions, and last_instructions.

Each section supports four static actions (replace, remove, append, prepend) and a transform action — a callback that receives the current rendered section content and returns the modified version, enabling regex mutations, logging, or conditional edits.

const session = await client.createSession({
  systemMessage: {
    mode: "customize",
    sections: {
      identity: {
        // transform: read current content and return modified content
        action: (current) => current.replace("GitHub Copilot", "Acme Assistant"),
      },
      tone: { action: "replace", content: "Be concise and professional." },
      code_change_rules: { action: "remove" },
    },
  },
});
var session = await client.CreateSessionAsync(new SessionOptions {
    SystemMessage = new SystemMessageOptions {
        Mode = SystemMessageMode.Customize,
        Sections = new Dictionary(string, SectionOverride) {
            ["identity"] = new() {
                Transform = current => current.Replace("GitHub Copilot", "Acme Assistant"),
            },
            ["tone"] = new() { Action = "replace", Content = "Be concise and professional." },
            ["code_change_rules"] = new() { Action = "remove" },
        },
    },
});

Generated by Release Changelog Generator

Generated by Release Changelog Generator