Skip to content

[MCP] Fixed issue with deserialization of prompt settings#9085

Merged
glen-84 merged 1 commit intomainfrom
gai/prompt-settings-deserialization
Feb 3, 2026
Merged

[MCP] Fixed issue with deserialization of prompt settings#9085
glen-84 merged 1 commit intomainfrom
gai/prompt-settings-deserialization

Conversation

@glen-84
Copy link
Copy Markdown
Member

@glen-84 glen-84 commented Feb 3, 2026

Summary of the changes (Less than 80 chars)

  • [MCP] Fixed issue with deserialization of prompt settings.

Copilot AI review requested due to automatic review settings February 3, 2026 09:16
Copy link
Copy Markdown
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 fixes a deserialization issue with MCP prompt settings when using polymorphic types. The fix enables proper handling of JSON where the type discriminator property (type) appears after other properties in the JSON object, which is a known limitation in System.Text.Json's polymorphic deserialization.

Changes:

  • Added AllowOutOfOrderMetadataProperties = true to McpSettingsSerializerContext to support out-of-order discriminator properties in polymorphic JSON deserialization
  • Created new test project Adapters.Mcp.Core.Tests with a test validating the fix for polymorphic message content deserialization
  • Updated solution files to include the new test project

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
McpSettingsSerializerContext.cs Added AllowOutOfOrderMetadataProperties = true option to fix polymorphic deserialization when discriminator appears after data properties
McpPromptSettingsSerializerTests.cs New test file validating that prompt settings with polymorphic content can be deserialized when the type discriminator appears after other properties
HotChocolate.Adapters.Mcp.Core.Tests.csproj New test project configuration file following the standard patterns used in the codebase
Adapters.slnx Updated solution file to include new test project
All.slnx Updated master solution file to include new test project

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

@glen-84 glen-84 merged commit 5d9ec73 into main Feb 3, 2026
233 of 236 checks passed
@glen-84 glen-84 deleted the gai/prompt-settings-deserialization branch February 3, 2026 09:30
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

🚀 Fusion Gateway Performance Results

Simple Composite Query

Constant Load (50 VUs)

Requests/sec Error Rate
5763.20 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.81ms 7.16ms 165.36ms 8.52ms 13.19ms 18.61ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
4565.93 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.80ms 37.60ms 283.17ms 48.54ms 109.94ms 126.85ms

Executed Query

fragment User on User {
  id
  username
  name
}

fragment Review on Review {
  id
  body
}

fragment Product on Product {
  inStock
  name
  price
  shippingEstimate
  upc
  weight
}

query TestQuery {
  topProducts(first: 5) {
    ...Product
    reviews {
      ...Review
      author {
        ...User
      }
    }
  }
}

Deep Recursion Query

Constant Load (50 VUs)

Requests/sec Error Rate
268.55 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
12.52ms 174.89ms 571.49ms 180.53ms 227.28ms 251.15ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
306.20 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
3.11ms 663.13ms 1724.68ms 690.02ms 1382.05ms 1506.15ms

Executed Query

fragment User on User {
  id
  username
  name
}

fragment Review on Review {
  id
  body
}

fragment Product on Product {
  inStock
  name
  price
  shippingEstimate
  upc
  weight
}

query TestQuery {
  users {
    ...User
    reviews {
      ...Review
      product {
        ...Product
        reviews {
          ...Review
          author {
            ...User
            reviews {
              ...Review
              product {
                ...Product
              }
            }
          }
        }
      }
    }
  }
  topProducts(first: 5) {
    ...Product
    reviews {
      ...Review
      author {
        ...User
        reviews {
          ...Review
          product {
            ...Product
          }
        }
      }
    }
  }
}

Variable Batching Throughput

Constant Load (50 VUs)

Requests/sec Error Rate
23592.37 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 1.71ms 49.82ms 2.07ms 3.93ms 4.82ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
18608.77 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 9.35ms 122.45ms 11.35ms 23.43ms 28.45ms

Executed Query

query TestQuery_8f7a46ce_2(
  $__fusion_1_upc: ID!
  $__fusion_2_price: Long!
  $__fusion_2_weight: Long!
) {
  productByUpc(upc: $__fusion_1_upc) {
    inStock
    shippingEstimate(weight: $__fusion_2_weight, price: $__fusion_2_price)
  }
}

Variables (5 sets batched in single request)

[
  { "__fusion_1_upc": "1", "__fusion_2_price": 899, "__fusion_2_weight": 100 },
  { "__fusion_1_upc": "2", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 },
  { "__fusion_1_upc": "3", "__fusion_2_price": 15, "__fusion_2_weight": 20 },
  { "__fusion_1_upc": "4", "__fusion_2_price": 499, "__fusion_2_weight": 100 },
  { "__fusion_1_upc": "5", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 }
]

No baseline data available for comparison.


Run 21624270459 • Commit cea6215 • Tue, 03 Feb 2026 09:35:11 GMT

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants