Skip to content

Fixes body encoding and prompt type issues in LanguageModelFailurePlugin#1643

Merged
waldekmastykarz merged 2 commits intodotnet:mainfrom
waldekmastykarz:fix-llm-failure
May 3, 2026
Merged

Fixes body encoding and prompt type issues in LanguageModelFailurePlugin#1643
waldekmastykarz merged 2 commits intodotnet:mainfrom
waldekmastykarz:fix-llm-failure

Conversation

@waldekmastykarz
Copy link
Copy Markdown
Collaborator

No description provided.

@waldekmastykarz waldekmastykarz requested a review from a team as a code owner May 2, 2026 18:18
Copilot AI review requested due to automatic review settings May 2, 2026 18:18
@waldekmastykarz waldekmastykarz added the pr-bugfix Fixes a bug label May 2, 2026
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

Adjusts LanguageModelFailurePlugin request parsing and prompt injection to better handle OpenAI-style payloads by changing how request bodies are decoded/serialized and by updating the injected message role.

Changes:

  • Decode request body bytes to a string for OpenAI request detection/parsing (instead of using request.BodyString).
  • Add Debug logs for request encoding, original body, and modified body prior to rewriting the request.
  • Change injected prompt role from "user" to "system" for chat-completions and Responses API requests.

Comment thread DevProxy.Plugins/Behavior/LanguageModelFailurePlugin.cs
Comment thread DevProxy.Plugins/Behavior/LanguageModelFailurePlugin.cs
Comment thread DevProxy.Plugins/Behavior/LanguageModelFailurePlugin.cs
Comment thread DevProxy.Plugins/Behavior/LanguageModelFailurePlugin.cs
Comment thread DevProxy.Plugins/Behavior/LanguageModelFailurePlugin.cs
@waldekmastykarz waldekmastykarz enabled auto-merge (squash) May 3, 2026 08:13
@waldekmastykarz waldekmastykarz merged commit 1bf501d into dotnet:main May 3, 2026
4 checks passed
@waldekmastykarz waldekmastykarz deleted the fix-llm-failure branch May 3, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants