Move rest of state to cache (#5404)

* move rest of state to cacheService

* finish moving state to cache

* remove console logs

* fix types

* don't type cast

* add eslint rule banning use of direct storage apis

* fix types

* move vscode state eslint rule to separate rule since it's error and the others aren't

* fix eslint rules parsing
This commit is contained in:
celestial-vault authored and GitHub committed 2025-08-11 14:46:39 -07:00
1 parent 2aa5156905
commit 669e018b85
52 files changed
+1472 -1096

No files matched your search

@@ -1,7 +1,6 @@
import { Controller } from ".."
import { EmptyRequest } from "@shared/proto/cline/common"
import { OpenRouterCompatibleModelInfo, OpenRouterModelInfo } from "@shared/proto/cline/models"
import { getAllExtensionState } from "../../storage/state"
import { groqModels } from "../../../shared/api"
import axios from "axios"
import path from "path"
@@ -19,9 +18,7 @@ import { telemetryService } from "@/services/posthog/PostHogClientProvider"
export async function refreshGroqModels(controller: Controller, request: EmptyRequest): Promise<OpenRouterCompatibleModelInfo> {
const groqModelsFilePath = path.join(await ensureCacheDirectoryExists(controller), GlobalFileNames.groqModels)
// Get the Groq API key from the controller's state
const { apiConfiguration } = await getAllExtensionState(controller.context)
const groqApiKey = apiConfiguration?.groqApiKey
const groqApiKey = controller.cacheService.getSecretKey("groqApiKey")
let models: Record<string, Partial<OpenRouterModelInfo>> = {}
try {