Skip to content

Conversation

@JGuck
Copy link

@JGuck JGuck commented Oct 27, 2025

Introduces an internal request handler for LoggingMessageNotification.SetLevelRequest in Server.connect to prevent client errors when copilot logging level requests are received. Returns EmptyRequestResult for these requests.

Motivation and Context

Currently, the SetLevelRequest is not implemented. This leads to errors with GitHub copilot.

How Has This Been Tested?

I tested it with my current MCP integration.

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Introduces an internal request handler for LoggingMessageNotification.SetLevelRequest in Server.connect to prevent client errors when copilot logging level requests are received. Returns EmptyRequestResult for these requests.
Copilot AI review requested due to automatic review settings October 27, 2025 06:51
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 handler for logging level requests to prevent client errors when GitHub Copilot sends SetLevelRequest messages. The change implements a minimal handler that returns an empty result, avoiding unhandled request exceptions.

Key Changes:

  • Added imports for EmptyRequestResult, ErrorCode, and LoggingMessageNotification
  • Registered an internal request handler for LoggingSetLevel method in Server.connect()

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

JochenGuckSnk and others added 2 commits October 27, 2025 09:20
Deleted the unused ErrorCode import and clarified a comment regarding Copilot logging level requests in the Server class.
@devcrocod
Copy link
Contributor

#293

@kpavlov
Copy link
Contributor

kpavlov commented Oct 30, 2025

Integration test is needed

@kpavlov kpavlov changed the title Add handler for logging level requests in Server #293 Add handler for logging level requests in Server Oct 30, 2025
Copy link
Contributor

@devcrocod devcrocod left a comment

Choose a reason for hiding this comment

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

This PR doesn’t address the logging levels issue globally

In my opinion, in pr should introduce a map on the server side to map log levels by sessionId

also should add setLoggingLevels for the client

By default, logging levels shouldn’t be set, the client should handle that.

And finally, should check the capabilities

val session = ServerSession(serverInfo, options, instructionsProvider?.invoke())

// Add internal logging level handler to prevent client errors from Copilot logging level requests
session.setRequestHandler<LoggingMessageNotification.SetLevelRequest>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably worth checking the logging capabilities before setting the level

@devcrocod
Copy link
Contributor

devcrocod commented Oct 31, 2025

I investigated the issue. It was originally caused by the property initialization order. I also added a handler and updated sendLoggingMessage #358
Closing this PR since it’s now obsolete

@devcrocod devcrocod closed this Oct 31, 2025
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.

4 participants