Skip to content

feat(mail): auto-append default signature in compose shortcuts#1282

Open
xzcong0820 wants to merge 3 commits into
larksuite:mainfrom
xzcong0820:harness/01KT8TVP9ZWD94Z6RFP17D29HN
Open

feat(mail): auto-append default signature in compose shortcuts#1282
xzcong0820 wants to merge 3 commits into
larksuite:mainfrom
xzcong0820:harness/01KT8TVP9ZWD94Z6RFP17D29HN

Conversation

@xzcong0820
Copy link
Copy Markdown
Collaborator

@xzcong0820 xzcong0820 commented Jun 5, 2026

Summary

  • Add --no-signature flag to 5 compose shortcuts (+send, +draft-create, +reply, +reply-all, +forward)
  • Add DefaultSendID / DefaultReplyID helpers in shortcuts/mail/signature/provider.go to resolve default signature from mailbox settings
  • Auto-fetch and append default signature when no explicit --signature-id is given and --plain-text is not set
  • Gracefully degrade (log warning, continue sending) if signature fetch fails
  • Update skills reference docs to document the new --no-signature flag

Behavior

Scenario Result
No flags Auto-resolve default signature via ListUserMailboxSignatures
--signature-id <id> Use specified signature (existing behavior)
--no-signature Skip all signatures
--no-signature + --signature-id Skip signatures, print warning
--plain-text Skip auto-resolve (silent), no signature
Signature API fails Log warning, send without signature

Changes

  • shortcuts/mail/signature_compose.go: add noSignatureFlag
  • shortcuts/mail/signature/provider.go: add DefaultSendID, DefaultReplyID, pickSignatureID
  • shortcuts/mail/mail_send.go: add flag + auto-resolve (DefaultSendID)
  • shortcuts/mail/mail_draft_create.go: add flag + auto-resolve (DefaultSendID)
  • shortcuts/mail/mail_reply.go: add flag + auto-resolve (DefaultReplyID)
  • shortcuts/mail/mail_reply_all.go: add flag + auto-resolve (DefaultReplyID)
  • shortcuts/mail/mail_forward.go: add flag + auto-resolve (DefaultReplyID)
  • skills/lark-mail/references/lark-mail-*.md: document --no-signature flag

🤖 Generated with Claude Code (harness-coding)

Summary by CodeRabbit

Release Notes

  • New Features

    • Added --body-file flag to read email body from a file (mutually exclusive with --body).
    • Added --no-signature flag to disable automatic signature insertion.
    • Added --show-lint-details flag to display email validation and formatting details.
  • Documentation

    • Updated mail skill references with critical preconditions requiring users to review HTML email writing standards before composing content.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 5, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR extends five mail compose shortcuts (draft-create, forward, reply, reply-all, send) with body-file support, no-signature control, and lint reporting. It modernizes error handling to use structured mail error types, adds default-signature selection helpers to the signature provider, and enhances signature image downloads with HTTPS enforcement and size limits. Skill documentation is updated to describe the new flags and HTML writing preconditions.

Changes

Mail compose shortcuts: body-file, no-signature, lint, and structured errors

Layer / File(s) Summary
Flag configuration and mutual-exclusion validation
shortcuts/mail/mail_draft_create.go, shortcuts/mail/mail_forward.go, shortcuts/mail/mail_reply.go, shortcuts/mail/mail_reply_all.go, shortcuts/mail/mail_send.go
Each mail compose shortcut now declares HasFormat: true, adds --body-file, --no-signature, and --show-lint-details flags, updates --body descriptions to document mutual exclusivity with --body-file, and wires mutual-exclusion validation into Validate.
Body resolution from flags and validation
shortcuts/mail/mail_draft_create.go, shortcuts/mail/mail_forward.go, shortcuts/mail/mail_reply.go, shortcuts/mail/mail_reply_all.go, shortcuts/mail/mail_send.go
Validation and execution now call resolveBodyFromFlags to handle both --body and --body-file inputs, replacing direct runtime.Str("body") calls. Required body validation uses the resolved content and respects template-supplied bodies, ensuring consistency across composition paths.
Signature provider with default-selection helpers
shortcuts/mail/signature/provider.go
Adds exported DefaultSendID and DefaultReplyID functions that compute default signature IDs for send vs. reply contexts. Implements shared pickSignatureID normalization logic and updates Get to return structured validation errors. Modernizes ListAll to use typed API calls and structured error constructors.
Signature control with --no-signature and default resolution
shortcuts/mail/mail_draft_create.go, shortcuts/mail/mail_forward.go, shortcuts/mail/mail_reply.go, shortcuts/mail/mail_reply_all.go, shortcuts/mail/mail_send.go
Adds --no-signature handling to suppress signature behavior (ignoring --signature-id with a warning). When signatures are enabled and no explicit ID is provided and plain-text mode is off, fetches and selects appropriate default signatures (send vs. reply) using the new provider helpers. Wraps fetch failures with warnings instead of blocking.
Write-path lint reporting and output decoration
shortcuts/mail/mail_draft_create.go, shortcuts/mail/mail_forward.go, shortcuts/mail/mail_reply.go, shortcuts/mail/mail_reply_all.go, shortcuts/mail/mail_send.go
Initializes lint envelopes (lintApplied, lintBlocked) early in composition, captures results from runWritePathLint after image resolution and signature injection, and applies them to draft/send output via applyLintToEnvelope when --show-lint-details is enabled. Adds compose hints to all final outputs.
Structured error types and decoration helpers
shortcuts/mail/mail_draft_create.go, shortcuts/mail/mail_forward.go, shortcuts/mail/mail_reply.go, shortcuts/mail/mail_reply_all.go, shortcuts/mail/mail_send.go, shortcuts/mail/signature_compose.go
Replaces raw fmt.Errorf, output.ErrValidation, and untyped errors with structured mail constructors: mailValidationError, mailValidationParamError, mailFailedPreconditionError, and mailDecorateProblemMessage. Wraps underlying causes and provides parameter metadata for validation failures.
EML building with lint slices and structured errors
shortcuts/mail/mail_draft_create.go
Updates buildRawEMLForDraftCreate to return non-nil lint finding slices alongside the raw base64url EML. Wraps local image path resolution failures with mail validation errors and propagates lint slices through all error returns. Runs write-path lint after template/signature/image resolution to collect both applied and blocked findings, then stores results for output decoration.
Import cleanup for error and signature packages
shortcuts/mail/mail_draft_create.go, shortcuts/mail/mail_forward.go, shortcuts/mail/mail_reply.go, shortcuts/mail/mail_reply_all.go, shortcuts/mail/mail_send.go, shortcuts/mail/signature_compose.go
Removes internal output package usage from mail compose files. Adds github.com/larksuite/cli/errs for structured error constructors and github.com/larksuite/cli/shortcuts/mail/signature for default-selection helpers.

Signature image download robustness and error handling

Layer / File(s) Summary
Signature image download with HTTPS, timeout, and size limits
shortcuts/mail/signature_compose.go
Rewrites downloadSignatureImage to enforce HTTPS and host presence with structured invalid-response errors, uses SDK HTTP client with context timeouts, performs GET without authorization headers, categorizes HTTP errors into retryable server/network vs. permanent not-found vs. other API errors, and enforces a 10MB maximum download size.
Typed API calls and validation error modernization
shortcuts/mail/signature_compose.go
Updates resolveSenderInfo to use runtime.CallAPITyped for typed API interaction. Replaces plain formatted validation errors for mutually exclusive --plain-text and --signature-id with structured mailValidationError that includes invalid parameter metadata via WithParams.

Skill documentation: preconditions, body-file, and no-signature

Layer / File(s) Summary
Mail skill reference documentation updates
skills/lark-mail/references/lark-mail-draft-create.md, skills/lark-mail/references/lark-mail-forward.md, skills/lark-mail/references/lark-mail-reply.md, skills/lark-mail/references/lark-mail-reply-all.md, skills/lark-mail/references/lark-mail-send.md
Adds CRITICAL workflow preconditions requiring users to read the HTML writing rules (references/lark-mail-html.md) before editing email content. Updates --body parameter documentation to reflect mutual exclusivity with new --body-file option (making them "choose one" with 32MB file size limit). Documents new --no-signature option that prevents signature appending and overrides automatic default behavior.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • larksuite/cli#1019: Introduces the same resolveBodyFromFlags and runWritePathLint/applyLintToEnvelope lint plumbing infrastructure that this PR builds upon, with this PR extending it to signature and error-handling wiring.

  • larksuite/cli#1250: Introduces the structured mail error constructors (mailValidationError, mailDecorateProblemMessage) and error-handling patterns that this PR adopts across all mail compose shortcuts.

  • larksuite/cli#642: Modifies similar validation/execution patterns in the same mail shortcuts (mail_draft_create, mail_reply, mail_send) for subject/body resolution and template-based content handling.

Suggested labels

domain/mail, feature, size/L

Suggested reviewers

  • chanthuang
  • infeng

Poem

🐰 Hops through mail compose with glee,
Body files and signatures free,
Lint lint lint, no-signature shout,
Draft and forward sorted out! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding automatic default signature functionality to mail compose shortcuts.
Description check ✅ Passed The description provides a comprehensive summary with behavior table, detailed changes list, and implementation details, covering all required template sections.
Docstring Coverage ✅ Passed Docstring coverage is 90.91% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch harness/01KT8TVP9ZWD94Z6RFP17D29HN

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added domain/mail PR touches the mail domain size/L Large or sensitive change across domains or core paths labels Jun 5, 2026
- Add --no-signature flag to 5 compose shortcuts (+send, +draft-create, +reply, +reply-all, +forward)
- Add DefaultSendID/DefaultReplyID helpers in shortcuts/mail/signature/provider.go
- Auto-fetch and append default signature when no explicit --signature-id is given
- Gracefully degrade (log warning, continue sending) if signature fetch fails
- Update skills reference docs to document the new --no-signature flag
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
shortcuts/mail/mail_reply_all.go (1)

99-100: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

--no-signature override is blocked by earlier validation.

On Line 99, validation still rejects --plain-text + --signature-id before the Line 139-145 override can clear signature-id. This breaks the new --no-signature + --signature-id “warn and continue” behavior.

Suggested fix
-		if err := validateSignatureWithPlainText(runtime.Bool("plain-text"), runtime.Str("signature-id")); err != nil {
-			return err
-		}
+		if !runtime.Bool("no-signature") {
+			if err := validateSignatureWithPlainText(runtime.Bool("plain-text"), runtime.Str("signature-id")); err != nil {
+				return err
+			}
+		}

Also applies to: 138-145

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@shortcuts/mail/mail_reply_all.go` around lines 99 - 100, The current call to
validateSignatureWithPlainText(runtime.Bool("plain-text"),
runtime.Str("signature-id")) runs before the later override logic that clears
signature-id for the --no-signature flow, causing --no-signature +
--signature-id to be rejected; move the validation to after the block that
handles and potentially clears signature-id (the override in the region around
lines 139-145) or alter the validation to early-bail when
runtime.Bool("no-signature") is true so that validateSignatureWithPlainText is
not applied when --no-signature is intended to override signature-id.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@shortcuts/mail/signature/provider.go`:
- Around line 73-76: Update the docstring to match the actual behavior: state
that DefaultSendID (and the helper pickSignatureID) return an empty string when
no address matches or when no default is configured, and do not fall back to
usages[0]; remove the incorrect "Falls back to usages[0]" line and describe the
actual fallback semantics (return usages[0] only when configured, otherwise "").
Mention the functions DefaultSendID and pickSignatureID by name so reviewers can
find the updated comment.

In `@skills/lark-mail/references/lark-mail-draft-create.md`:
- Line 11: The markdown link in the precondition text currently points to
"references/lark-mail-html.md" (one directory too deep); update the link target
to the same-directory relative path "lark-mail-html.md" so the precondition
"Read 工具读取 lark-mail-html.md" becomes clickable—edit the markdown link in the
precondition line that references lark-mail-html.md to replace
"references/lark-mail-html.md" with "lark-mail-html.md".

In `@skills/lark-mail/references/lark-mail-forward.md`:
- Line 16: The markdown link "references/lark-mail-html.md" in the sentence
"**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取
[references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**" is a
broken relative path; update the link target to "./lark-mail-html.md" so it
correctly points to lark-mail-html.md in the same references directory (replace
the reference string "references/lark-mail-html.md" with "./lark-mail-html.md").

In `@skills/lark-mail/references/lark-mail-reply-all.md`:
- Line 16: Replace the broken relative link text "references/lark-mail-html.md"
in the document with the correct relative path "./lark-mail-html.md" so the
reference to lark-mail-html.md resolves correctly; locate the occurrence of the
string "references/lark-mail-html.md" (shown in the diff) and update it to
"./lark-mail-html.md".

In `@skills/lark-mail/references/lark-mail-reply.md`:
- Line 20: Update the broken relative link in the markdown line that references
"references/lark-mail-html.md": replace that path with "./lark-mail-html.md" so
the link resolves correctly from the current directory (modify the link text
that currently points to references/lark-mail-html.md).

In `@skills/lark-mail/references/lark-mail-send.md`:
- Line 15: The relative link to the HTML reference is incorrect; update the link
target in the markdown text that currently points to
"references/lark-mail-html.md" so it correctly references the sibling file as
"./lark-mail-html.md" (look for the link text or filename "lark-mail-html.md" in
the content of skills/lark-mail/references/lark-mail-send.md and replace the
extra "references/" segment with "./").

---

Outside diff comments:
In `@shortcuts/mail/mail_reply_all.go`:
- Around line 99-100: The current call to
validateSignatureWithPlainText(runtime.Bool("plain-text"),
runtime.Str("signature-id")) runs before the later override logic that clears
signature-id for the --no-signature flow, causing --no-signature +
--signature-id to be rejected; move the validation to after the block that
handles and potentially clears signature-id (the override in the region around
lines 139-145) or alter the validation to early-bail when
runtime.Bool("no-signature") is true so that validateSignatureWithPlainText is
not applied when --no-signature is intended to override signature-id.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ee0838fb-d0c9-4fd7-b9d5-bcfbd37b3973

📥 Commits

Reviewing files that changed from the base of the PR and between 3990151 and d5354e5.

📒 Files selected for processing (12)
  • shortcuts/mail/mail_draft_create.go
  • shortcuts/mail/mail_forward.go
  • shortcuts/mail/mail_reply.go
  • shortcuts/mail/mail_reply_all.go
  • shortcuts/mail/mail_send.go
  • shortcuts/mail/signature/provider.go
  • shortcuts/mail/signature_compose.go
  • skills/lark-mail/references/lark-mail-draft-create.md
  • skills/lark-mail/references/lark-mail-forward.md
  • skills/lark-mail/references/lark-mail-reply-all.md
  • skills/lark-mail/references/lark-mail-reply.md
  • skills/lark-mail/references/lark-mail-send.md

Comment on lines +73 to +76
// DefaultSendID returns the send_mail_signature_id for the given addr.
// Falls back to usages[0] if no entry matches, but returns "" when
// no default is configured (id empty or "0").
// Returns "" if usages is empty.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Docstring claims fallback to usages[0] but implementation returns "".

The docstring states "Falls back to usages[0] if no entry matches" but pickSignatureID returns "" when no address matches (line 106). The implementation appears correct based on caller expectations; the docstring should be updated.

📝 Suggested docstring fix
 // DefaultSendID returns the send_mail_signature_id for the given addr.
-// Falls back to usages[0] if no entry matches, but returns "" when
-// no default is configured (id empty or "0").
+// Returns "" when no entry matches or no default is configured
+// (id empty or "0").
 // Returns "" if usages is empty.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// DefaultSendID returns the send_mail_signature_id for the given addr.
// Falls back to usages[0] if no entry matches, but returns "" when
// no default is configured (id empty or "0").
// Returns "" if usages is empty.
// DefaultSendID returns the send_mail_signature_id for the given addr.
// Returns "" when no entry matches or no default is configured
// (id empty or "0").
// Returns "" if usages is empty.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@shortcuts/mail/signature/provider.go` around lines 73 - 76, Update the
docstring to match the actual behavior: state that DefaultSendID (and the helper
pickSignatureID) return an empty string when no address matches or when no
default is configured, and do not fall back to usages[0]; remove the incorrect
"Falls back to usages[0]" line and describe the actual fallback semantics
(return usages[0] only when configured, otherwise ""). Mention the functions
DefaultSendID and pickSignatureID by name so reviewers can find the updated
comment.


如需修改已有草稿,不要使用此命令,请使用 `lark-cli mail +draft-edit`。

**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix broken relative link to lark-mail-html.md.

On Line 11, the link target uses references/lark-mail-html.md, which is nested one level too deep from this file’s location. Use a same-directory relative path so the precondition is clickable.

Suggested fix
-**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
+**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](./lark-mail-html.md),其中包含邮件书写规范**
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](./lark-mail-html.md),其中包含邮件书写规范**
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/lark-mail/references/lark-mail-draft-create.md` at line 11, The
markdown link in the precondition text currently points to
"references/lark-mail-html.md" (one directory too deep); update the link target
to the same-directory relative path "lark-mail-html.md" so the precondition
"Read 工具读取 lark-mail-html.md" becomes clickable—edit the markdown link in the
precondition line that references lark-mail-html.md to replace
"references/lark-mail-html.md" with "lark-mail-html.md".


## CRITICAL — 发送工作流(必须遵循)

**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix broken relative link to lark-mail-html.md.

On Line 16, references/lark-mail-html.md points to a nested path from this file location. Switch to ./lark-mail-html.md.

Suggested fix
-**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
+**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](./lark-mail-html.md),其中包含邮件书写规范**
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](./lark-mail-html.md),其中包含邮件书写规范**
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/lark-mail/references/lark-mail-forward.md` at line 16, The markdown
link "references/lark-mail-html.md" in the sentence "**CRITICAL - 编辑邮件内容前 MUST
先用 Read 工具读取
[references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**" is a
broken relative path; update the link target to "./lark-mail-html.md" so it
correctly points to lark-mail-html.md in the same references directory (replace
the reference string "references/lark-mail-html.md" with "./lark-mail-html.md").


## CRITICAL — 发送工作流(必须遵循)

**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix broken relative link to lark-mail-html.md.

On Line 16, the link is currently references/lark-mail-html.md, which is incorrect relative to this file. Use ./lark-mail-html.md.

Suggested fix
-**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
+**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](./lark-mail-html.md),其中包含邮件书写规范**
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](./lark-mail-html.md),其中包含邮件书写规范**
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/lark-mail/references/lark-mail-reply-all.md` at line 16, Replace the
broken relative link text "references/lark-mail-html.md" in the document with
the correct relative path "./lark-mail-html.md" so the reference to
lark-mail-html.md resolves correctly; locate the occurrence of the string
"references/lark-mail-html.md" (shown in the diff) and update it to
"./lark-mail-html.md".


## CRITICAL — 发送工作流(必须遵循)

**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix broken relative link to lark-mail-html.md.

On Line 20, references/lark-mail-html.md resolves incorrectly from this directory. Please use ./lark-mail-html.md.

Suggested fix
-**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
+**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](./lark-mail-html.md),其中包含邮件书写规范**
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](./lark-mail-html.md),其中包含邮件书写规范**
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/lark-mail/references/lark-mail-reply.md` at line 20, Update the broken
relative link in the markdown line that references
"references/lark-mail-html.md": replace that path with "./lark-mail-html.md" so
the link resolves correctly from the current directory (modify the link text
that currently points to references/lark-mail-html.md).


## CRITICAL — 发送工作流(必须遵循)

**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix broken relative link to lark-mail-html.md.

On Line 15, the relative link includes an extra references/ segment for this file location. Update it to ./lark-mail-html.md.

Suggested fix
-**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
+**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](./lark-mail-html.md),其中包含邮件书写规范**
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](references/lark-mail-html.md),其中包含邮件书写规范**
**CRITICAL - 编辑邮件内容前 MUST 先用 Read 工具读取 [references/lark-mail-html.md](./lark-mail-html.md),其中包含邮件书写规范**
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/lark-mail/references/lark-mail-send.md` at line 15, The relative link
to the HTML reference is incorrect; update the link target in the markdown text
that currently points to "references/lark-mail-html.md" so it correctly
references the sibling file as "./lark-mail-html.md" (look for the link text or
filename "lark-mail-html.md" in the content of
skills/lark-mail/references/lark-mail-send.md and replace the extra
"references/" segment with "./").

The PR branch was missing errs/ (introduced in fe72e41) and
shortcuts/mail/lint/ packages that are referenced by:
- shortcuts/mail/mail_forward.go
- shortcuts/mail/signature_compose.go
- shortcuts/mail/signature/provider.go
- shortcuts/mail/mail_draft_create.go

Merging main fixes the missing-package compile errors and aligns the
branch with the full upstream feature set including the HTML lint library,
draft sending, and typed error envelopes.

Merge conflicts in mail_draft_create.go and signature/provider.go were
resolved by keeping the PR branch's --no-signature flag implementation
and DefaultSendID/DefaultReplyID helper functions which are part of the
PR's feature work.

sprint: S2
@github-actions github-actions Bot added size/M Single-domain feat or fix with limited business impact and removed size/L Large or sensitive change across domains or core paths labels Jun 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@cfdfacf8c2b1f7a4692694acca03ff7d071c45e3

🧩 Skill update

npx skills add xzcong0820/larksuite-cli#harness/01KT8TVP9ZWD94Z6RFP17D29HN -y -g

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

❌ Patch coverage is 28.04878% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.27%. Comparing base (3990151) to head (cfdfacf).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/mail/signature/provider.go 0.00% 19 Missing ⚠️
shortcuts/mail/mail_draft_create.go 46.66% 5 Missing and 3 partials ⚠️
shortcuts/mail/mail_forward.go 33.33% 5 Missing and 3 partials ⚠️
shortcuts/mail/mail_reply.go 33.33% 5 Missing and 3 partials ⚠️
shortcuts/mail/mail_reply_all.go 33.33% 5 Missing and 3 partials ⚠️
shortcuts/mail/mail_send.go 33.33% 5 Missing and 3 partials ⚠️

❌ Your patch check has failed because the patch coverage (28.04%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1282      +/-   ##
==========================================
+ Coverage   70.17%   70.27%   +0.10%     
==========================================
  Files         671      672       +1     
  Lines       65329    65403      +74     
==========================================
+ Hits        45843    45963     +120     
+ Misses      15796    15772      -24     
+ Partials     3690     3668      -22     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/mail PR touches the mail domain size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant