{"id":7901,"library":"agent-framework-github-copilot","title":"GitHub Copilot integration for Microsoft Agent Framework","description":"The `agent-framework-github-copilot` library integrates the GitHub Copilot SDK with the Microsoft Agent Framework, providing Python developers with powerful coding-oriented AI capabilities. These capabilities include shell command execution, file operations, URL fetching, and Model Context Protocol (MCP) server integration. It is part of the broader Microsoft Agent Framework, which has unified previously separate AI frameworks like Semantic Kernel and AutoGen. The library is actively developed, with its current version being 1.0.0b260409, and receives regular updates.","status":"active","version":"1.0.0b260409","language":"en","source_language":"en","source_url":"https://github.com/microsoft/agent-framework","tags":["AI agents","GitHub Copilot","Microsoft Agent Framework","code generation","developer tools"],"install":[{"cmd":"pip install agent-framework-github-copilot","lang":"bash","label":"Install package"}],"dependencies":[{"reason":"This package is an integration for the Microsoft Agent Framework and relies on its core functionalities.","package":"agent-framework","optional":false},{"reason":"The GitHub Copilot CLI is a prerequisite for the agent-framework-github-copilot to function correctly and requires separate installation and authentication.","package":"GitHub Copilot CLI","optional":false}],"imports":[{"symbol":"GitHubCopilotAgent","correct":"from agent_framework.github import GitHubCopilotAgent"},{"symbol":"GitHubCopilotOptions","correct":"from agent_framework.github import GitHubCopilotOptions"}],"quickstart":{"code":"import asyncio\nimport os\nfrom agent_framework.github import GitHubCopilotAgent, GitHubCopilotOptions\n\nasync def main():\n    # Ensure GitHub Copilot CLI is installed and authenticated.\n    # For this example, we assume authentication is handled externally or via environment variables.\n    # Replace with your actual authentication token or method if needed.\n    # os.environ['GITHUB_TOKEN'] = os.environ.get('GITHUB_TOKEN', 'YOUR_GITHUB_TOKEN')\n    \n    options = GitHubCopilotOptions()\n    agent = GitHubCopilotAgent(options)\n\n    print(\"Asking the GitHub Copilot Agent: What is a Python list comprehension?\")\n    response = await agent.run_async(\"What is a Python list comprehension?\")\n    print(f\"Agent Response: {response.output}\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())","lang":"python","description":"This quickstart demonstrates how to initialize and run a basic GitHub Copilot Agent. It requires the GitHub Copilot CLI to be installed and authenticated separately. The agent is created with default options and then used to process a simple query."},"warnings":[{"fix":"Review the official migration guide for Agent Framework 1.0.0 to adapt agent code to the new `ToolInvocation` and `ToolResult` types. Ensure all Agent Framework related packages are updated to their stable 1.x versions.","message":"Version 1.0.0 introduced breaking changes related to `ToolInvocation` and `ToolResult` types, requiring updates to agent implementations. Additionally, dependency floors now mandate released `>=1.0.0,<2` packages, breaking compatibility with older Release Candidate (RC) installs.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Follow the official GitHub Copilot CLI installation and authentication guides. This typically involves installing the CLI and logging in via `gh auth login` or similar commands, potentially configuring environment variables for authentication tokens.","message":"The GitHub Copilot CLI must be installed and authenticated separately for the `agent-framework-github-copilot` to function. This is a crucial prerequisite for utilizing the library's features.","severity":"gotcha","affected_versions":"All"},{"fix":"Identify repositories using Copilot coding agent with affected runner types (check `.github/workflows/copilot-setup-steps.yml`). Review and update network configurations to ensure connectivity to the new, plan-specific Copilot hostnames by the specified date.","message":"Effective February 27, 2026, the Copilot coding agent will use subscription-based network routing, connecting to different hostnames (e.g., `api.business.githubcopilot.com`, `api.enterprise.githubcopilot.com`, `api.individual.githubcopilot.com`). Self-hosted runners or those with Azure private networking need to allow these new hostnames.","severity":"breaking","affected_versions":"All versions used with Copilot coding agent on affected runners after 2026-02-27"},{"fix":"For tasks involving long-running shell commands, consider breaking them down into smaller, quicker steps, or use alternative methods for result capture if the agent's direct execution proves unreliable. Be mindful of this limitation when designing agent workflows.","message":"The Copilot Agent may struggle to obtain results from shell commands that have longer execution times, potentially limiting its effectiveness for complex or time-consuming tasks.","severity":"gotcha","affected_versions":"All"},{"fix":"Exercise caution when using the Copilot Agent for extensive code modifications or refactoring in Visual Studio. Regularly commit changes, use version control, and carefully review agent-generated or edited code before saving. This issue is acknowledged by Microsoft and is under investigation.","message":"Users have reported issues in Visual Studio where the GitHub Copilot Agent can cause code loss or introduce build-breaking errors due to incomplete or improperly applied code generation/editing.","severity":"gotcha","affected_versions":"All (specific to Visual Studio integration)"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Update your network configuration (firewalls, proxy settings, etc.) to allow outgoing connections to the new GitHub Copilot hostnames: `api.business.githubcopilot.com`, `api.enterprise.githubcopilot.com`, and `api.individual.githubcopilot.com`, depending on the Copilot plan(s) in use.","cause":"Network configuration changes for the Copilot coding agent (effective February 27, 2026) mean it connects to new, plan-specific hostnames. If your network (e.g., for self-hosted runners) doesn't allow these, communication will fail.","error":"Copilot coding agent tasks may fail because the agent runtime will be unable to communicate with GitHub systems."},{"fix":"Ensure the package is installed using `pip install agent-framework-github-copilot`. If you intend to use the full framework, `pip install agent-framework` installs all sub-packages, including the GitHub Copilot integration.","cause":"The `agent-framework-github-copilot` package, or the encompassing `agent-framework` package, has not been installed correctly, or the Python environment is not configured to find it.","error":"ModuleNotFoundError: No module named 'agent_framework.github'"},{"fix":"While a direct fix for this behavior is not yet available, it is a known issue. It is recommended to save your work frequently, use version control to track changes, and meticulously review any code generated or modified by the Copilot Agent in Visual Studio. If issues occur, manually revert or correct the code.","cause":"The GitHub Copilot Agent in Visual Studio can sometimes interfere with existing code, resulting in incomplete outputs or corrupted file structures during code generation or editing, which leads to build errors.","error":"Visual Studio: 'parts of my existing code get unexpectedly deleted, and the output is often incomplete — leaving the file in a broken, unbuildable state.'"}]}