feat: default skip_task_detail in docs +fetch#471
feat: default skip_task_detail in docs +fetch#471SunPeiYang996 merged 1 commit intolarksuite:mainfrom
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
📝 WalkthroughWalkthroughModified Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
shortcuts/doc/docs_fetch.go (1)
29-41: Optional: extract sharedargsbuilder to avoid future drift.
DryRunandExecutecurrently duplicate the same argument construction; a helper would make future param changes safer.♻️ Suggested refactor
+func buildDocsFetchArgs(runtime *common.RuntimeContext) map[string]interface{} { + args := map[string]interface{}{ + "doc_id": runtime.Str("doc"), + "skip_task_detail": true, + } + if v := runtime.Str("offset"); v != "" { + n, _ := strconv.Atoi(v) + args["offset"] = n + } + if v := runtime.Str("limit"); v != "" { + n, _ := strconv.Atoi(v) + args["limit"] = n + } + return args +} ... - args := map[string]interface{}{ - "doc_id": runtime.Str("doc"), - "skip_task_detail": true, - } - if v := runtime.Str("offset"); v != "" { - n, _ := strconv.Atoi(v) - args["offset"] = n - } - if v := runtime.Str("limit"); v != "" { - n, _ := strconv.Atoi(v) - args["limit"] = n - } + args := buildDocsFetchArgs(runtime) ... - args := map[string]interface{}{ - "doc_id": runtime.Str("doc"), - "skip_task_detail": true, - } - if v := runtime.Str("offset"); v != "" { - n, _ := strconv.Atoi(v) - args["offset"] = n - } - if v := runtime.Str("limit"); v != "" { - n, _ := strconv.Atoi(v) - args["limit"] = n - } + args := buildDocsFetchArgs(runtime)Also applies to: 49-61
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@shortcuts/doc/docs_fetch.go` around lines 29 - 41, Extract the duplicate args construction in shortcuts/doc/docs_fetch.go into a single helper (e.g., buildFetchArgs or argsForDocsFetch) that returns map[string]interface{} and encapsulates setting "doc_id", defaulting "skip_task_detail": true, and parsing "offset" and "limit" (handle strconv.Atoi errors consistently). Replace the duplicated blocks in both DryRun and Execute to call this helper and use its returned map, ensuring no behavioral changes and preserving keys "doc_id", "skip_task_detail", "offset", and "limit".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@shortcuts/doc/docs_fetch.go`:
- Around line 29-41: Extract the duplicate args construction in
shortcuts/doc/docs_fetch.go into a single helper (e.g., buildFetchArgs or
argsForDocsFetch) that returns map[string]interface{} and encapsulates setting
"doc_id", defaulting "skip_task_detail": true, and parsing "offset" and "limit"
(handle strconv.Atoi errors consistently). Replace the duplicated blocks in both
DryRun and Execute to call this helper and use its returned map, ensuring no
behavioral changes and preserving keys "doc_id", "skip_task_detail", "offset",
and "limit".
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 718ad8dc-20ab-4afc-aafe-96eeabc7d23c
📒 Files selected for processing (2)
shortcuts/doc/docs_fetch.goskills/lark-doc/references/lark-doc-fetch.md
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@48b86454a0cb7d78d40d69e9ca45a159449e501d🧩 Skill updatenpx skills add ILUO/cli#feat/docs-fetch-skip-task-detail -y -g |
Summary
Currently
docs +fetchmay expand embedded task details when calling MCPfetch-doc, which adds extra detail to the default fetch result and is notalways needed. This PR makes
docs +fetchsendskip_task_detail=truebydefault, and updates the skill reference to clarify that task blocks are
returned as
<task task-id="..."></task>and should be queried separately viathe task CLI when task details are needed.
Changes
skip_task_detail=truetoshortcuts/doc/docs_fetch.goskills/lark-doc/references/lark-doc-fetch.mdto document task block behaviorlark-cli task tasks getTest Plan
go test ./shortcuts/doclark-cli docs +fetch --doc "<doc_or_wiki_url>" --dry-runskip_task_detail: true<task task-id="..."></task>behaviorRelated Issues
N/A
Summary by CodeRabbit
docs +fetch: embedded task details are no longer automatically expanded. Users can retrieve task details via a separate command as needed.