Skip to content

fix(mail): gate triage labels output behind flag - #2476

Open
bubbmon233 wants to merge 1 commit into
larksuite:mainfrom
bubbmon233:feat/b240cf7
Open

fix(mail): gate triage labels output behind flag#2476
bubbmon233 wants to merge 1 commit into
larksuite:mainfrom
bubbmon233:feat/b240cf7

Conversation

@bubbmon233

@bubbmon233 bubbmon233 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • omit labels from mail +triage structured output unless --labels is passed
  • preserve existing labels behavior when --labels is requested
  • keep search metadata batch_get gated by --labels and leave table labels column behavior unchanged

Tests

  • go test ./shortcuts/mail -run 'TestMailTriageStructuredOutputLabelsFollowFlag|TestMailTriageDryRunQueryWithLabelsAddsBatchGet|TestMailTriageDryRunListPathUsesMessagesAndBatchGet'

Summary by CodeRabbit

  • Bug Fixes
    • Structured mail triage output now omits message labels unless the labels option is enabled.
    • When requested, labels are consistently returned as text across list and search results.
    • Search results now include label metadata only when explicitly requested, improving response efficiency.

Co-authored-by: TRAE CLI <traecli@bytedance.com>
@github-actions github-actions Bot added domain/mail PR touches the mail domain size/M Single-domain feat or fix with limited business impact labels Aug 24, 2026
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 24efa45c-f8b3-4d8b-a6e8-1f5a524b2bdd

📥 Commits

Reviewing files that changed from the base of the PR and between 0679884 and ad47c2c.

📒 Files selected for processing (2)
  • shortcuts/mail/mail_triage.go
  • shortcuts/mail/mail_triage_test.go

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Mail triage structured output now conditionally includes labels and converts included labels to strings. Tests cover list and search paths, metadata batch requests, labeled fixtures, and request ordering.

Changes

Mail triage label handling

Layer / File(s) Summary
Structured output normalization
shortcuts/mail/mail_triage.go
Structured JSON and data output uses triageStructuredMessages. The helper omits labels unless requested and normalizes included labels to strings.
List and search label coverage
shortcuts/mail/mail_triage_test.go
Tests validate label omission, label preservation, conditional batch_get requests, labeled fixtures, and ordered message IDs in metadata requests.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to ad47c

The PR limits structured triage labels to requests that pass --labels while preserving existing requested-label behavior; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: liangshuo-1

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes gating triage label output behind the --labels flag.
Description check ✅ Passed The description clearly states the change and test command, but it omits the required Changes, Test Plan, and Related Issues sections.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add bubbmon233/cli#feat/b240cf7 -y -g

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