Skip to content

Fix MCP JsonNode clone round trips - #3333

Merged
Widthdom merged 3 commits into
mainfrom
fix-issue3055-3098
Jun 6, 2026
Merged

Fix MCP JsonNode clone round trips#3333
Widthdom merged 3 commits into
mainfrom
fix-issue3055-3098

Conversation

@Widthdom

@Widthdom Widthdom commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replaced MCP JsonNode serialize/parse clone paths with a shared DeepClone() helper for response IDs, progress tokens, session capability copies, and structured error extra data.
  • Preserved the upstream MCP session capability byte/depth caps by measuring with the bounded JSON writer, checking depth directly, then cloning only the retained diagnostics.
  • Added MCP JsonNode cloning should avoid serialize-and-parse round trips #3055 regression tests and a changelog fragment.

Issues

Fixes #3055

Not handled by this PR:

Validation

  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter "FullyQualifiedName~McpServerTests" -p:UseSharedCompilation=false
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --json
  • Adversarial review: No blocking/actionable issues found.

Notes

  • Changelog fragment: changelog.d/unreleased/3055.fixed.md.
  • No AGENT.md, CLAUDE.md, or AGENT_GUIDE.md changes are present in the final PR diff.
  • Conflict resolution was done by merging latest origin/main because local rebase/history rewrite was blocked in this environment.

@Widthdom
Widthdom marked this pull request as ready for review June 6, 2026 14:12
@Widthdom Widthdom changed the title Fix MCP JSON cloning and client response retention Fix MCP JsonNode clone round trips Jun 6, 2026
@Widthdom
Widthdom merged commit 9ef95a7 into main Jun 6, 2026
10 checks passed
@Widthdom
Widthdom deleted the fix-issue3055-3098 branch June 6, 2026 14:53
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.

MCP JsonNode cloning should avoid serialize-and-parse round trips

1 participant