Skip to content

Commit 54e7f59

Browse files
committed
backport again
1 parent a14c67d commit 54e7f59

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/services/ghost/new-auto-complete/NewAutocompleteModel.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ import { DEFAULT_AUTOCOMPLETE_OPTS } from "../../continuedev/core/util/parameter
1313
import Mistral from "../../continuedev/core/llm/llms/Mistral"
1414
import OpenRouter from "../../continuedev/core/llm/llms/OpenRouter"
1515
import KiloCode from "../../continuedev/core/llm/llms/KiloCode"
16-
import {
17-
AUTOCOMPLETE_PROVIDER_MODELS,
18-
AutocompleteProviderKey,
19-
defaultProviderUsabilityChecker,
20-
} from "../utils/kilocode-utils"
16+
import { AUTOCOMPLETE_PROVIDER_MODELS, AutocompleteProviderKey, checkKilocodeBalance } from "../utils/kilocode-utils"
2117

2218
export class NewAutocompleteModel {
2319
private apiHandler: ApiHandler | null = null
@@ -48,8 +44,13 @@ export class NewAutocompleteModel {
4844
for (const provider of supportedProviders) {
4945
const selectedProfile = profiles.find((x) => x?.apiProvider === provider)
5046
if (!selectedProfile) continue
51-
const isUsable = await defaultProviderUsabilityChecker(provider, providerSettingsManager)
52-
if (!isUsable) continue
47+
48+
if (provider === "kilocode") {
49+
// For all other providers, assume they are usable
50+
const profile = await providerSettingsManager.getProfile({ id: selectedProfile.id })
51+
if (!profile.kilocodeToken) continue
52+
if (!(await checkKilocodeBalance(profile.kilocodeToken, profile.kilocodeOrganizationId))) continue
53+
}
5354

5455
this.loadProfile(providerSettingsManager, selectedProfile, provider)
5556
this.loaded = true
@@ -59,7 +60,6 @@ export class NewAutocompleteModel {
5960
this.loaded = true // we loaded, and found nothing, but we do not wish to reload
6061
return false
6162
}
62-
6363
public async loadProfile(
6464
providerSettingsManager: ProviderSettingsManager,
6565
selectedProfile: ProviderSettingsEntry,

0 commit comments

Comments
 (0)