Skip to content

Remove dead code in handle_regular_request#256

Open
koic wants to merge 1 commit intomodelcontextprotocol:mainfrom
koic:remove_dead_code_in_handle_regular_request
Open

Remove dead code in handle_regular_request#256
koic wants to merge 1 commit intomodelcontextprotocol:mainfrom
koic:remove_dead_code_in_handle_regular_request

Conversation

@koic
Copy link
Member

@koic koic commented Mar 14, 2026

Motivation and Context

Notifications never reach handle_regular_request because handle_post checks notification?(body) first and returns 202 via handle_accepted. Since only notifications cause handle_json to return nil, response is always non-nil here.

How Has This Been Tested?

All existing tests pass unchanged.

Breaking Changes

None.

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

Notifications never reach `handle_regular_request` because `handle_post`
checks `notification?(body)` first and returns 202 via `handle_accepted`.
Since only notifications cause `handle_json` to return `nil`, `response`
is always non-`nil` here.
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.

2 participants