From 152a35a78d2822b21667a73a90b4890a956cdc0a Mon Sep 17 00:00:00 2001 From: Andrew Nitu Date: Wed, 17 Dec 2025 15:01:38 -0800 Subject: [PATCH 1/9] update strings --- cmd/lk/agent.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/lk/agent.go b/cmd/lk/agent.go index 54099f90..40546482 100644 --- a/cmd/lk/agent.go +++ b/cmd/lk/agent.go @@ -540,10 +540,10 @@ func createAgent(ctx context.Context, cmd *cli.Command) error { } projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) - fmt.Printf("Detected project type [%s]\n", util.Accented(string(projectType))) if err != nil { - return fmt.Errorf("unable to determine project type: %w, please use a supported project type, or create your own Dockerfile in the current directory", err) + return fmt.Errorf("unable to determine app language: %w, please make sure you are inside your app's directory and are using a supported language", err) } + fmt.Printf("Detected app language [%s]\n", util.Accented(string(projectType))) if err := requireDockerfile(ctx, cmd, workingDir, projectType, settingsMap); err != nil { return err @@ -717,8 +717,9 @@ func deployAgent(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("unable to determine project type: %w, please use a supported project type, or create your own Dockerfile in the current directory", err) + return fmt.Errorf("unable to determine app language: %w, please make sure you are inside your app's directory and are using a supported language", err) } + fmt.Printf("Detected app language [%s]\n", util.Accented(string(projectType))) settingsMap, err := getClientSettings(ctx, cmd.Bool("silent")) if err != nil { @@ -1436,10 +1437,10 @@ func generateAgentDockerfile(ctx context.Context, cmd *cli.Command) error { } projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) - fmt.Printf("Detected project type [%s]\n", util.Accented(string(projectType))) if err != nil { - return fmt.Errorf("unable to determine project type: %w, please use a supported project type, or create your own Dockerfile in the current directory", err) + return fmt.Errorf("unable to determine app language: %w, please make sure you are inside your app's directory and are using a supported language", err) } + fmt.Printf("Detected app language [%s]\n", util.Accented(string(projectType))) dockerfilePath := filepath.Join(workingDir, "Dockerfile") dockerignorePath := filepath.Join(workingDir, ".dockerignore") From 7c9c892354f7edcc4d4715f454528d03f72d3062 Mon Sep 17 00:00:00 2001 From: Andrew Nitu Date: Wed, 17 Dec 2025 15:10:02 -0800 Subject: [PATCH 2/9] strings --- cmd/lk/agent.go | 6 +++--- pkg/agentfs/detect.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/lk/agent.go b/cmd/lk/agent.go index 40546482..5f9b1021 100644 --- a/cmd/lk/agent.go +++ b/cmd/lk/agent.go @@ -541,7 +541,7 @@ func createAgent(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("unable to determine app language: %w, please make sure you are inside your app's directory and are using a supported language", err) + return fmt.Errorf("unable to determine app language: %w, please make sure you are inside an app directory and are using a supported language", err) } fmt.Printf("Detected app language [%s]\n", util.Accented(string(projectType))) @@ -717,7 +717,7 @@ func deployAgent(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("unable to determine app language: %w, please make sure you are inside your app's directory and are using a supported language", err) + return fmt.Errorf("unable to determine app language: %w, please make sure you are inside an app directory and are using a supported language", err) } fmt.Printf("Detected app language [%s]\n", util.Accented(string(projectType))) @@ -1438,7 +1438,7 @@ func generateAgentDockerfile(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("unable to determine app language: %w, please make sure you are inside your app's directory and are using a supported language", err) + return fmt.Errorf("unable to determine app language: %w, please make sure you are inside an app directory and are using a supported language", err) } fmt.Printf("Detected app language [%s]\n", util.Accented(string(projectType))) diff --git a/pkg/agentfs/detect.go b/pkg/agentfs/detect.go index d8c6194b..55a0ceae 100644 --- a/pkg/agentfs/detect.go +++ b/pkg/agentfs/detect.go @@ -113,5 +113,5 @@ func DetectProjectType(dir fs.FS) (ProjectType, error) { return ProjectTypePythonPip, nil } - return ProjectTypeUnknown, errors.New("project type could not be identified; expected package.json, requirements.txt, pyproject.toml, or lock files") + return ProjectTypeUnknown, errors.New("expected package.json, requirements.txt, pyproject.toml, or lock files") } From f1fa8c0fbe6036bfee27d94f3b36c00b64c60f05 Mon Sep 17 00:00:00 2001 From: Andrew Nitu Date: Wed, 17 Dec 2025 15:13:57 -0800 Subject: [PATCH 3/9] change to agent --- cmd/lk/agent.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/lk/agent.go b/cmd/lk/agent.go index 5f9b1021..7934aa91 100644 --- a/cmd/lk/agent.go +++ b/cmd/lk/agent.go @@ -541,9 +541,9 @@ func createAgent(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("unable to determine app language: %w, please make sure you are inside an app directory and are using a supported language", err) + return fmt.Errorf("unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err) } - fmt.Printf("Detected app language [%s]\n", util.Accented(string(projectType))) + fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType))) if err := requireDockerfile(ctx, cmd, workingDir, projectType, settingsMap); err != nil { return err @@ -717,9 +717,9 @@ func deployAgent(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("unable to determine app language: %w, please make sure you are inside an app directory and are using a supported language", err) + return fmt.Errorf("unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err) } - fmt.Printf("Detected app language [%s]\n", util.Accented(string(projectType))) + fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType))) settingsMap, err := getClientSettings(ctx, cmd.Bool("silent")) if err != nil { @@ -1438,9 +1438,9 @@ func generateAgentDockerfile(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("unable to determine app language: %w, please make sure you are inside an app directory and are using a supported language", err) + return fmt.Errorf("unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err) } - fmt.Printf("Detected app language [%s]\n", util.Accented(string(projectType))) + fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType))) dockerfilePath := filepath.Join(workingDir, "Dockerfile") dockerignorePath := filepath.Join(workingDir, ".dockerignore") From af52ffe071dbb260462a8a17f4a65878935565f0 Mon Sep 17 00:00:00 2001 From: Andrew Nitu Date: Wed, 17 Dec 2025 16:34:09 -0800 Subject: [PATCH 4/9] prompt agent --- pkg/agentfs/sdk_version_check.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/agentfs/sdk_version_check.go b/pkg/agentfs/sdk_version_check.go index 54bbc01b..05cee489 100644 --- a/pkg/agentfs/sdk_version_check.go +++ b/pkg/agentfs/sdk_version_check.go @@ -57,7 +57,7 @@ func CheckSDKVersion(dir string, projectType ProjectType, settingsMap map[string // Find the best result (prefer lock files over source files) bestResult := findBestResult(results) if bestResult == nil { - return fmt.Errorf("package %s not found in any project files", getTargetPackageName(projectType)) + return fmt.Errorf("package %s not found in any project files. Are you sure this is an agent?", getTargetPackageName(projectType)) } if !bestResult.Satisfied { From ab2416733518bcf0f4b79575968daec630bc4295 Mon Sep 17 00:00:00 2001 From: Andrew Nitu Date: Wed, 17 Dec 2025 16:35:00 -0800 Subject: [PATCH 5/9] clarify agent deployment --- cmd/lk/agent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/lk/agent.go b/cmd/lk/agent.go index 7934aa91..48cd33be 100644 --- a/cmd/lk/agent.go +++ b/cmd/lk/agent.go @@ -526,7 +526,7 @@ func createAgent(ctx context.Context, cmd *cli.Command) error { lkConfig = config.NewLiveKitTOML(subdomainMatches[1]).WithDefaultAgent() } if !silent { - fmt.Printf("Creating new agent\n") + fmt.Printf("Creating new agent deployment\n") } secrets, err := requireSecrets(ctx, cmd, false, false) From 8b1695c4fcf62d9a6aa4a7263e3ac0db9d489b81 Mon Sep 17 00:00:00 2001 From: Andrew Nitu Date: Thu, 18 Dec 2025 09:05:36 -0800 Subject: [PATCH 6/9] Update cmd/lk/agent.go Co-authored-by: Kristy Marcinova --- cmd/lk/agent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/lk/agent.go b/cmd/lk/agent.go index 48cd33be..bc4d4d1d 100644 --- a/cmd/lk/agent.go +++ b/cmd/lk/agent.go @@ -541,7 +541,7 @@ func createAgent(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err) + return fmt.Errorf("unable to determine agent language: %w, please navigate to a directory containing an agent written in a supported language", err) } fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType))) From 51447b185ca921115d484fd9a39951c0a6d67221 Mon Sep 17 00:00:00 2001 From: Andrew Nitu Date: Thu, 18 Dec 2025 09:30:59 -0800 Subject: [PATCH 7/9] error case --- cmd/lk/agent.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/lk/agent.go b/cmd/lk/agent.go index bc4d4d1d..04fdaf3c 100644 --- a/cmd/lk/agent.go +++ b/cmd/lk/agent.go @@ -541,7 +541,7 @@ func createAgent(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("unable to determine agent language: %w, please navigate to a directory containing an agent written in a supported language", err) + return fmt.Errorf("Unable to determine agent language: %w, please navigate to a directory containing an agent written in a supported language", err) } fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType))) @@ -717,7 +717,7 @@ func deployAgent(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err) + return fmt.Errorf("Unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err) } fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType))) @@ -1438,7 +1438,7 @@ func generateAgentDockerfile(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err) + return fmt.Errorf("Unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err) } fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType))) From d2c5a6d9386553df6802bd3d5087bb9b23e73551 Mon Sep 17 00:00:00 2001 From: Andrew Nitu Date: Thu, 18 Dec 2025 09:51:10 -0800 Subject: [PATCH 8/9] linting --- cmd/lk/agent.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/lk/agent.go b/cmd/lk/agent.go index 04fdaf3c..95f40198 100644 --- a/cmd/lk/agent.go +++ b/cmd/lk/agent.go @@ -541,6 +541,7 @@ func createAgent(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { + //lint:ignore ST1005 // error string intentionally capitalized as we print it to the user. return fmt.Errorf("Unable to determine agent language: %w, please navigate to a directory containing an agent written in a supported language", err) } fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType))) @@ -717,7 +718,8 @@ func deployAgent(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("Unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err) + //lint:ignore ST1005 // error string intentionally capitalized as we print it to the user. + return fmt.Errorf("Unable to determine agent language: %w, please navigate to a directory containing an agent written in a supported language", err) } fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType))) @@ -1438,7 +1440,8 @@ func generateAgentDockerfile(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - return fmt.Errorf("Unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err) + //lint:ignore ST1005 // error string intentionally capitalized as we print it to the user. + return fmt.Errorf("Unable to determine agent language: %w, please navigate to a directory containing an agent written in a supported language", err) } fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType))) From bb3aa58688d478106a4ec96856819f5a3e53997e Mon Sep 17 00:00:00 2001 From: Andrew Nitu Date: Thu, 18 Dec 2025 09:54:11 -0800 Subject: [PATCH 9/9] revert --- cmd/lk/agent.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cmd/lk/agent.go b/cmd/lk/agent.go index 95f40198..bc4d4d1d 100644 --- a/cmd/lk/agent.go +++ b/cmd/lk/agent.go @@ -541,8 +541,7 @@ func createAgent(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - //lint:ignore ST1005 // error string intentionally capitalized as we print it to the user. - return fmt.Errorf("Unable to determine agent language: %w, please navigate to a directory containing an agent written in a supported language", err) + return fmt.Errorf("unable to determine agent language: %w, please navigate to a directory containing an agent written in a supported language", err) } fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType))) @@ -718,8 +717,7 @@ func deployAgent(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - //lint:ignore ST1005 // error string intentionally capitalized as we print it to the user. - return fmt.Errorf("Unable to determine agent language: %w, please navigate to a directory containing an agent written in a supported language", err) + return fmt.Errorf("unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err) } fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType))) @@ -1440,8 +1438,7 @@ func generateAgentDockerfile(ctx context.Context, cmd *cli.Command) error { projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) if err != nil { - //lint:ignore ST1005 // error string intentionally capitalized as we print it to the user. - return fmt.Errorf("Unable to determine agent language: %w, please navigate to a directory containing an agent written in a supported language", err) + return fmt.Errorf("unable to determine agent language: %w, please make sure you are inside a directory containing an agent written in a supported language", err) } fmt.Printf("Detected agent language [%s]\n", util.Accented(string(projectType)))