Skip to content

docs +fetch --doc URL 与裸 token 行为不一致:URL 稳定返回 4000002 #833

@danielwpz

Description

@danielwpz

问题描述

docs +fetch --api-version v2 --doc 宣称同时支持文档 URL 和裸 token,但对于部分文档,传入完整 URL 会稳定返回 4000002,而同一个文档传入裸 token 正常。

复现步骤

# ❌ 传入完整 URL → 4000002 (3/3 复现)
lark-cli docs +fetch --api-version v2   --doc "https://xxx.feishu.cn/docx/{token}"   --doc-format markdown

# ✅ 传入裸 token → 正常 (3/3 成功)  
lark-cli docs +fetch --api-version v2   --doc {token}   --doc-format markdown
  • token 为 28 字符,URL 格式为 https://xxx.feishu.cn/docx/{token}
  • 同一文件夹下的其他 docx 文档(同格式 URL),URL 和 token 均正常
  • 出错文档的 URL 在浏览器中可以正常打开

环境

  • lark-cli 1.0.28
  • 用户身份认证 (user OAuth device flow)
  • AI Agent 环境 (Pokoclaw),已安装 24 个 lark-cli skills

错误详情

{
  "ok": false,
  "error": {
    "type": "api_error",
    "code": 4000002,
    "message": "Invalid request parameters: the document version may be stale, block_id may be malformed, or references a non-existent block. Re-fetch the document structure (via the export API) and retry with the latest version and block_id"
  }
}

期望行为

--doc 传入 URL 和传入裸 token 应对同一文档返回一致的结果。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdomain/coreCLI framework and core librariesdomain/docDocs domain

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions