From 17cbc13fcbd17bb6ef7fa6e79878ca4540c609cf Mon Sep 17 00:00:00 2001 From: AlbertSun Date: Wed, 27 May 2026 16:07:21 +0800 Subject: [PATCH] refactor(auth): drop duplicate top-level user fields in status (#1128) * opt: trim duplicate auth status info * fix: update signals of auth status workflow --- cmd/auth/status.go | 24 ------------------- .../lark-task/references/lark-task-create.md | 2 +- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/cmd/auth/status.go b/cmd/auth/status.go index 20a8d479..f0cf85e4 100644 --- a/cmd/auth/status.go +++ b/cmd/auth/status.go @@ -61,7 +61,6 @@ func authStatusRun(opts *StatusOptions) error { diagnostics := identitydiag.Diagnose(context.Background(), f, config, opts.Verify) result["identities"] = diagnostics result["identity"] = effectiveIdentity(diagnostics) - addLegacyUserFields(result, diagnostics.User) addEffectiveVerification(result, diagnostics) addStatusNote(result, diagnostics) @@ -86,29 +85,6 @@ func effectiveIdentity(d identitydiag.Result) string { } } -func addLegacyUserFields(result map[string]interface{}, user identitydiag.Identity) { - if user.OpenID == "" { - return - } - result["userName"] = user.UserName - result["userOpenId"] = user.OpenID - if user.TokenStatus != "" { - result["tokenStatus"] = user.TokenStatus - } - if user.Scope != "" { - result["scope"] = user.Scope - } - if user.ExpiresAt != "" { - result["expiresAt"] = user.ExpiresAt - } - if user.RefreshExpiresAt != "" { - result["refreshExpiresAt"] = user.RefreshExpiresAt - } - if user.GrantedAt != "" { - result["grantedAt"] = user.GrantedAt - } -} - func addEffectiveVerification(result map[string]interface{}, d identitydiag.Result) { switch result["identity"] { case identityUser: diff --git a/skills/lark-task/references/lark-task-create.md b/skills/lark-task/references/lark-task-create.md index e281a57b..7c946df4 100644 --- a/skills/lark-task/references/lark-task-create.md +++ b/skills/lark-task/references/lark-task-create.md @@ -44,7 +44,7 @@ lark-cli task +create --summary "Test Task" --dry-run ## Workflow 1. Confirm with the user: task summary, due date, assignee, and tasklist if necessary. - - **Crucial Rule for Assignee**: If the user explicitly or implicitly says "create a task for me" (给我创建一个任务), or "help me create a task" (帮我新建/创建一个任务), you MUST assign the task to the current logged-in user. You can get the current user's `open_id` by executing `lark-cli auth status` (it already outputs JSON by default, so do not add `--json`) or `lark-cli contact +get-user` first, extracting the `userOpenId` or `open_id`, and then passing it to the `--assignee` parameter. + - **Crucial Rule for Assignee**: If the user explicitly or implicitly says "create a task for me" (给我创建一个任务), or "help me create a task" (帮我新建/创建一个任务), you MUST assign the task to the current logged-in user. You can get the current user's `open_id` by executing `lark-cli auth status` (it already outputs JSON by default, so do not add `--json`) or `lark-cli contact +get-user` first, extracting `.identities.user.openId` (from `auth status`) or `.data.user.open_id` (from `contact +get-user`), and then passing it to the `--assignee` parameter. 2. Execute `lark-cli task +create --summary "..." ...` 3. Report the result: task ID and summary.