Repository navigation
v1.28.0 — 兼容性恢复 + msg history 自动展开线程
重要:本版本修复了 v1.27.0 引入的多个静默回归(读类命令 token 策略退化、外部群读取 230002 等),所有 v1.26.0 用户都建议升级。
🔴 重大修复(v1.27.0 → v1.28.0)
Token 策略回归修复
v1.27.0 把约 36 个读类命令的 token 解析从 resolveOptionalUserTokenWithFallback 改成了 resolveOptionalUserToken,破坏了 CLAUDE.md 明确定义的 "User 优先 + Tenant 兜底" 策略。已 auth login 的用户读外部群报 230002 Bot/User can NOT be out of the chat,静默无提示。
修复范围:msg、calendar、task、tasklist、file、board、wiki、user、comment(PR #151)等 36+ 命令全部回退到 WithFallback,恢复 "自动加载 ~/.feishu-cli/token.json + 过期 refresh" 行为。
配套修复
mail_inline.go:resolveCurrentUserOpenID补SaveCurrentUserCache,避免每次 mail 命令都打/authen/v1/user_info(QPS 风险)cmd/config_create_app.go:--save适配 profile,多 App 用户切到 work profile 后能正确写入~/.feishu-cli/profiles/work/config.yamlinternal/event/bus.go:EventsDir()接 profile,每个 profile 独立 events 目录,daemon 状态不再跨 profile 污染internal/converter/markdown_to_block.go:normalizeURL用PathUnescape替代QueryUnescape,修 URL query 中字面+被错解为空格(如 `?q=a+b` → `?q=a b`),与导出方向对称cmd/root.go:Long 文本补 auth/dept/tasklist;--config与 token 路径解耦时打 stderr warning;清理 9 处冗余SilenceUsage/SilenceErrors(含schema.go矛盾的SilenceErrors: false)
⚡ 新能力(与官方 lark-cli 对齐)
msg history 默认自动展开线程
对话题群(chat_mode=thread)的根消息,一次性拉取每个 thread_id 的回复,与官方 lark-cli +chat-messages-list 行为对齐:
```bash
默认开启:一次拉根 + 所有话题回复(实测 50 根 + 25 话题 = 26 次 API)
feishu-cli msg history --container-id oc_xxx --container-id-type chat -o json
关闭(保持 v1.27 行为)
feishu-cli msg history --container-id oc_xxx --container-id-type chat --expand-threads=false -o json
调规模
feishu-cli msg history --container-id oc_xxx --container-id-type chat \
--threads-per-page 30 --threads-total-limit 300
```
JSON 输出顶层新增 `thread_replies` / `thread_has_more` / `thread_replies_card_texts`。
意外收益:把线程回复一起送入 contact basic_batch 批量查名字,外部商家用户名字解析率从 ~8% 提升到 ~42%,反超官方 lark-cli(35.5%)。
Comment User Token 支持(PR #151 by @zhmushan)
comment list/add/get/resolve/unresolve 5 个命令终于接受 --user-access-token。文档归个人所有 + App 未加协作者时不再 1069303 forbidden。
converter round-trip 回归测试
新增 23 个 markdown → blocks → markdown 端到端测试,覆盖 inline 粗体/斜体/code/link(含 URL + 号)、嵌套列表、代码块、行内/块级公式(验证 \\nu 不被吃)、blockquote、6 色 Callout 等。
📚 文档与技能同步
- 25 个 SKILL.md 全部含完整 frontmatter(name/description/argument-hint/user-invocable/allowed-tools)
- CLAUDE.md token 策略章节重写为三类(读 / 写 / 必须 User),与
cmd/utils.go三个 helper 对齐 feishu-cli-doctor/feishu-cli-profile描述合并到feishu-cli-auth;feishu-cli-doc-guide内容搬到feishu-cli-import/references/- README 技能清单从 28 收敛到 25
skills/feishu-cli-chat/scripts/fetch_chat_history.py显式--expand-threads=false避免与新默认行为双拉
📦 安装
```bash
curl -fsSL https://raw.githubusercontent.com/riba2534/feishu-cli/main/install.sh | bash
```
🙏 致谢
完整变更
```
0dec77a docs(skill/chat): 脱敏 output-quirks.md 中的真实 App ID 和 open_id
1eafccb fix(comment): list/add/get/resolve 支持 User Token (#151)
46861cb fix(skill/chat): fetch_chat_history.py 显式关闭 expand-threads
f984189 feat(msg): history 自动展开线程回复(与官方 lark-cli 对齐)
c298b46 docs(skills): 同步 25 个 skill + CLAUDE.md + README.md 到 v1.27.1 现状
8587c0a fix(converter): normalizeURL 用 PathUnescape 修 round-trip 不等价 + 加回归测试
f00f6a3 fix(cli): root.go Long 补全 + --config warning + 清理冗余 Silence 设置
0a91e6f fix(profile): 修复 config-create-app 与 event daemon 跨 profile 隔离
8fcadd1 fix: 修复 v1.27.0 读类命令 token 策略回归
```