Skip to content

docs(lark-doc): document read-only block types that create/update silently skip#620

Open
herbertliu wants to merge 2 commits intomainfrom
feat/doc-readonly-block-types
Open

docs(lark-doc): document read-only block types that create/update silently skip#620
herbertliu wants to merge 2 commits intomainfrom
feat/doc-readonly-block-types

Conversation

@herbertliu
Copy link
Copy Markdown
Collaborator

@herbertliu herbertliu commented Apr 23, 2026

Summary

Addresses Case 6 in the lark-cli pitfall list: docs +create / docs +update returns success but silently drops blocks the underlying create-doc MCP tool cannot write (sync blocks, some AddOns, anything that round-trips as <!-- Unsupported block type: N --> from fetch-doc). Agents hit this repeatedly when scaffolding weekly reports or other templates and get no signal the block is gone.

Rather than adding a runtime warning (which would require MCP-side block-type inventory that CLI doesn't own), this PR documents the known read-only block set and the signals an Agent can use to detect a silent drop, so the skill consumer knows to avoid these tags in generated markdown.

Changes

  • skills/lark-doc/references/lark-doc-block-type-limits.md (new): read-only block inventory (<reference-synced>, <source-synced>), the <!-- Unsupported block type: N --> marker origin, detection signals, recommended workarounds
  • skills/lark-doc/SKILL.md: new "Block type 写入限制" section linking the new reference right after the shortcuts table

Test Plan

  • Docs-only change; no code modified
  • Links resolve within the skill tree

Summary by CodeRabbit

  • Documentation
    • Clarified that document create/update operations do not write every block type and some blocks are effectively read-only.
    • Added a reference guide describing which block types are skipped or emitted as placeholders on fetch, troubleshooting signals for missing content, and guidance to avoid generating unsupported sync tags when authoring or binding UI.

…ently skip

Agents hit a repeatable gotcha where docs +create / docs +update returns
success but the block is silently dropped on the server side — e.g.
<reference-synced> sync blocks used for weekly-report team headers, or
AddOns that fetch-doc only represents as '<!-- Unsupported block type: N -->'
comments. Because the API answers code=0 success=true, nothing in the
tooling chain currently surfaces the drop.

Add references/lark-doc-block-type-limits.md with the known read-only
block inventory, the fetch-time <!-- Unsupported block type --> marker,
signals for detecting a silent drop, and suggested workarounds (manual
UI step vs avoiding the block in generated markdown). Link it from the
docs SKILL.md so Agents see it before writing markdown.
@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/M Single-domain feat or fix with limited business impact labels Apr 23, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

📝 Walkthrough

Walkthrough

The PR adds documentation clarifying that Lark doc MCP docs +create and docs +update do not support all block types; some blocks (e.g., <reference-synced>, <source-synced>, certain AddOns) are effectively read-only or skipped, with placeholder HTML used on fetch/round-trip.

Changes

Cohort / File(s) Summary
Documentation
skills/lark-doc/SKILL.md, skills/lark-doc/references/lark-doc-block-type-limits.md
Adds guidance on block-type limits for MCP docs: which blocks are read-only or silently skipped during docs +create/+update, placeholder behavior on docs +fetch, examples of affected blocks, diagnostic "signals" checklist, and agent guidance.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • liangshuo-1

Poem

🐇 Through pages, I nibble and peek,
Little blocks hide when writers speak.
Read-only tags and HTML signs,
I hop along through docs and lines.
Cheers to clearer authoring times!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: documenting read-only block types that are silently skipped during create/update operations.
Description check ✅ Passed The description comprehensively covers all required template sections: Summary explains the motivation, Changes lists the specific files modified with details, and Test Plan confirms verification was performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/doc-readonly-block-types

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
skills/lark-doc/SKILL.md (1)

144-144: Use the exact placeholder pattern for consistency.

Line 144 currently shows <!-- Unsupported block type -->; consider matching the detailed doc’s canonical form <!-- Unsupported block type: N --> to avoid ambiguity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-doc/SKILL.md` at line 144, The README entry uses a generic
placeholder `<!-- Unsupported block type -->`; change it to the canonical
pattern `<!-- Unsupported block type: N -->` so it matches the detailed doc and
avoids ambiguity—update the text in SKILL.md where the reference to
`references/lark-doc-block-type-limits.md` appears (the entry that currently
contains `<!-- Unsupported block type -->`) to use `<!-- Unsupported block type:
N -->` instead and ensure any surrounding explanation mentions the `: N` suffix
as the required format.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/lark-doc/references/lark-doc-block-type-limits.md`:
- Line 5: Clarify that the behavior differs between the write-path and
fetch-path for the `create-doc` MCP tool: update the sentence referencing
`create-doc` so it explicitly states write-path = the tool silently skips
unsupported block types (API returns success but blocks are not written) and
fetch-path = the service may return a placeholder HTML comment such as `<!--
Unsupported block type: N -->` when rendering/fetching; reference the
`create-doc` MCP tool and the placeholder comment in the revised wording to
avoid implying `create-doc` itself emits HTML comments.

---

Nitpick comments:
In `@skills/lark-doc/SKILL.md`:
- Line 144: The README entry uses a generic placeholder `<!-- Unsupported block
type -->`; change it to the canonical pattern `<!-- Unsupported block type: N
-->` so it matches the detailed doc and avoids ambiguity—update the text in
SKILL.md where the reference to `references/lark-doc-block-type-limits.md`
appears (the entry that currently contains `<!-- Unsupported block type -->`) to
use `<!-- Unsupported block type: N -->` instead and ensure any surrounding
explanation mentions the `: N` suffix as the required format.
🪄 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

Run ID: 501fbc9a-e52b-4744-bded-ea7a9dc16359

📥 Commits

Reviewing files that changed from the base of the PR and between bc6590a and 35c558c.

📒 Files selected for processing (2)
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/lark-doc-block-type-limits.md

Comment thread skills/lark-doc/references/lark-doc-block-type-limits.md Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.05%. Comparing base (bc6590a) to head (7449025).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #620   +/-   ##
=======================================
  Coverage   60.05%   60.05%           
=======================================
  Files         406      406           
  Lines       43089    43089           
=======================================
  Hits        25877    25877           
  Misses      15194    15194           
  Partials     2018     2018           

☔ View full report in Codecov by Sentry.
📢 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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/doc-readonly-block-types -y -g

…ype limits

CodeRabbit noted the opening paragraph could be read as if create-doc
itself emits the '<!-- Unsupported block type: N -->' comment, when in
fact that placeholder is a fetch-doc rendering artifact for blocks it
cannot serialize back to markdown. Split the sentence so the two paths
are clearly separate: write-path silently drops the block; fetch-path
surfaces the placeholder comment.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
skills/lark-doc/references/lark-doc-block-type-limits.md (1)

8-8: Consider refining "同类" for clearer reference.

The phrase "同类无法稳定序列化成 markdown 的原生 block" uses "同类" (similar type/same type), which is slightly ambiguous—it's unclear what category it refers back to. Consider using "这类" (these types of) or "相应的" (corresponding) for more direct clarity.

📝 Suggested wording refinement
-- **读取路径(`docs +fetch` 导出)**:同类无法稳定序列化成 markdown 的原生 block,会以占位注释 `<!-- Unsupported block type: N -->` 呈现。
+- **读取路径(`docs +fetch` 导出)**:这类无法稳定序列化成 markdown 的原生 block,会以占位注释 `<!-- Unsupported block type: N -->` 呈现。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/lark-doc/references/lark-doc-block-type-limits.md` at line 8, Replace
the ambiguous term "同类" in the sentence "同类无法稳定序列化成 markdown 的原生 block,会以占位注释
`<!-- Unsupported block type: N -->` 呈现。" with a clearer referent such as "这类"
or "相应的" so it reads e.g. "这类原生 block 无法稳定序列化成 markdown,会以占位注释 `<!-- Unsupported
block type: N -->` 呈现。", ensuring the sentence clearly refers to the native
block types mentioned earlier.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@skills/lark-doc/references/lark-doc-block-type-limits.md`:
- Line 8: Replace the ambiguous term "同类" in the sentence "同类无法稳定序列化成 markdown
的原生 block,会以占位注释 `<!-- Unsupported block type: N -->` 呈现。" with a clearer
referent such as "这类" or "相应的" so it reads e.g. "这类原生 block 无法稳定序列化成
markdown,会以占位注释 `<!-- Unsupported block type: N -->` 呈现。", ensuring the sentence
clearly refers to the native block types mentioned earlier.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d52a7e6e-140b-4d82-a8ce-6794435e86e6

📥 Commits

Reviewing files that changed from the base of the PR and between 35c558c and 7449025.

📒 Files selected for processing (1)
  • skills/lark-doc/references/lark-doc-block-type-limits.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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