Skip to content

feat: expose compact task fields - #2109

Merged
luoyangxing merged 11 commits into
larksuite:mainfrom
ILUO:feat/task-compact-fields
Aug 11, 2026
Merged

luoyangxing merged 11 commits into
larksuite:mainfrom
ILUO:feat/task-compact-fields

Conversation

@ILUO

@ILUO ILUO commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Expose task title, members, start, due, and completion state in compact task shortcut results without renaming or removing existing fields. The projection reuses Task entities already returned by each API flow, so it adds no network requests.

Changes

  • Add a shared typed-field projector for summary, members, start, due, and status.
  • Extend read summaries, root write results, and nested successful task items while preserving existing aliases and failure schemas.
  • Add output contract tests covering root, list, reminder, completion, update, and tasklist flows.

Test Plan

  • go test ./...
  • make unit-test
  • go vet ./...
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 run --new-from-rev=origin/main
  • Mocked local shortcut execution confirms the affected JSON output paths and unchanged failure behavior.

Related Issues

  • None

Summary by CodeRabbit

  • Enhancements
    • Task commands now return richer, standardized output across creation, updates, assignment, completion, reminders, reopening, and task-list operations.
    • Structured responses can include summary, members, status, start, and due details alongside identifiers and links.
    • “Get my tasks” and related-task results now include additional scheduling and assignment information.
  • Bug Fixes
    • Improved consistency of task fields in JSON responses, including reminder removal and partial task updates.
  • Documentation
    • Added guidance for discovering supported task commands, retrieving schemas, and formatting task data correctly.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Task outputs now include standard fields such as summary, members, start, due, and status across task mutations, queries, reminders, updates, and tasklist operations. Task discovery rules now require progressive shortcut and schema lookup.

Changes

Task output projection

Layer / File(s) Summary
Projection contract and root output coverage
shortcuts/task/task_output.go, shortcuts/task/task_output_test.go
Defines standard output fields and tests projection behavior, absent-field handling, and root shortcut responses.
Task mutation output enrichment
shortcuts/task/shortcuts.go, shortcuts/task/task_*.go, shortcuts/task/*_test.go
Adds standard task fields to create, assign, complete, followers, reopen, reminder, and update outputs.
Task query projections
shortcuts/task/task_get_my_tasks.go, shortcuts/task/task_query_helpers.go, shortcuts/task/*_test.go
Projects members, start, due, and status fields into query results and expands related assertions.
Tasklist output enrichment
shortcuts/task/tasklist_*.go, shortcuts/task/tasklist_*_test.go
Adds standard fields to successful tasklist results and validates decoded JSON payloads.

Task command discovery

Layer / File(s) Summary
Progressive command discovery
skills/lark-task/SKILL.md, skills/lark-task/references/lark-task-create.md
Requires documented shortcut matching, CLI help fallback, schema lookup, and exact API field structure for --data usage.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested labels: feature

Suggested reviewers: liangshuo-1

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% 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
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.
Title check ✅ Passed The title clearly and concisely describes the main change: exposing compact task fields.
Description check ✅ Passed The description includes all required sections and clearly documents the scope, changes, tests, and related issues.
✨ 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 github-actions Bot added domain/task PR touches the task domain size/M Single-domain feat or fix with limited business impact labels Jul 30, 2026
@ILUO
ILUO marked this pull request as ready for review July 30, 2026 08:07

@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: 3

🤖 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/task/task_get_my_tasks.go`:
- Line 225: Update projectTaskFields to also project the standardized due and
status fields alongside the existing members and start fields. Preserve the
due_at and completed aliases, derive or project status from completed, and add
direct JSON assertions covering both due and status.

In `@shortcuts/task/task_output.go`:
- Around line 24-31: Update projectTaskFields to accept a typed task-output
struct rather than raw map[string]interface{} input, and project its validated
fields into the destination map. Decode task responses into that struct at the
boundary before invoking projectTaskFields, preserving one projection path for
the task-output shape and preventing malformed or silently missing fields from
being propagated.

In `@shortcuts/task/task_reminder.go`:
- Line 174: Add a contract test covering the successful reminder update path in
the task reminder tests, using --set or removing an existing reminder rather
than --remove with no reminders. Assert the response includes the standard task
output fields produced by projectTaskFields, so removing that projection causes
the test to fail.
🪄 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: 25f12817-5eba-44c3-be94-ce2a0e8aadb0

📥 Commits

Reviewing files that changed from the base of the PR and between 1f565a2 and 7c7ad7d.

📒 Files selected for processing (21)
  • shortcuts/task/shortcuts.go
  • shortcuts/task/task_assign.go
  • shortcuts/task/task_complete.go
  • shortcuts/task/task_complete_test.go
  • shortcuts/task/task_followers.go
  • shortcuts/task/task_get_my_tasks.go
  • shortcuts/task/task_get_my_tasks_test.go
  • shortcuts/task/task_get_related_tasks_test.go
  • shortcuts/task/task_output.go
  • shortcuts/task/task_output_test.go
  • shortcuts/task/task_query_helpers.go
  • shortcuts/task/task_query_helpers_test.go
  • shortcuts/task/task_reminder.go
  • shortcuts/task/task_reminder_test.go
  • shortcuts/task/task_reopen.go
  • shortcuts/task/task_update.go
  • shortcuts/task/task_update_test.go
  • shortcuts/task/tasklist_add_task.go
  • shortcuts/task/tasklist_add_task_test.go
  • shortcuts/task/tasklist_create.go
  • shortcuts/task/tasklist_create_test.go

Comment thread shortcuts/task/task_get_my_tasks.go
Comment thread shortcuts/task/task_output.go
Comment thread shortcuts/task/task_reminder.go
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@github-actions

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add ILUO/cli#feat/task-compact-fields -y -g

@luoyangxing luoyangxing reopened this Aug 11, 2026
@luoyangxing
luoyangxing merged commit b9cced6 into larksuite:main Aug 11, 2026
40 of 54 checks passed
@liangshuo-1 liangshuo-1 mentioned this pull request Aug 11, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/task PR touches the task 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.

3 participants