From 5958fb08d3bdd94d8dfacede4e7bfb567520f030 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Wed, 30 Sep 2026 19:57:30 -0400 Subject: [PATCH] refactor(cli): resolve remaining gopls diagnostics --- cli/cmd/albedo/model_select.go | 3 ++- cli/cmd/albedo/prompt.go | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cli/cmd/albedo/model_select.go b/cli/cmd/albedo/model_select.go index 2326f1b..066b39c 100644 --- a/cli/cmd/albedo/model_select.go +++ b/cli/cmd/albedo/model_select.go @@ -88,7 +88,8 @@ func switchModel(ctx context.Context, conn *daemon.Connection, sessionID string, } func modelsCommand(args []string) error { - for _, arg := range args { + if len(args) > 0 { + arg := args[0] if arg == "-h" || arg == "--help" { fmt.Println("Usage: albedo models\n\nLists provider/model for every configured provider; the first line is the active provider's default.") return nil diff --git a/cli/cmd/albedo/prompt.go b/cli/cmd/albedo/prompt.go index 9b2d6a2..d49c1ae 100644 --- a/cli/cmd/albedo/prompt.go +++ b/cli/cmd/albedo/prompt.go @@ -30,9 +30,9 @@ func promptCommand(prompt, sessionID, cwd, model string, timeout time.Duration) } var choice modelChoice if model != "" { - profiles, err := daemon.ProviderProfiles(ctx, conn) - if err != nil { - return err + profiles, profileErr := daemon.ProviderProfiles(ctx, conn) + if profileErr != nil { + return profileErr } if choice, err = chooseModel(configuredModels(ctx, conn, profiles), profiles.Active, model); err != nil { return err @@ -43,14 +43,14 @@ func promptCommand(prompt, sessionID, cwd, model string, timeout time.Duration) if model != "" { create["provider"], create["model"] = choice.provider, choice.model } - session, err := daemon.Request[daemon.Session](ctx, conn, "/sessions", create) - if err != nil { - return err + session, createErr := daemon.Request[daemon.Session](ctx, conn, "/sessions", create) + if createErr != nil { + return createErr } sessionID = session.ID } else if model != "" { - if err := switchModel(ctx, conn, sessionID, choice); err != nil { - return err + if switchErr := switchModel(ctx, conn, sessionID, choice); switchErr != nil { + return switchErr } } -- knotmirror 0.0.1