From f4661b6486684b70689ec90ee22ee721724ce96d Mon Sep 17 00:00:00 2001 From: zhaojunchang Date: Fri, 10 Apr 2026 13:33:08 +0800 Subject: [PATCH 1/4] fix(keychain): improve error hint for keychain initialization Clarify the error message for uninitialized keychain by combining both possible scenarios (sandbox/CI environment and normal usage) into a single hint to avoid confusion. --- internal/keychain/keychain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/keychain/keychain.go b/internal/keychain/keychain.go index 187184593..791b32e16 100644 --- a/internal/keychain/keychain.go +++ b/internal/keychain/keychain.go @@ -39,7 +39,7 @@ func wrapError(op string, err error) error { hint := "Check if the OS keychain/credential manager is locked or accessible. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain." if errors.Is(err, errNotInitialized) { - hint = "The keychain master key may have been cleaned up or deleted. Please reconfigure the CLI by running `lark-cli config init`." + hint = "The keychain master key may have been cleaned up or deleted. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain. Otherwise, Please reconfigure the CLI by running lark-cli config init." } func() { From 793263505eea51e5353992c0a21b762b5176cee5 Mon Sep 17 00:00:00 2001 From: zhaojunchang Date: Fri, 10 Apr 2026 13:48:52 +0800 Subject: [PATCH 2/4] docs(keychain): improve error message hints for sandbox environments Add suggestion to try running outside sandbox when keychain access fails. Also update hint for uninitialized keychain case to include same suggestion. --- internal/keychain/keychain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/keychain/keychain.go b/internal/keychain/keychain.go index 791b32e16..71091be5f 100644 --- a/internal/keychain/keychain.go +++ b/internal/keychain/keychain.go @@ -36,10 +36,10 @@ func wrapError(op string, err error) error { } msg := fmt.Sprintf("keychain %s failed: %v", op, err) - hint := "Check if the OS keychain/credential manager is locked or accessible. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain." + hint := "Check if the OS keychain/credential manager is locked or accessible. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain, You can try running this outside the sandbox." if errors.Is(err, errNotInitialized) { - hint = "The keychain master key may have been cleaned up or deleted. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain. Otherwise, Please reconfigure the CLI by running lark-cli config init." + hint = "The keychain master key may have been cleaned up or deleted. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain, You can try running this outside the sandbox. Otherwise, Please reconfigure the CLI by running lark-cli config init." } func() { From a51ba36efde17558fc642953d721b35b0a711bb1 Mon Sep 17 00:00:00 2001 From: zhaojunchang Date: Fri, 10 Apr 2026 14:01:33 +0800 Subject: [PATCH 3/4] docs(keychain): fix grammar in error message hints --- internal/keychain/keychain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/keychain/keychain.go b/internal/keychain/keychain.go index 71091be5f..b377ebde5 100644 --- a/internal/keychain/keychain.go +++ b/internal/keychain/keychain.go @@ -36,10 +36,10 @@ func wrapError(op string, err error) error { } msg := fmt.Sprintf("keychain %s failed: %v", op, err) - hint := "Check if the OS keychain/credential manager is locked or accessible. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain, You can try running this outside the sandbox." + hint := "Check if the OS keychain/credential manager is locked or accessible. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain, you can try running this outside the sandbox." if errors.Is(err, errNotInitialized) { - hint = "The keychain master key may have been cleaned up or deleted. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain, You can try running this outside the sandbox. Otherwise, Please reconfigure the CLI by running lark-cli config init." + hint = "The keychain master key may have been cleaned up or deleted. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain, you can try running this outside the sandbox. Otherwise, Please reconfigure the CLI by running lark-cli config init." } func() { From f4ad03517e3da5d024bab1747c5337a1c971a433 Mon Sep 17 00:00:00 2001 From: zhaojunchang Date: Fri, 10 Apr 2026 14:03:25 +0800 Subject: [PATCH 4/4] docs(keychain): fix typo in error message hint --- internal/keychain/keychain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/keychain/keychain.go b/internal/keychain/keychain.go index b377ebde5..e2cdecc11 100644 --- a/internal/keychain/keychain.go +++ b/internal/keychain/keychain.go @@ -39,7 +39,7 @@ func wrapError(op string, err error) error { hint := "Check if the OS keychain/credential manager is locked or accessible. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain, you can try running this outside the sandbox." if errors.Is(err, errNotInitialized) { - hint = "The keychain master key may have been cleaned up or deleted. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain, you can try running this outside the sandbox. Otherwise, Please reconfigure the CLI by running lark-cli config init." + hint = "The keychain master key may have been cleaned up or deleted. If running inside a sandbox or CI environment, please ensure the process has the necessary permissions to access the keychain, you can try running this outside the sandbox. Otherwise, please reconfigure the CLI by running lark-cli config init." } func() {