docs +update block_insert_after: result=failed may still persist non-failing blocks — unsafe to retry, no idempotency
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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 小时
- 30 天内合并 PR
- 18
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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
维护者通常 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 天内回复