Skip to content

fix: Use the configured DeepSeek FIM base path - #13391

Open
mvanhorn wants to merge 1 commit into
continuedev:mainfrom
mvanhorn:fix/12600-deepseek-fim-endpoint
Open

mvanhorn wants to merge 1 commit into
continuedev:mainfrom
mvanhorn:fix/12600-deepseek-fim-endpoint

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Description

DeepSeek fill-in-the-middle autocomplete shows no suggestion and the extension logs a stream error. The same model and key return a normal streamed completion when DeepSeek’s beta completions endpoint is called directly. FIM requests always resolved the relative path beta/completions against the configured API base. A base whose path is already /beta/ therefore becomes /beta/beta/completions, and the completions call fails. A root base such as https://api.deepseek.com/ still resolves to /beta/completions, which is the path those bases need.

Both FIM call sites now build the endpoint with the same helper. When the pathname ends with /beta, trailing slashes are stripped and the request targets completions on that base. Otherwise the helper still resolves beta/completions, covering the default root and bases written without a trailing slash. The added tests assert the /beta/ URL and JSON body, the default root URL, the concatenated stream text, and that a failed response throws the response body.

Fixes #12600

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

AI was used for assistance.

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

No user-visible surface changes in this PR, so there is nothing to show.

Tests

No local test run is recorded for the continue Deepseek change to core/llm/llms/Deepseek.ts and packages/openai-adapters/src/apis/DeepSeek.ts.

Both FIM call sites now build the endpoint with the same helper. When
the pathname ends with /beta, trailing slashes are stripped and the
request targets completions on that base. Otherwise the helper still
resolves beta/completions, covering the default root and bases written
without a trailing slash. The added tests assert the /beta/ URL and JSON
body, the default root URL, the concatenated stream text, and that a
failed response throws the response body.

Fixes continuedev#12600
@mvanhorn
mvanhorn requested a review from a team as a code owner October 17, 2026 06:29
@mvanhorn
mvanhorn requested review from sestinj and removed request for a team October 17, 2026 06:29

This branch has not been deployed

No deployments
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.

DeepSeek FIM API 原生可用,但 Continue 的 autocomplete/FIM stream 链路报错

1 participant