Skip to content

Conversation

@SilentDemonSD
Copy link

@SilentDemonSD SilentDemonSD commented Jan 27, 2026

Overview

This PR adds a complete Python cookbook with practical recipes and enhances the SDK documentation and to include all four supported languages (Node.js/TypeScript, Python, Go, and .NET) for custom_agents.md and mcp.md in docs folder.

Changes

New Python Recipe Files (10 recipes)

  • custom_agents.py - Create specialized AI agents with custom prompts and behaviors
  • custom_providers.py - Implement custom model providers for specialized AI backends
  • custom_tools.py - Build custom tools to extend agent capabilities
  • error_handling.py - Handle errors gracefully including retries and cleanup
  • managing_local_files.py - AI-powered file organization using metadata
  • mcp_servers.py - Model Context Protocol server integration
  • multiple_sessions.py - Manage independent conversations simultaneously
  • persisting_sessions.py - Save and resume sessions across restarts
  • pr_visualization.py - Generate PR analytics charts using GitHub MCP Server
  • streaming_responses.py - Real-time response streaming patterns

New/Updated Documentation

  • docs/custom-agents.md - New comprehensive guide with all 4 language examples
  • docs/mcp.md - Added multi-language Quick Start examples
  • docs/getting-started.md - Updated with SessionEventType enum usage
  • cookbook/python/README.md - Enhanced with all recipes and quick start guide
  • cookbook/python/recipe/README.md - Added SessionEventType reference table
  • cookbook/README.md - Updated recipe listings for Python

Code Improvements

  • Refactored all Python recipes to use SessionEventType Enum from copilot.types

Co-ordination Points across all PRs and Issues 

  • Some PR have some part or on the way, so can check if want to from here.

PR

Fix Issues 

Purpose

  • This co ordinated all the pr and issues into a common point of view that it is being addressed !
  • Review is required if it is OK and aligned with indent 

Copilot AI and others added 4 commits January 27, 2026 19:32
* Initial plan

* Wrap StreamJsonRpc exceptions with CopilotRpcException

Co-authored-by: SteveSandersonMS <1101362+SteveSandersonMS@users.noreply.github.com>

* Add explicit using System.IO for IOException

Co-authored-by: SteveSandersonMS <1101362+SteveSandersonMS@users.noreply.github.com>

* Only wrap RPC invocation calls in try-catch blocks

Co-authored-by: SteveSandersonMS <1101362+SteveSandersonMS@users.noreply.github.com>

* Remove implementation details from CopilotRpcException docs

Co-authored-by: SteveSandersonMS <1101362+SteveSandersonMS@users.noreply.github.com>

* Replace CopilotRpcException with IOException and add RPC wrapper methods

Co-authored-by: SteveSandersonMS <1101362+SteveSandersonMS@users.noreply.github.com>

* Catch RemoteRpcException, refactor Session.InvokeRpcAsync, remove unused using

Co-authored-by: SteveSandersonMS <1101362+SteveSandersonMS@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SteveSandersonMS <1101362+SteveSandersonMS@users.noreply.github.com>
- Remove type annotations (TYPE_CHECKING, type hints) from all 10 recipe files
- Simplify function signatures for better readability
- Create docs/core-concepts.md with common SDK concepts:
  - Architecture overview
  - Session lifecycle
  - Event types table
  - Error handling patterns
  - Custom tools, MCP, agents, providers
- Simplify cookbook/python/README.md with link to core-concepts
- Add new recipe files: custom_agents.py, custom_providers.py,
  custom_tools.py, mcp_servers.py, streaming_responses.py
- Add new documentation: custom-agents.md, custom-providers.md,
  custom-tools.md, mcp-servers.md, streaming-responses.md
- Fix requirements.txt path to local SDK
- Update pyproject.toml for Python 3.13/3.14 support
…s multiple recipes and documentation updates. Added custom agents documentation and improved error handling patterns.
@SilentDemonSD SilentDemonSD requested a review from a team as a code owner January 27, 2026 18:13
Copilot AI review requested due to automatic review settings January 27, 2026 18:13
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 a complete Python cookbook with 10 practical recipes and enhances SDK documentation to include all four supported languages (Node.js/TypeScript, Python, Go, and .NET) for custom agents and MCP servers. It consolidates work from multiple related PRs (#138, #127, #214, #225) and addresses documentation issues (#166, #169).

Changes:

  • New Python recipes: 10 comprehensive examples covering custom agents, providers, tools, error handling, file management, MCP servers, multiple sessions, persistence, PR visualization, and streaming
  • Multi-language documentation: Updated docs/custom-agents.md (new) and docs/mcp.md with examples in all 4 languages
  • SDK improvements: Enhanced .NET error handling with InvokeRpcAsync wrapper, updated Python type definitions with expanded model list and SessionEventType export

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
python/setup.py Updated Python version requirement from 3.8 to 3.9
python/pyproject.toml Added Python 3.13-3.14 support, upper version constraint
python/copilot/types.py Exported SessionEventType, expanded model literal types
dotnet/src/Client.cs Added InvokeRpcAsync wrapper for better error handling
dotnet/src/Session.cs Refactored to use InvokeRpcAsync helper
dotnet/test/SessionTests.cs Updated exception types from RemoteInvocationException to IOException
dotnet/README.md Updated error handling examples
docs/mcp.md Added multi-language quick start examples (Python, Go, .NET)
docs/getting-started.md Updated SessionEventType import to use copilot.types
docs/custom-agents.md New comprehensive guide with all 4 language examples
cookbook/python/*.md 10 new/updated recipe documentation files
cookbook/python/recipe/*.py 10 new recipe implementation files
cookbook/python/recipe/requirements.txt Fixed SDK path reference
cookbook/python/recipe/README.md Enhanced with SessionEventType reference and async patterns guide
cookbook/python/README.md Complete rewrite with recipe listing and troubleshooting
cookbook/README.md Updated Python recipe listings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant