Skip to content

fix: feishu P2P 单聊入站和出站修复 - #1

Merged
LinekForge merged 1 commit into
LinekForge:mainfrom
lightallspiritthing:fix/feishu-p2p
Apr 17, 2026
Merged

fix: feishu P2P 单聊入站和出站修复#1
LinekForge merged 1 commit into
LinekForge:mainfrom
lightallspiritthing:fix/feishu-p2p

Conversation

@lightallspiritthing

@lightallspiritthing lightallspiritthing commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pushMessagefromIdchatIdoc_)改为 senderIdou_),修复 P2P 入站 allowlist 不匹配
  • send() 根据 to 前缀选择 --chat-id / --user-id,修复 P2P 出站 lark-cli 报错
  • 未处理事件类型 graceful ignore,避免 bot_p2p_chat_entered_v1 误判通道 degraded

Test

飞书 P2P 单聊测试:

  • 入站消息 allowlist 通过
  • 出站回复成功
  • 打开聊天窗口不再导致通道 degraded

- pushMessage fromId 从 chatId 改为 senderId(P2P 入站 allowlist 匹配)
- send() 根据 to 前缀选择 --chat-id 或 --user-id(P2P 出站 lark-cli 兼容)
- 未处理事件类型(如 bot_p2p_chat_entered_v1)graceful ignore 不计 error

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@LinekForge
LinekForge merged commit 5ef3b29 into LinekForge:main Apr 17, 2026
LinekForge added a commit that referenced this pull request Apr 17, 2026
Four documentation patches surfacing gotchas Light hit on her first
clean install — each would otherwise re-trap every new user.

README.md:
- Prerequisites: clarify bun must be on PATH. Default install puts bun
  at ~/.bun/bin which isn't on macOS default PATH. Without this,
  `fh` CLI and the MCP subprocess both fail to resolve bun.
- [!IMPORTANT] block for server:hub mode: approval_channels must be
  configured before use. Without it every Bash/Write/Edit is auto-denied
  (see S1 commit for the code-side hint path).
- [!NOTE] block for first-run MCP tool approval: CC default behavior,
  /allowed-tools to persist. Without this hint users see "消息进来了
  但回不出去" on first use and blame forge-hub.

配置.md 飞书 section:
- Three sequential developer-console traps:
  1. im.message.receive_v1 associated permissions must be enabled in
     the event panel separately — "permission management" isn't enough.
  2. Bot capability needs to be enabled under 应用能力 → 机器人.
  3. Event/permission changes require publishing a new version to take
     effect, not just save.
  Light spent significant time on #1; documenting all three now.

Co-authored-by: Forge <270260515+ForgeLinek@users.noreply.github.com>
LinekForge added a commit that referenced this pull request Apr 20, 2026
Credit external contributors from PR #1 / #2 / #3.

Co-authored-by: Forge <270260515+ForgeLinek@users.noreply.github.com>
LinekForge added a commit that referenced this pull request May 14, 2026
…rd, token rotation, canonical hash

Kai 全仓安全审查修复(P1 #1-#4 + P2 #5-#7):

- install 白名单保留 evidence/security-events/audit,升级不再丢证据
- 通道第一层未授权拦截接入 SecurityEventAggregator(HubAPI.recordSecurityEvent)
- Dashboard Origin guard 不再信任请求 Host,固定 localhost/127.0.0.1/[::1]
- token 轮换改为 temp file + rename 原子替换,失败 die 退出
- evidence entry hash 递归 canonical stringify,覆盖嵌套字段
- CLI fh hub ps / doctor 改用 fetch,token 不再进 curl argv
- WeChat context_token 写入移到 allowlist 之后

Co-authored-by: Kai <kai@codex.local>
Co-authored-by: Forge <270260515+ForgeLinek@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
LinekForge added a commit that referenced this pull request May 14, 2026
… engine path guard

Kai 安全全仓审核修复(P1 #1-#2 + P2 #3-#4):

- Native App: curl shell-out 全部改 URLSession,token 不再进 argv
- WeChat: allowlist 检查移到 extractContent 之前,未授权媒体不下载
- formatUnauthorizedNotice: displayName/senderId 走 sanitize 净化
- fh engine remove: 拒绝路径穿越(/、\、..),只匹配 engine.d 内 basename
- channel-plugin-guide 文档更新、echo.ts 示例更新
- 新增测试:未授权媒体不下载、notice 注入净化、路径穿越拒绝

Co-authored-by: Kai <kai@codex.local>
Co-authored-by: Forge <270260515+ForgeLinek@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
LinekForge added a commit that referenced this pull request May 14, 2026
…idence dedup, docs sync

Kai 全仓风险复审修复(P2 #1-#3 + P3 #4-#7):

- 安全事件告警前同步 flush,CLI 立即可查
- hub-client 区分 /health liveness 和 /status auth,401 不再误判为 Hub 未运行
- Native/Dashboard 通道选择:显式"全部通道"选项,零选择禁用
- 删除 Dashboard 未接通的 sendFile bridge(v1 = 发路径文本)
- stripMarkdown 移到可导出 helper,测试真实函数
- evidence 空 updateId 生成唯一 fallback,不再去重合并
- /status 暴露通道 stoppedReason,WeChat auth 判定改用稳定枚举
- SECURITY.md + 架构.md 同步更新

Co-authored-by: Kai <kai@codex.local>
Co-authored-by: Forge <270260515+ForgeLinek@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants