Skip to content

feat: add framework flag aliases and unified IM pagination - #2146

Merged
sang-neo03 merged 6 commits into
mainfrom
feat/framework-flag-aliases
Aug 3, 2026
Merged

feat: add framework flag aliases and unified IM pagination#2146
sang-neo03 merged 6 commits into
mainfrom
feat/framework-flag-aliases

Conversation

@liangshuo-1

@liangshuo-1 liangshuo-1 commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add framework-level exact flag aliases and a shared, format-aware pagination pipeline for IM list commands. Semantic conversions remain business-owned.

Changes

  • Add declarative aliases with native occurrence semantics, source-aware validation, schema/manifest metadata, and lint ownership.
  • Add shared --page-all, --page-limit, and --page-delay handling to supported IM list commands.
  • Aggregate pages before enrichment and filtering, then emit format-appropriate pagination metadata.
  • Bound page walks, detect repeated cursors, preserve resume tokens, honor cancellation, and delay between requests.
  • Update domain compatibility declarations, references, and tests.

Behavior changes

  • Canonical names remain the documented identity; scalar aliases share one flag and the last occurrence wins.
  • Supported IM list commands expose pagination metadata for one-page and multi-page runs. --page-token sets the start cursor; --page-all continues from it.
  • Pagination controls and page sizes are validated when supplied instead of silently falling back.
  • Unknown output formats fall back to the standard JSON envelope.

Test Plan

  • make unit-test
  • go vet ./...
  • gofmt -l . produces no output
  • go mod tidy leaves go.mod and go.sum unchanged
  • golangci-lint v2.1.6 run --new-from-rev=origin/main reports 0 issues
  • make build
  • Targeted dry-run E2E coverage passes for Base, IM, Mail, and Sheets alias/pagination flows
  • Manual local IM verification covers multi-page, limit/resume, filter, and JSON/table/CSV/NDJSON output paths

Related Issues

Summary by CodeRabbit

  • New Features
    • Added consistent command-line aliases for pagination, sorting, tokens, and identifiers.
    • Added automatic multi-page retrieval with configurable limits, delays, resume tokens, and progress metadata.
    • Added pagination status reporting across supported output formats.
  • Bug Fixes
    • Improved validation errors with entered flag names and canonical alternatives.
    • Prevented repeated pagination cursors and batched large mute-status requests.
  • Documentation
    • Updated guidance for aliases, pagination, sorting, resume tokens, and output behavior.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change adds declarative flag aliases, shared shortcut normalization, automatic IM pagination, pagination-aware output metadata, manifest alias support, and flag-contract linting. It updates shortcut implementations, tests, and documentation.

Changes

Flag aliases and contracts

Layer / File(s) Summary
Alias binding and normalization
internal/flagalias/*, shortcuts/common/*
Flags resolve to canonical definitions. Binding validates collisions and preserves repeated-flag and source-spelling behavior. Validation errors retain caller-facing alias names.
Manifest and lint integration
internal/qualitygate/..., lint/...
Manifests export aliases as canonical metadata. Validation rejects alias conflicts. The lint domain rejects unauthorized normalizer ownership.

Pagination and output

Layer / File(s) Summary
Shared pagination
shortcuts/common/*, shortcuts/im/*
IM list commands support page limits, delays, cursor continuation, typed page merging, filtering after aggregation, and pagination metadata.
Output metadata
internal/output/*
JSON uses envelopes. Pretty and table formats render summaries. CSV and NDJSON emit structured diagnostics. Nested typed slices are expanded into records.

Shortcut migrations

Layer / File(s) Summary
Canonical shortcut aliases
shortcuts/base/*, shortcuts/mail/*, shortcuts/sheets/*, shortcuts/slides/*
Legacy flags become aliases on canonical flags. Shortcut code reads canonical runtime values.
Compatibility and end-to-end validation
shortcuts/*/*_test.go, tests/cli_e2e/*, skills/*
Tests and documentation cover alias precedence, normalization, pagination, output formats, cursor continuation, batching, and validation messages.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: feature

Suggested reviewers: yxzhaao

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.19% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the two primary changes: framework flag aliases and unified IM pagination.
Description check ✅ Passed The description covers the required summary, changes, test plan, and related issues sections with specific implementation and verification details.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/framework-flag-aliases

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 github-actions Bot added domain/base PR touches the base domain domain/ccm PR touches the ccm domain domain/im PR touches the im domain domain/mail PR touches the mail domain size/XL Architecture-level or global-impact change labels Aug 2, 2026
Introduce declarative exact-name flag aliases at the shortcut framework boundary while keeping semantic compatibility domain-owned. Add a shared, format-aware IM pagination pipeline with consistent flags, metadata, safety bounds, resumable cursors, and request throttling.
@liangshuo-1
liangshuo-1 force-pushed the feat/framework-flag-aliases branch from a435d6f to e32d7cb Compare August 2, 2026 19:50
@liangshuo-1 liangshuo-1 changed the title refactor: unify shortcut aliases and IM pagination feat: add framework flag aliases and unified IM pagination Aug 2, 2026
@liangshuo-1
liangshuo-1 changed the base branch from feat/agent-affordance-fixes to main August 2, 2026 19:51
@liangshuo-1
liangshuo-1 marked this pull request as ready for review August 2, 2026 19:51
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/framework-flag-aliases -y -g

@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.47642% with 191 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.65%. Comparing base (40a0a9d) to head (a33b091).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/flagalias/flagalias.go 66.41% 29 Missing and 16 partials ⚠️
shortcuts/common/paginate_into.go 72.86% 26 Missing and 9 partials ⚠️
shortcuts/common/flag_context.go 56.09% 15 Missing and 3 partials ⚠️
shortcuts/common/page_all_flags.go 66.03% 13 Missing and 5 partials ⚠️
internal/output/emitter.go 72.34% 9 Missing and 4 partials ⚠️
shortcuts/common/flag_error_attribution.go 66.66% 6 Missing and 6 partials ⚠️
internal/qualitygate/manifest/schema.go 60.00% 5 Missing and 5 partials ⚠️
shortcuts/im/mute_filter.go 71.42% 6 Missing and 2 partials ⚠️
shortcuts/im/im_threads_messages_list.go 79.41% 4 Missing and 3 partials ⚠️
shortcuts/common/runner.go 61.53% 3 Missing and 2 partials ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2146      +/-   ##
==========================================
+ Coverage   75.57%   75.65%   +0.08%     
==========================================
  Files         931      940       +9     
  Lines       99162    99876     +714     
==========================================
+ Hits        74937    75564     +627     
- Misses      18501    18530      +29     
- Partials     5724     5782      +58     

☔ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🧹 Nitpick comments (3)
lint/flagcontract/scan.go (1)

65-71: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

The alias-flag rule is a fail-open heuristic. Consider documenting the limits.

Three conditions must all hold for a violation to fire, and each one under-matches:

  • aliasDescription matches three fixed phrases. A Desc such as "deprecated name for --order" or "accepts the old spelling of --order" is not detected.
  • Line 120 recognizes only the bare identifier true. Hidden: isHidden or Hidden: someConst is not detected.
  • hiddenFlagLiteral inspects any composite literal that has Name, Desc, and Hidden keys. It does not confirm the literal is a common.Flag. The fixture at lint/flagcontract/scan_test.go lines 16-19 uses an anonymous struct and still triggers the rule.

Fail-open is a defensible choice for a new lint domain. The concern is the description in lint/README.md lines 46-48, which states the guard "rejects ... independent hidden flags described as aliases" without qualification. A maintainer may treat the lint as an authoritative gate when it is a best-effort signal.

Either narrow the literal check to common.Flag using type information, as the sibling domaincontract package does, or state the heuristic nature in the README.

Also applies to: 103-140

🤖 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 `@lint/flagcontract/scan.go` around lines 65 - 71, Update the flag-contract
lint documentation in lint/README.md to describe the alias-flag check as a
best-effort heuristic rather than an authoritative rejection, noting that it may
miss alternate alias descriptions or hidden-value expressions and may match
structurally similar non-common.Flag literals. Keep the existing detection
behavior unchanged.
shortcuts/im/im_chat_search.go (1)

322-333: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use the named constant instead of the literal default.

params["page_size"] = 20 duplicates chatSearchDefaultPageSize (already used for the flag default and validation bound). Using the literal risks drift if the default ever changes.

♻️ Proposed fix
 	if n := runtime.Int("page-size"); n > 0 {
 		params["page_size"] = n
 	} else {
-		params["page_size"] = 20
+		params["page_size"] = chatSearchDefaultPageSize
 	}
🤖 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/im/im_chat_search.go` around lines 322 - 333, Replace the literal
fallback value in buildSearchChatParams with the existing
chatSearchDefaultPageSize constant, while preserving the current handling of
positive page-size values and page tokens.
shortcuts/im/im_chat_messages_list.go (1)

121-124: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Page size is validated twice on the execute path.

Execute validates page size at Line 122. buildChatMessageListRequest at Line 129 runs the same ValidatePageSizeTyped call at Line 242 and returns the same typed --page-size error. Remove the Line 122 call to keep one validation site.

♻️ Proposed cleanup
 	Execute: func(ctx context.Context, runtime *common.RuntimeContext) error {
-		if _, err := common.ValidatePageSizeTyped(runtime, "page-size", chatMessagesListDefaultPageSize, 1, chatMessagesListMaxPageSize); err != nil {
-			return err
-		}
 		chatId, err := resolveChatIDForMessagesList(runtime, false)
🤖 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/im/im_chat_messages_list.go` around lines 121 - 124, Remove the
redundant ValidatePageSizeTyped call from the Execute function and let
buildChatMessageListRequest remain the single page-size validation site,
preserving its existing typed --page-size error handling.
🤖 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/common/paginate_into.go`:
- Around line 105-115: In the pagination flow around the maxPages check, return
successfully when pageNumber reaches policy.maxPages before validating
nextPageToken against seen. Keep requiring a non-empty token when another
request is allowed, and update the affected paginate_into tests to expect echoed
cursors to succeed for single-page reads.

In `@shortcuts/common/runner_normalize_test.go`:
- Line 121: Remove the ineffective normalizeCalled flag and its assertion from
the test, since the current flow never invokes Normalize through runShortcut.
Keep the direct contract assertions around ParseFlags and ValidateRequiredFlags
unchanged, or update the test to exercise runShortcut if ordering coverage is
required.
- Around line 38-40: Update the shortcut test setup around newTestFactory and
newTestShortcutCmd to use cmdutil.TestFactory(t, config) instead of constructing
an empty factory directly. Set LARKSUITE_CLI_CONFIG_DIR to t.TempDir() with
t.Setenv before creating the factory, while preserving the existing input stream
and command setup.
- Around line 79-81: Update the error assertion around runShortcut in the
normalization failure test to inspect errs.ProblemOf rather than only checking
for a non-nil error. Assert the expected category, subtype, and param values,
and verify the original cause is preserved, following the existing
typed-metadata assertions in this file’s test around lines 108-114.

In `@shortcuts/im/sort_flags.go`:
- Around line 58-67: Update the legacy-flag handling around flags.Str and
SetCanonicalFrom so an explicitly provided empty legacy value is not propagated
to the canonical flag. Validate it like other unrecognized values and attribute
the error to the legacy flag, or leave the canonical default unchanged; then
update the corresponding test case in sort_flags_test.go to reflect the
corrected behavior.

In `@skills/lark-im/SKILL.md`:
- Around line 109-117: Escape the literal pipe in the “asc|desc” text within the
+chat-messages-list and +threads-messages-list table entries so Markdown treats
it as cell content and preserves the intended table structure.

In `@tests/cli_e2e/base/base_limit_dryrun_test.go`:
- Around line 90-101: Strengthen
TestBaseListDryRunValidatesPageSizeAliasAsCanonicalLimit by asserting the
complete validation error contract: verify error.type is "validation",
error.subtype is "invalid_argument", and stdout is empty, while preserving the
existing error.param and message assertions.

In `@tests/cli_e2e/mail/mail_triage_dryrun_test.go`:
- Around line 45-70: Add a self-contained live E2E test alongside
TestMail_TriageDryRunUsesPageSizeAsExactMaxAlias that executes mail +triage with
the relevant --page-size/--max alias combinations against the configured test
mailbox, rather than inspecting dry-run request parameters. Assert the command
succeeds and verify the resulting triage behavior reflects the alias precedence
and exact page-size/max semantics.
- Around line 53-55: Update the test cases around the mail triage dry-run flag
parsing to preserve canonical --max precedence: when both --max and its
--page-size alias are supplied, expect the --max value regardless of argument
order. Change the “alias last” case to expect 7 while keeping the single-flag
and “canonical last” cases aligned with this behavior.

---

Nitpick comments:
In `@lint/flagcontract/scan.go`:
- Around line 65-71: Update the flag-contract lint documentation in
lint/README.md to describe the alias-flag check as a best-effort heuristic
rather than an authoritative rejection, noting that it may miss alternate alias
descriptions or hidden-value expressions and may match structurally similar
non-common.Flag literals. Keep the existing detection behavior unchanged.

In `@shortcuts/im/im_chat_messages_list.go`:
- Around line 121-124: Remove the redundant ValidatePageSizeTyped call from the
Execute function and let buildChatMessageListRequest remain the single page-size
validation site, preserving its existing typed --page-size error handling.

In `@shortcuts/im/im_chat_search.go`:
- Around line 322-333: Replace the literal fallback value in
buildSearchChatParams with the existing chatSearchDefaultPageSize constant,
while preserving the current handling of positive page-size values and page
tokens.
🪄 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 Plus

Run ID: a60d2b20-14e8-4749-b43d-ebb464649ed7

📥 Commits

Reviewing files that changed from the base of the PR and between 40a0a9d and e32d7cb.

📒 Files selected for processing (102)
  • internal/flagalias/flagalias.go
  • internal/flagalias/flagalias_test.go
  • internal/output/emit.go
  • internal/output/emitter.go
  • internal/output/emitter_contract_test.go
  • internal/output/emitter_legacy_compat_test.go
  • internal/output/envelope.go
  • internal/output/testdata/runtime_context_legacy.golden.json
  • internal/qualitygate/cmd/manifest-export/collect.go
  • internal/qualitygate/cmd/manifest-export/collect_alias_test.go
  • internal/qualitygate/cmd/manifest-export/main_test.go
  • internal/qualitygate/manifest/io_test.go
  • internal/qualitygate/manifest/schema.go
  • internal/qualitygate/rules/dryrun.go
  • internal/qualitygate/rules/refs.go
  • internal/qualitygate/rules/refs_test.go
  • lint/README.md
  • lint/flagcontract/scan.go
  • lint/flagcontract/scan_test.go
  • lint/main.go
  • shortcuts/base/base_dryrun_ops_test.go
  • shortcuts/base/base_execute_test.go
  • shortcuts/base/base_resolve.go
  • shortcuts/base/base_resolve_test.go
  • shortcuts/base/base_shortcut_helpers.go
  • shortcuts/base/base_shortcuts_test.go
  • shortcuts/base/field_list.go
  • shortcuts/base/field_ops.go
  • shortcuts/base/field_search_options.go
  • shortcuts/base/record_list.go
  • shortcuts/base/record_ops.go
  • shortcuts/base/record_query.go
  • shortcuts/base/record_search.go
  • shortcuts/base/table_list.go
  • shortcuts/base/table_ops.go
  • shortcuts/base/view_list.go
  • shortcuts/base/view_ops.go
  • shortcuts/common/flag_aliases.go
  • shortcuts/common/flag_context.go
  • shortcuts/common/page_all_flags.go
  • shortcuts/common/paginate_into.go
  • shortcuts/common/paginate_into_test.go
  • shortcuts/common/runner.go
  • shortcuts/common/runner_flag_alias_test.go
  • shortcuts/common/runner_normalize_test.go
  • shortcuts/common/types.go
  • shortcuts/im/builders_test.go
  • shortcuts/im/coverage_additional_test.go
  • shortcuts/im/helpers.go
  • shortcuts/im/im_chat_list.go
  • shortcuts/im/im_chat_list_test.go
  • shortcuts/im/im_chat_members_list.go
  • shortcuts/im/im_chat_messages_list.go
  • shortcuts/im/im_chat_messages_list_test.go
  • shortcuts/im/im_chat_search.go
  • shortcuts/im/im_chat_search_test.go
  • shortcuts/im/im_feed_group_item_test.go
  • shortcuts/im/im_feed_group_list.go
  • shortcuts/im/im_feed_group_list_item.go
  • shortcuts/im/im_flag_aliases_test.go
  • shortcuts/im/im_flag_list.go
  • shortcuts/im/im_list_page_all_test.go
  • shortcuts/im/im_list_pagination.go
  • shortcuts/im/im_messages_mget.go
  • shortcuts/im/im_messages_search.go
  • shortcuts/im/im_page_size_validation_test.go
  • shortcuts/im/im_search_notice_test.go
  • shortcuts/im/im_threads_messages_list.go
  • shortcuts/im/im_threads_messages_list_test.go
  • shortcuts/im/mute_filter.go
  • shortcuts/im/mute_filter_test.go
  • shortcuts/im/sort_flags.go
  • shortcuts/im/sort_flags_test.go
  • shortcuts/im/with_sender_name_test.go
  • shortcuts/mail/mail_triage.go
  • shortcuts/mail/mail_triage_test.go
  • shortcuts/sheets/flag_ergonomics.go
  • shortcuts/sheets/lark_sheet_history_list.go
  • shortcuts/sheets/shortcuts.go
  • shortcuts/sheets/shortcuts_alias_test.go
  • shortcuts/slides/presentation_flag.go
  • shortcuts/slides/shortcuts.go
  • shortcuts/slides/shortcuts_alias_test.go
  • shortcuts/slides/slides_history.go
  • shortcuts/slides/slides_media_upload.go
  • shortcuts/slides/slides_replace_pages.go
  • shortcuts/slides/slides_replace_slide.go
  • shortcuts/slides/slides_screenshot.go
  • shortcuts/slides/slides_xml_get.go
  • skills/lark-im/SKILL.md
  • skills/lark-im/references/lark-im-chat-list.md
  • skills/lark-im/references/lark-im-chat-members-list.md
  • skills/lark-im/references/lark-im-chat-messages-list.md
  • skills/lark-im/references/lark-im-chat-search.md
  • skills/lark-im/references/lark-im-feed-shortcut-list.md
  • skills/lark-im/references/lark-im-threads-messages-list.md
  • tests/cli_e2e/base/base_limit_dryrun_test.go
  • tests/cli_e2e/im/im_flag_aliases_dryrun_test.go
  • tests/cli_e2e/im/im_list_page_all_dryrun_test.go
  • tests/cli_e2e/im/im_page_all_live_test.go
  • tests/cli_e2e/mail/mail_triage_dryrun_test.go
  • tests/cli_e2e/sheets/sheets_token_alias_dryrun_test.go
💤 Files with no reviewable changes (3)
  • shortcuts/base/base_shortcut_helpers.go
  • shortcuts/base/base_dryrun_ops_test.go
  • internal/output/testdata/runtime_context_legacy.golden.json

Comment thread shortcuts/common/paginate_into.go
Comment thread shortcuts/common/runner_normalize_test.go
Comment thread shortcuts/common/runner_normalize_test.go
Comment thread shortcuts/common/runner_normalize_test.go
Comment thread shortcuts/im/sort_flags.go
Comment thread skills/lark-im/SKILL.md Outdated
Comment thread tests/cli_e2e/base/base_limit_dryrun_test.go Outdated
Comment thread tests/cli_e2e/mail/mail_triage_dryrun_test.go
Comment thread tests/cli_e2e/mail/mail_triage_dryrun_test.go
@fangshuyu-768 fangshuyu-768 removed the domain/ccm PR touches the ccm domain label Aug 3, 2026
@github-actions github-actions Bot added the domain/ccm PR touches the ccm domain label Aug 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 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 `@cmd/root.go`:
- Around line 606-614: The flagDidYouMean validation error must preserve the
original parse error and verify its typed metadata. In cmd/root.go lines
606-614, attach ferr as the cause when constructing validationErr. In
cmd/flag_suggest_test.go lines 129-140, assert category and subtype via
errs.ProblemOf, extract *errs.ValidationError with errors.As to verify Param,
and assert the returned error preserves parseErr as its cause.

In `@lint/flagcontract/scan_test.go`:
- Around line 32-37: Extend the assertions in the test around the existing
got[0].Rule check to verify that got[0].File equals "shortcuts/demo/demo.go".
Keep the current violation-count and rule assertions, and directly validate the
expected source file for the reported violation.

In `@shortcuts/mail/flag_suggest.go`:
- Around line 57-65: Update the fallback path in the SetFlagErrorFunc callback
to handle a nil result from svc.FlagErrorFunc(). After the
parseUnknownToken/flagSuggestErrorFunc path, return err directly when inherited
is nil; otherwise continue delegating to inherited(c, err).

In `@tests/cli_e2e/im/im_list_page_all_dryrun_test.go`:
- Around line 60-69: The existing dry-run coverage only checks the initial
request and must be supplemented with live E2E coverage for --page-all. Add a
bot-authenticated create/use/cleanup workflow in the relevant test flow that
produces multiple pages, then verify continuation requests use the returned
cursor and that the final output accumulates results across pages.
🪄 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 Plus

Run ID: 671b2e38-c06f-4a41-82b6-e1a8c28cb767

📥 Commits

Reviewing files that changed from the base of the PR and between e32d7cb and 20f71c0.

📒 Files selected for processing (51)
  • cmd/flag_suggest_test.go
  • cmd/root.go
  • internal/flagalias/error_attribution.go
  • internal/flagalias/error_attribution_test.go
  • internal/flagalias/flagalias.go
  • internal/flagalias/flagalias_test.go
  • internal/output/envelope.go
  • internal/output/format.go
  • internal/output/format_test.go
  • lint/flagcontract/scan.go
  • lint/flagcontract/scan_test.go
  • shortcuts/base/base_execute_test.go
  • shortcuts/common/flag_error_attribution.go
  • shortcuts/common/page_all_flags.go
  • shortcuts/common/paginate_into.go
  • shortcuts/common/paginate_into_test.go
  • shortcuts/common/runner.go
  • shortcuts/common/runner_flag_alias_test.go
  • shortcuts/im/helpers.go
  • shortcuts/im/im_chat_list.go
  • shortcuts/im/im_chat_members_list.go
  • shortcuts/im/im_chat_members_list_test.go
  • shortcuts/im/im_chat_messages_list.go
  • shortcuts/im/im_chat_search.go
  • shortcuts/im/im_feed_group_item_test.go
  • shortcuts/im/im_feed_group_list.go
  • shortcuts/im/im_feed_group_list_item.go
  • shortcuts/im/im_feed_group_list_test.go
  • shortcuts/im/im_flag_aliases_test.go
  • shortcuts/im/im_flag_list.go
  • shortcuts/im/im_flag_test.go
  • shortcuts/im/im_list_page_all_test.go
  • shortcuts/im/im_list_pagination.go
  • shortcuts/im/im_messages_mget.go
  • shortcuts/im/im_messages_search.go
  • shortcuts/im/im_threads_messages_list.go
  • shortcuts/im/im_threads_messages_list_test.go
  • shortcuts/mail/flag_suggest.go
  • shortcuts/mail/flag_suggest_test.go
  • skills/lark-im/references/lark-im-chat-list.md
  • skills/lark-im/references/lark-im-chat-members-list.md
  • skills/lark-im/references/lark-im-chat-messages-list.md
  • skills/lark-im/references/lark-im-chat-search.md
  • skills/lark-im/references/lark-im-feed-group-list-item.md
  • skills/lark-im/references/lark-im-feed-group-list.md
  • skills/lark-im/references/lark-im-flag-list.md
  • skills/lark-im/references/lark-im-messages-search.md
  • skills/lark-im/references/lark-im-threads-messages-list.md
  • tests/cli_e2e/base/base_limit_dryrun_test.go
  • tests/cli_e2e/im/im_list_page_all_dryrun_test.go
  • tests/cli_e2e/im/im_page_all_live_test.go
💤 Files with no reviewable changes (1)
  • shortcuts/im/im_threads_messages_list_test.go
🚧 Files skipped from review as they are similar to previous changes (22)
  • shortcuts/base/base_execute_test.go
  • skills/lark-im/references/lark-im-chat-search.md
  • shortcuts/im/im_messages_search.go
  • skills/lark-im/references/lark-im-chat-list.md
  • shortcuts/common/paginate_into_test.go
  • shortcuts/im/helpers.go
  • shortcuts/im/im_chat_messages_list.go
  • shortcuts/common/page_all_flags.go
  • shortcuts/im/im_messages_mget.go
  • tests/cli_e2e/base/base_limit_dryrun_test.go
  • shortcuts/im/im_threads_messages_list.go
  • internal/output/envelope.go
  • skills/lark-im/references/lark-im-chat-messages-list.md
  • shortcuts/im/im_chat_list.go
  • shortcuts/common/runner.go
  • shortcuts/im/im_list_pagination.go
  • shortcuts/common/paginate_into.go
  • shortcuts/im/im_flag_aliases_test.go
  • shortcuts/im/im_list_page_all_test.go
  • internal/flagalias/flagalias_test.go
  • shortcuts/im/im_chat_search.go
  • tests/cli_e2e/im/im_page_all_live_test.go

Comment thread cmd/root.go
Comment thread lint/flagcontract/scan_test.go
Comment thread shortcuts/mail/flag_suggest.go
Comment thread tests/cli_e2e/im/im_list_page_all_dryrun_test.go
sang-neo03
sang-neo03 previously approved these changes Aug 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (1)
shortcuts/im/im_threads_messages_list_test.go (1)

32-33: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Handle mounted-runtime errors before using the runtimes.

newMountedIMRuntime returns an error, but these calls discard it. If mounting or argument parsing fails, the test can panic or report an unclear assertion failure instead of the setup error. Capture the error and fail with t.Fatalf before calling DryRun or Str.

Proposed fix
-			newRT, _ := newMountedIMRuntime(t, &ImThreadsMessagesList, "--thread", "omt_test", "--order", dir)
-			oldRT, _ := newMountedIMRuntime(t, &ImThreadsMessagesList, "--thread", "omt_test", "--sort", dir)
+			newRT, err := newMountedIMRuntime(t, &ImThreadsMessagesList, "--thread", "omt_test", "--order", dir)
+			if err != nil {
+				t.Fatalf("mount canonical runtime: %v", err)
+			}
+			oldRT, err := newMountedIMRuntime(t, &ImThreadsMessagesList, "--thread", "omt_test", "--sort", dir)
+			if err != nil {
+				t.Fatalf("mount alias runtime: %v", err)
+			}
...
-		rt, _ := newMountedIMRuntime(t, &ImThreadsMessagesList, test.args...)
+		rt, err := newMountedIMRuntime(t, &ImThreadsMessagesList, test.args...)
+		if err != nil {
+			t.Fatalf("mount runtime: %v", err)
+		}

Also applies to: 52-52

🤖 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/im/im_threads_messages_list_test.go` around lines 32 - 33, Update
the test setup around newMountedIMRuntime calls to capture each returned error
and call t.Fatalf with the setup error before using newRT or oldRT in DryRun or
Str. Apply the same handling to both mounted-runtime initializations, including
the additional occurrence referenced by the review.
🤖 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.

Outside diff comments:
In `@shortcuts/im/im_threads_messages_list_test.go`:
- Around line 32-33: Update the test setup around newMountedIMRuntime calls to
capture each returned error and call t.Fatalf with the setup error before using
newRT or oldRT in DryRun or Str. Apply the same handling to both mounted-runtime
initializations, including the additional occurrence referenced by the review.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c51d1e28-ad43-4e5d-bb38-902bc2427f57

📥 Commits

Reviewing files that changed from the base of the PR and between 20f71c0 and 8353309.

📒 Files selected for processing (11)
  • internal/qualitygate/cmd/manifest-export/main_test.go
  • lint/README.md
  • shortcuts/im/im_chat_messages_list.go
  • shortcuts/im/im_chat_messages_list_test.go
  • shortcuts/im/im_flag_aliases_test.go
  • shortcuts/im/im_threads_messages_list.go
  • shortcuts/im/im_threads_messages_list_test.go
  • shortcuts/im/sort_flags.go
  • skills/lark-im/SKILL.md
  • skills/lark-mail/references/lark-mail-triage.md
  • tests/cli_e2e/im/im_flag_aliases_dryrun_test.go
💤 Files with no reviewable changes (1)
  • shortcuts/im/sort_flags.go
🚧 Files skipped from review as they are similar to previous changes (8)
  • lint/README.md
  • skills/lark-im/SKILL.md
  • internal/qualitygate/cmd/manifest-export/main_test.go
  • tests/cli_e2e/im/im_flag_aliases_dryrun_test.go
  • shortcuts/im/im_threads_messages_list.go
  • shortcuts/im/im_chat_messages_list.go
  • shortcuts/im/im_flag_aliases_test.go
  • shortcuts/im/im_chat_messages_list_test.go

@sang-neo03
sang-neo03 merged commit 2a16134 into main Aug 3, 2026
27 checks passed
@sang-neo03
sang-neo03 deleted the feat/framework-flag-aliases branch August 3, 2026 11:20
@liangshuo-1 liangshuo-1 mentioned this pull request Aug 3, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/base PR touches the base domain domain/ccm PR touches the ccm domain domain/im PR touches the im domain domain/mail PR touches the mail domain size/XL Architecture-level or global-impact change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants