Skip to content

Use Mistral SDK in MistralHandler.streamFim#5660

Closed
wkordalski wants to merge 1 commit into
Kilo-Org:mainfrom
wkordalski:mistral-fim-streaming
Closed

Use Mistral SDK in MistralHandler.streamFim#5660
wkordalski wants to merge 1 commit into
Kilo-Org:mainfrom
wkordalski:mistral-fim-streaming

Conversation

@wkordalski
Copy link
Copy Markdown

Context

While debugging 401 Unauthorized error during autocompletion (see #5658), I've also analyzed MistralHandler.streamFim function.

It surprised me that it is implemented manually instead of using functions from Mistral SDK (which is used in the rest of MistralHandler class).

As I suspected that the 401 Unauthorized error results from wrong implementation of streamFim, I've rewritten it to use Mistral SDK.

Now we know that the bug was somewhere else, but I think it is still valuable to merge the refactor I've done.

Implementation

Use Mistral SDK for FIM streaming instead of manual implementation.

Screenshots

How to Test

  1. Setup profile with Mistral / codestral model.
  2. Check whether autocompletion works.

Get in Touch

My Discord handle is wkordalski

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 4, 2026

⚠️ No Changeset found

Latest commit: eb222d7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

jeremylongshore added a commit to jeremylongshore/kilocode that referenced this pull request Feb 14, 2026
Reviews #1-22 covering PRs across tiers 1-3.
Includes review.md (machine-parseable), journal.md (human narrative),
and status.json for each PR.

Combined integration test: PRs Kilo-Org#5370 + Kilo-Org#5660 + Kilo-Org#5704 merged and tested
together — 7,932 tests passed, 4 pre-existing failures (mistral-fim mocks).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jeremylongshore added a commit to jeremylongshore/kilocode that referenced this pull request Feb 14, 2026
Tests now mock this.client.fim.stream() (Mistral SDK) instead of
global.fetch + streamSse, matching the PR Kilo-Org#5660 refactor.

- yields chunks correctly: mocks SDK async iterable
- handles errors correctly: mocks SDK rejection + TelemetryService
- uses correct endpoint: verifies Mistral constructor args
- uses custom codestral URL: verifies constructor with custom URL

All 8 tests pass (4 fimSupport + 4 streamFim).
jeremylongshore added a commit to jeremylongshore/kilocode that referenced this pull request Feb 15, 2026
@kevinvandijk
Copy link
Copy Markdown
Contributor

Hi! Recently we made the decision to start working hard on a ground-up rebuild of this extension using the new Kilo CLI as the backend. Because of this we made the decision to start temporarily limiting the size and type of features we're still accepting into the current extension. If you think this functionality is still important could please add a feature request or submit a PR to the new repository?

Regardless, we really appreciate the effort you made. Please reach out to me on Discord (Kevin) with the email address you used to sign up for Kilo so I can grant you some credits!

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.

2 participants