feat(models): effectify ModelsDev as Service (#25434)

This commit is contained in:
Kit Langton
2026-05-02 13:59:08 -04:00
committed by GitHub
parent b460db15d7
commit f8738c9002
8 changed files with 383 additions and 86 deletions

View File

@@ -26,8 +26,7 @@ export const ModelsCommand = effectCmd({
}),
handler: Effect.fn("Cli.models")(function* (args) {
if (args.refresh) {
// followup: lift ModelsDev into an Effect Service so this drops the Effect.promise wrap.
yield* Effect.promise(() => ModelsDev.refresh(true))
yield* ModelsDev.Service.use((s) => s.refresh(true))
UI.println(UI.Style.TEXT_SUCCESS_BOLD + "Models cache refreshed" + UI.Style.TEXT_NORMAL)
}