refactor(cli): drop ModelsDev Promise compat shim (#25460)

This commit is contained in:
Kit Langton
2026-05-02 15:11:01 -04:00
committed by GitHub
parent 6cd02c05c2
commit 05b82a6a30
3 changed files with 8 additions and 13 deletions

View File

@@ -7,7 +7,6 @@ import { Flag } from "@opencode-ai/core/flag/flag"
import { Flock } from "@opencode-ai/core/util/flock"
import { Hash } from "@opencode-ai/core/util/hash"
import { AppFileSystem } from "@opencode-ai/core/filesystem"
import { makeRuntime } from "@/effect/run-service"
import { withTransientReadRetry } from "@/util/effect-http-client"
const Cost = Schema.Struct({
@@ -196,11 +195,4 @@ export const defaultLayer: Layer.Layer<Service> = layer.pipe(
Layer.provide(AppFileSystem.defaultLayer),
)
// Promise-style compat for callers in Promise-context (Hono routes, legacy CLI handlers).
// makeRuntime uses the shared memoMap so this runtime's Service instance is the same one
// AppRuntime sees — Effect callers and Promise callers operate on the same cache.
const runtime = makeRuntime(Service, defaultLayer)
export const get = () => runtime.runPromise((s) => s.get())
export const refresh = (force = false) => runtime.runPromise((s) => s.refresh(force))
export * as ModelsDev from "./models"