Skip to content

Conversation

@dmytrostruk
Copy link
Member

Motivation and Context

Resolves: #3571

  • Added instructions parameter to GitHubCopilotAgent constructor (alignment with other agents), which maps to system_message.content property
  • Added system_message parameter to GitHubCopilotOptions with the ability to configure system_message.mode
  • Included runtime options in session creation logic

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@dmytrostruk dmytrostruk self-assigned this Feb 2, 2026
Copilot AI review requested due to automatic review settings February 2, 2026 16:46
@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL16250198287% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
3747 221 💤 0 ❌ 0 🔥 1m 7s ⏱️

@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL16250198287% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
3747 221 💤 0 ❌ 0 🔥 1m 9s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an instructions parameter to the GitHubCopilotAgent constructor and implements configurable system_message mode (append/replace) for the GitHub Copilot agent integration. The changes align the API with other agents in the framework (like ClaudeAgent) and resolve issue #3571.

Changes:

  • Added instructions parameter to GitHubCopilotAgent constructor that maps to system_message.content
  • Updated GitHubCopilotOptions to use system_message with configurable mode instead of plain instructions string
  • Implemented runtime options support in session creation to allow overriding system_message per request
  • Updated all sample code to use the new API pattern with instructions as a direct parameter
  • Added comprehensive test coverage for the new functionality including precedence rules and runtime overrides

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
python/packages/github_copilot/agent_framework_github_copilot/_agent.py Core implementation: added instructions parameter, _prepare_system_message() method, runtime options support in session creation, and updated GitHubCopilotOptions TypedDict
python/packages/github_copilot/tests/test_github_copilot_agent.py Added comprehensive tests for instructions parameter, system_message configuration, precedence rules, and runtime options
python/samples/getting_started/agents/github_copilot/github_copilot_basic.py Updated to use instructions parameter and added runtime_options_example demonstrating system_message override
python/samples/getting_started/agents/github_copilot/github_copilot_with_session.py Updated to use instructions parameter and removed unnecessary GitHubCopilotOptions import
python/samples/getting_started/agents/github_copilot/github_copilot_with_mcp.py Updated to use instructions parameter with mcp_servers in default_options
python/samples/getting_started/agents/github_copilot/github_copilot_with_url.py Updated to use instructions parameter and simplified agent initialization
python/samples/getting_started/agents/github_copilot/github_copilot_with_shell.py Updated to use instructions parameter and simplified agent initialization
python/samples/getting_started/agents/github_copilot/github_copilot_with_file_operations.py Updated to use instructions parameter and simplified agent initialization
python/samples/getting_started/agents/github_copilot/github_copilot_with_multiple_permissions.py Updated to use instructions parameter and simplified agent initialization

@dmytrostruk dmytrostruk added this pull request to the merge queue Feb 2, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 2, 2026
…gent (#3625)

* Updated instructions handling

* Small improvement

* Included runtime options in session creation logic
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 2, 2026
@dmytrostruk dmytrostruk added this pull request to the merge queue Feb 3, 2026
Merged via the queue into microsoft:main with commit 73033c3 Feb 3, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Feature]: Add configurable system_message mode for GitHubCopilotAgent

4 participants