Skip to content

Conversation

@shethaadit
Copy link
Contributor

Description

This PR addresses a known issue where omitting the "extra-parameters": "pass-through" header in HttpClient results in a 400 Bad Request when calling Mistral chat completions.

  • Fixes a critical integration bug by enforcing the required header at the extension level if not provided by the user.
  • Adds a unit test to validate correct injection of the header, improving coverage and reliability for MistralAI scenarios.

These changes improve robustness, eliminate manual setup pitfalls, and enhance maintainability for developers integrating Mistral models.

Contribution Checklist

Fixes #11634

@shethaadit shethaadit requested a review from a team as a code owner April 18, 2025 18:42
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Apr 18, 2025
@github-actions github-actions bot changed the title Ensure Required Headers in Mistral ChatCompletion HttpClient .Net: Ensure Required Headers in Mistral ChatCompletion HttpClient Apr 18, 2025
@shethaadit shethaadit requested a review from rogerbarreto April 22, 2025 04:18
@rogerbarreto rogerbarreto added the ai connector Anything related to AI connectors label Apr 22, 2025
@rogerbarreto rogerbarreto moved this to Community PRs in Semantic Kernel Apr 22, 2025
@rogerbarreto rogerbarreto moved this from Community PRs to Sprint: In Review in Semantic Kernel Apr 22, 2025
@rogerbarreto rogerbarreto removed the status in Semantic Kernel Apr 22, 2025
Copy link
Member

@markwallace-microsoft markwallace-microsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markwallace-microsoft markwallace-microsoft dismissed their stale review April 23, 2025 12:31

Need confirmation the integration tests are passing

@rogerbarreto
Copy link
Member

Need confirmation the integration tests are passing

image

Just ran, and everything looks good against mistral-large-latest model.

@rogerbarreto rogerbarreto enabled auto-merge April 24, 2025 12:11
@rogerbarreto rogerbarreto added this pull request to the merge queue Apr 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 24, 2025
@rogerbarreto rogerbarreto added this pull request to the merge queue Apr 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 24, 2025
@rogerbarreto rogerbarreto added this pull request to the merge queue Apr 24, 2025
github-merge-queue bot pushed a commit that referenced this pull request Apr 24, 2025
…11646)

### Description
This PR addresses a known issue where omitting the `"extra-parameters":
"pass-through"` header in `HttpClient` results in a `400 Bad Request`
when calling Mistral chat completions.

- **Fixes a critical integration bug** by enforcing the required header
at the extension level if not provided by the user.
- **Adds a unit test** to validate correct injection of the header,
improving coverage and reliability for MistralAI scenarios.

These changes improve robustness, eliminate manual setup pitfalls, and
enhance maintainability for developers integrating Mistral models.

### Contribution Checklist

- [Y] The code builds clean without any errors or warnings
- [Y] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [Y] All unit tests pass, and I have added new tests where possible
- [Y] I didn't break anyone 😄

Fixes #11634

---------

Co-authored-by: Adit Sheth <adsheth@microsoft.com>
Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
Merged via the queue into microsoft:main with commit 0623815 Apr 24, 2025
20 checks passed
glorious-beard pushed a commit to glorious-beard/semantic-kernel that referenced this pull request May 6, 2025
…icrosoft#11646)

### Description
This PR addresses a known issue where omitting the `"extra-parameters":
"pass-through"` header in `HttpClient` results in a `400 Bad Request`
when calling Mistral chat completions.

- **Fixes a critical integration bug** by enforcing the required header
at the extension level if not provided by the user.
- **Adds a unit test** to validate correct injection of the header,
improving coverage and reliability for MistralAI scenarios.

These changes improve robustness, eliminate manual setup pitfalls, and
enhance maintainability for developers integrating Mistral models.

### Contribution Checklist

- [Y] The code builds clean without any errors or warnings
- [Y] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [Y] All unit tests pass, and I have added new tests where possible
- [Y] I didn't break anyone 😄

Fixes microsoft#11634

---------

Co-authored-by: Adit Sheth <adsheth@microsoft.com>
Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
jcruzmot-te pushed a commit to thousandeyes/aia-semantic-kernel that referenced this pull request Sep 15, 2025
…icrosoft#11646)

### Description
This PR addresses a known issue where omitting the `"extra-parameters":
"pass-through"` header in `HttpClient` results in a `400 Bad Request`
when calling Mistral chat completions.

- **Fixes a critical integration bug** by enforcing the required header
at the extension level if not provided by the user.
- **Adds a unit test** to validate correct injection of the header,
improving coverage and reliability for MistralAI scenarios.

These changes improve robustness, eliminate manual setup pitfalls, and
enhance maintainability for developers integrating Mistral models.

### Contribution Checklist

- [Y] The code builds clean without any errors or warnings
- [Y] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [Y] All unit tests pass, and I have added new tests where possible
- [Y] I didn't break anyone 😄

Fixes microsoft#11634

---------

Co-authored-by: Adit Sheth <adsheth@microsoft.com>
Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai connector Anything related to AI connectors kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET: Bug: extra-parameters needed in HttpClient for Mistral

3 participants