Repository navigation
AI: Remove obsolete OpenAI JsonPatch workaround - #7815
Conversation
OpenAI 2.14.0 includes the upstream bounds-check fix, so direct JsonPatch lookups now safely handle empty choices and null deltas. Removing the manual JSON traversal fixes Azure asynchronous content-filter chunks that contain no delta. Fixes #7790. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
๐ก Changes recommended
The null-delta regression needs checked-in automated coverage.
1 open finding
What changed in this PR
Removes the obsolete OpenAI JsonPatch workaround while safely handling empty choices and null-delta Azure chunks.
Changes:
- Restores direct reasoning-content patch lookups.
- Removes manual JSON traversal.
| File | Description |
|---|---|
OpenAIChatClient.cs |
Simplifies reasoning-content extraction using fixed OpenAI 2.14.0 APIs. |
๐ง Review effort: Balanced
๐ Good job! The coverage increased ๐
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1627071&view=codecoverage-tab |
Verify Azure annotation-only streaming chunks do not interrupt enumeration and that trailing usage remains available. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
๐ Good job! The coverage increased ๐
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1628570&view=codecoverage-tab |
valkiara
left a comment
There was a problem hiding this comment.
Reviewed 4047f52. OpenAI 2.14.0 is already pinned in eng/packages/General.props, so the direct lookups use the SDK version with the upstream fix.
Ran the adapter test project on net10.0: 391 passed, 163 skipped with live integration tests disabled. I also ran five local cases with an annotation before text: empty choices, a missing delta, an explicit null delta, an empty delta, and null reasoning_content. All completed with text, the stop reason, and trailing usage preserved. The existing streaming and non-streaming reasoning tests passed too.
No issues found in the changed paths.
* Remove obsolete OpenAI JsonPatch workaround OpenAI 2.14.0 includes the upstream bounds-check fix, so direct JsonPatch lookups now safely handle empty choices and null deltas. Removing the manual JSON traversal fixes Azure asynchronous content-filter chunks that contain no delta. Fixes dotnet#7790. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add regression test for null-delta filter chunks Verify Azure annotation-only streaming chunks do not interrupt enumeration and that trailing usage remains available. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 12d337a) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7f884d96-e2eb-429c-8e19-827062cdb05c

OpenAI 2.14.0 includes the upstream bounds-check fix for openai/openai-dotnet#1281, so this removes the now-obsolete manual reasoning-content JSON traversal and restores direct
JsonPatchlookups; relying on the corrected SDK traversal fixes the scenario reported in #7790, where Azure asynchronous content-filter chunks contain a choice with no delta, and supersedes the guard-based approach proposed in #7792. A focused SSE regression test now covers text, stop, the annotation-only null-delta chunk, and trailing usage. Fixes #7790.