refactor(opencode): improve startup time by 38% (#30453)

Co-authored-by: starptech <starptech@starptechs-MBP.fritz.box>
This commit is contained in:
Dustin Deus
2026-06-02 21:20:25 +02:00
committed by GitHub
co-authored by starptech
parent 83c12f334e
commit 7dd2306dad
20 changed files with 1878 additions and 1851 deletions
+1 -2
View File
@@ -1,7 +1,5 @@
import { EOL } from "os"
import { Effect } from "effect"
import { Provider } from "@/provider/provider"
import { ModelsDev } from "@opencode-ai/core/models-dev"
import { effectCmd, fail } from "../effect-cmd"
import { UI } from "../ui"
@@ -26,6 +24,7 @@ export const ModelsCommand = effectCmd({
type: "boolean",
}),
handler: Effect.fn("Cli.models")(function* (args) {
const { Provider } = yield* Effect.promise(() => import("@/provider/provider"))
if (args.refresh) {
yield* ModelsDev.Service.use((s) => s.refresh(true))
UI.println(UI.Style.TEXT_SUCCESS_BOLD + "Models cache refreshed" + UI.Style.TEXT_NORMAL)