Skip to content

Conversation

@rodrigobr-msft
Copy link
Contributor

@rodrigobr-msft rodrigobr-msft commented Dec 5, 2025

This pull request enhances the flexibility and maintainability of the Copilot Studio client by allowing custom configuration of the underlying HTTP client and improving code documentation. The most significant updates include support for passing custom arguments to the aiohttp.ClientSession, and the addition of detailed docstrings to key methods for better clarity.

Custom client session configuration:

  • Added a new optional parameter client_session_kwargs to the ConnectionSettings class, allowing users to pass custom keyword arguments to the underlying aiohttp.ClientSession (e.g., for timeouts, proxies, etc.). This parameter is stored as an instance variable and defaults to an empty dictionary if not provided. [1] [2]
  • Updated the CopilotClient.post_request method to use these custom session arguments when creating an aiohttp.ClientSession, increasing flexibility for different networking requirements.

Improved documentation:

  • Added detailed docstrings to the ConnectionSettings.__init__, CopilotClient.post_request, CopilotClient.start_conversation, CopilotClient.ask_question, and CopilotClient.ask_question_with_activity methods. These docstrings clarify the purpose, parameters, and return values of each method, making the codebase easier to understand and maintain. [1] [2] [3] [4] [5]

Copilot AI review requested due to automatic review settings December 5, 2025 17:13
@rodrigobr-msft rodrigobr-msft changed the title Configuring aiohttp Configuring aiohttp.web.ClientSession creation for CopilotStudio through ConnectionSettings Dec 5, 2025
@rodrigobr-msft rodrigobr-msft marked this pull request as ready for review December 5, 2025 17:13
@rodrigobr-msft rodrigobr-msft requested a review from a team as a code owner December 5, 2025 17: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 the ability to configure the underlying aiohttp ClientSession by allowing users to pass custom keyword arguments through the ConnectionSettings. It also adds comprehensive docstrings to several methods in the CopilotClient class.

  • Adds a client_session_kwargs parameter to ConnectionSettings to allow customization of aiohttp's ClientSession
  • Updates CopilotClient.post_request() to use the configurable session kwargs
  • Adds docstrings to post_request(), start_conversation(), ask_question(), and ask_question_with_activity() methods

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
connection_settings.py Adds client_session_kwargs parameter with default values for optional parameters, includes initialization and documentation
copilot_client.py Updates post_request() to use the new client_session_kwargs and adds comprehensive docstrings to public async methods

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

Copilot AI review requested due to automatic review settings December 8, 2025 17:54
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

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


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

@axelsrz axelsrz merged commit 7c58afa into main Dec 8, 2025
16 checks passed
@axelsrz axelsrz deleted the users/robrandao/copilot-client-bug branch December 8, 2025 22:44
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.

[CopilotClient] aiohttp "Chunk too big" error on large responses in microsoft-agents-copilotstudio-client

2 participants