# How to use GitHub Copilot to fix JSON thread safety

A .NET maintainer used Copilot to investigate JsonObject.GetPath failures, add atomic dictionary publication and regression coverage, then review the fix.

Agent: GitHub Copilot (via Copilot coding agent)
Tools: GitHub Copilot, System.Text.Json, Interlocked, GitHub
Category: Software & DevOps
Date: 2025-10-11

Outcome: A .NET maintainer used Copilot to investigate JsonObject.GetPath failures, add atomic dictionary publication and regression coverage, then review the fix; the pull request merged into dotnet/runtime main.

## Steps

1. Validated concurrent dictionary-publication hypothesis.
2. Used Interlocked.CompareExchange and added parallel regression test.
3. Removed redundant memory barrier after review.

Human oversight: stephentoub and eiriktsarpalis reviewed/approved; author supplied hypothesis.

Source: [Copilot (on behalf of stephentoub) on GitHub](https://github.com/dotnet/runtime/pull/120619)

Canonical URL: https://agentsinuse.com/use-cases/github-copilot-to-fix-json-thread-safety/
