You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
BotMux 3.14.0 的 chat-scope 会话可以把不同飞书话题的 turn 路由到同一个 session/worker。每轮回复的目标已经按 turn 冻结,因此新卡片会发到正确话题;但流式卡片清理仍按整个 session 执行。
实际表现是:
recallFrozenCards()撤回卡片 A。脱敏后的现场日志结构如下:
上游仓库限制外部账号创建 Issue,因此这里直接在 PR 中保留完整问题说明和修复。
根因
FrozenCard只保存messageId/content/title/...,没有保存卡片实际发往哪个飞书回复目标。streamCardId/streamCardNonce,但没有与其绑定的稳定回复目标。currentReplyTarget会被后来接受的 turn 覆盖,不能用它反推上一张 live card 的归属。recallFrozenCards()遍历并撤回 session 内全部旧卡片,所以会跨话题删除。共享 session/worker 是
chat/shared模式的既有语义;本 PR 只修复卡片被跨话题撤回,不改变会话上下文共享方式。修复
replyTargetKey,区分:plain:oc_*:群顶层消息;thread:om_*:话题内回复;quote:om_*:普通引用回复。recallFrozenCards()只撤回与新 live card 目标相同的旧卡片;其他话题的卡片继续保留,等该话题自己的下一张卡片成功发布后再清理。影响面
worker-pool流式卡片路径,对所有 CLI/后端共用;没有修改 CLI 输入、worker 调度或会话路由。验证
新增回归覆盖:
replyTargetKey可随 frozen-card store 完整持久化。全量
pnpm test在本机运行超过 180 秒后被超时终止;其中codex-app-runner.integration.test.ts有 42 个环境相关失败。上述受影响路径的定向测试和完整 build 均已通过。未切换 live daemon 到本 worktree,避免影响当前机器上其他正在运行的 BotMux 会话。
后续审查补充:会话迁移边界
进一步复核发现,
/relay和 mid-session/repo会复用同一个DaemonSession,但原实现只改写 Session/飞书锚点,旧话题的currentReplyTarget、turnReplyContexts、replyTargets、alias 和 live-card target key 仍可能留在运行态。replacement worker 的ready没有 turnId 时,这些旧状态可把新卡片或回复重新路由/标记到来源话题。本次补充修复:
/relay、卡片 repo switch、文本/reposwitch 三条生命周期路径。最新验证: