docs(task): clarify inline image limitation#1826
Conversation
📝 WalkthroughWalkthroughThis PR documents that inline images in task descriptions and comments cannot be downloaded via the Task OpenAPI, adding clarifying notes to SKILL.md and two reference docs, and adds a Go test that verifies these documentation markers exist in the relevant files. ChangesInline image limitation docs and validation test
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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/task/task_skill_docs_test.go (1)
21-37: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider
t.Errorfovert.Fatalffor marker assertions.Using
t.Fatalfstops at the first missing marker, so only one failure is reported. Switching tot.Errorfwould surface all missing markers across all files in a single run, making debugging faster when documentation drifts.Based on learnings,
os.*usage in*_test.gofiles for reading fixtures is the correct pattern in this repo, andcmdutil.TestFactory/t.Setenvare not required since this test exercises no CLI/config/auth behavior.Optional refactor
if !strings.Contains(text, want) { - t.Fatalf("%s missing %q", rel, want) + t.Errorf("%s missing %q", rel, want) }🤖 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/task/task_skill_docs_test.go` around lines 21 - 37, The marker checks in the test loop currently use t.Fatalf, which stops after the first missing string and hides other failures. Update the assertion flow in the test body that reads files with os.ReadFile so it reports each missing marker with t.Errorf instead of exiting early, keeping the same strings slice and looping over all files and markers to surface every documentation drift in one run.Source: Learnings
🤖 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.
Nitpick comments:
In `@shortcuts/task/task_skill_docs_test.go`:
- Around line 21-37: The marker checks in the test loop currently use t.Fatalf,
which stops after the first missing string and hides other failures. Update the
assertion flow in the test body that reads files with os.ReadFile so it reports
each missing marker with t.Errorf instead of exiting early, keeping the same
strings slice and looping over all files and markers to surface every
documentation drift in one run.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d7539cd6-94f1-4145-88b6-3eb775beafbc
📒 Files selected for processing (4)
shortcuts/task/task_skill_docs_test.goskills/lark-task/SKILL.mdskills/lark-task/references/lark-task-comment.mdskills/lark-task/references/lark-task-upload-attachment.md
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@6ad456f5012ec3ff6c4f38e4c2dcf0394a3becdf🧩 Skill updatenpx skills add xu91102/cli#docs/task-inline-image-limitation -y -g |
背景
Task description/comment 中的内联图片目前通过 Task OpenAPI 只能看到字面量
[Image],没有 media/file token;attachments endpoint 也只覆盖普通task/task_delivery附件,不能列出或下载 comment/description 内联图片。Fixes #1746
核心改动
lark-task主 skill 中明确 Task inline images 的 OpenAPI 边界。+upload-attachment引用页说明它不是[Image]下载路径,只用于上传普通附件。+comment引用页说明 image-only comments 可能只返回[Image],需要用户上传普通附件或从 UI 手动下载。验证
GOCACHE=$PWD/.cache/go-build GOPROXY=https://goproxy.cn,direct go test ./shortcuts/task -count=1:通过GOCACHE=$PWD/.cache/go-build GOPROXY=https://goproxy.cn,direct go build -o ./lark-cli .:通过git diff --check:通过gofmt -l shortcuts/task/task_skill_docs_test.go:通过,无输出rg -n '^(<<<<<<< .+|=======$|>>>>>>> .+)$' --glob '!vendor/**' --glob '!node_modules/**' .:通过,无冲突标记风险与回滚
风险低。该 PR 只更新 task skill 文档并添加文档测试,不改变 CLI 请求、响应或认证行为。回滚提交即可恢复原文档。
Summary by CodeRabbit
Documentation
[Image]placeholders.Tests