docs +update block_insert_after: result=failed may still persist non-failing blocks — unsafe to retry, no idempotency
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 77/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go
- 領域
- cli, documentation
調査の方向性
docs +updateのリファレンスを見つけ、block_insert_afterの結果と再試行のガイダンスを読みます。failedまたはpartial_successでもブロックが適用されたままになる場合があり、クライアントは再試行の前に対象範囲を再取得する必要があることを説明するよう、ドキュメントを更新します。この動作と安全でない再試行についてリファレンスで明確に警告されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Environment
@larksuite/cli1.0.99 (npm), Linux,--as userdocs +update --command block_insert_after
Summary
When a single block_insert_after instruction contains multiple blocks and one of them fails server-side (e.g. a <whiteboard token="..."> cross-document clone that cannot be cloned), the API returns result=failed with degrade warnings — but the non-failing blocks of the same instruction are actually persisted. Any retry (a natural response to a failed result, especially in automated batch workflows) duplicates the already-applied blocks.
We verified this repeatedly while doing a large document restructure: a chunked batch-editing script that retried on failed produced 9 copies of the same ~10KB chunk before we noticed. The failed result genuinely looked like "nothing was applied".
Repro
-
Take any doc with an anchor block. Prepare a whiteboard token from a different document (cross-doc clone is not supported).
-
One instruction containing three blocks:
docs +update --command block_insert_after --block-id <anchor> --content \ '<p>para one</p><whiteboard token="TOKEN_FROM_OTHER_DOC" type="mermaid"></whiteboard><p>para three</p>' -
Response:
result=failed, warnings:degrade_code=2105, msg=Whiteboard clone failed. Retry later degrade_code=1003, msg=Instruction produced empty content after transform -
Fetch the region after
<anchor>:para oneandpara threeexist despiteresult=failed(the error message even says "produced empty content", which is not what happened). -
Re-run step 2 → a second copy of the paragraphs appears. Repeat → N copies.
Expected
Any of the following would fix the foot-gun:
- Atomic per-instruction semantics: apply all blocks or none (rollback on partial failure), or
- Truthful reporting:
resultreflects per-block outcomes andnew_blockslists what was actually applied even whenresult=failed, or - Idempotency key: accept a client-generated request id so automated retries are safe.
Suggested docs fix (minimum)
At minimum, the +update reference should state that failed/partial_success does not mean "nothing was applied", and that clients must re-fetch the target range to verify before retrying. Right now nothing warns about this, and the degrade message "Retry later" actively encourages the unsafe retry.
Impact
Agent-driven batch editing is a first-class use case for this CLI ("built for humans and AI Agents"). Retrying on failure is the standard recovery pattern for agents; a failed result that silently applied half the instruction turns every retry into silent content duplication at scale.
- 主要言語
- Go
- スター
- 18.2k
- フォーク
- 1.4k
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
larksuite/cli のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
domain/im
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
mail: all-ASCII draft bodies are hard-wrapped every 998 bytes, inserting newlines inside words and tags対応中かも @linye157 が 26 日前に担当しました。 オープンdomain/mail
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
auth: a 429 from the Token Endpoint during refresh deletes a still-valid login対応中かも @linye157 が 26 日前に担当しました。 オープンbug domain/auth domain/im
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
larksuite/cli#2869 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
domain/core enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
github/github-mcp-server#3960 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
JuliusBrussee/caveman#1594 ·
メンテナーはふだん 1 日以内に返信
-
C-bug O-community X-blathers-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
cockroachdb/cockroach#176264 · コメント 1 件 ·
-
security trivy
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
kubefleet-dev/kubefleet#1068 ·
メンテナーはふだん 3 日以内に返信