From 4071fdef8417b052163a192f7d043526c7db9821 Mon Sep 17 00:00:00 2001 From: lihan3238 Date: Fri, 8 May 2026 21:47:41 +0800 Subject: [PATCH] fix: apply default auth-dir when config value is empty When auth-dir is not specified in config.yaml, ResolveAuthDir returns an empty string which causes os.MkdirAll to fail with no path. Use the documented default ~/.cli-proxy-api instead. Fixes #3272 --- internal/util/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/util/util.go b/internal/util/util.go index 9bf630f2..960a588b 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -75,7 +75,7 @@ func SetLogLevel(cfg *config.Config) { // It expands a leading tilde (~) to the user's home directory and returns a cleaned path. func ResolveAuthDir(authDir string) (string, error) { if authDir == "" { - return "", nil + authDir = "~/.cli-proxy-api" } if strings.HasPrefix(authDir, "~") { home, err := os.UserHomeDir()