fix: correct OVMS API URL path formation (#11701)

* Initial plan

* fix: correct OVMS API URL path from '../v1/config' to 'config'

Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>

* fix: update OVMSClient to use formatted API URL for model listing

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
Co-authored-by: suyao <sy20010504@gmail.com>
This commit is contained in:
Copilot 2025-12-05 17:40:29 +08:00 committed by GitHub
parent ea36b918f1
commit 968210faa7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,7 @@ import { loggerService } from '@logger'
import { isSupportedModel } from '@renderer/config/models'
import type { Provider } from '@renderer/types'
import { objectKeys } from '@renderer/types'
import { formatApiHost, withoutTrailingApiVersion } from '@renderer/utils'
import { OpenAIAPIClient } from '../openai/OpenAIApiClient'
@ -16,11 +17,8 @@ export class OVMSClient extends OpenAIAPIClient {
override async listModels(): Promise<OpenAI.Models.Model[]> {
try {
const sdk = await this.getSdkInstance()
const chatModelsResponse = await sdk.request({
method: 'get',
path: '../v1/config'
})
const url = formatApiHost(withoutTrailingApiVersion(this.getBaseURL()), true, 'v1')
const chatModelsResponse = await sdk.withOptions({ baseURL: url }).get('/config')
logger.debug(`Chat models response: ${JSON.stringify(chatModelsResponse)}`)
// Parse the config response to extract model information