Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d580e1a48c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const cardRoot = asyncInput || askTurnTarget?.mode !== 'thread' | ||
| ? undefined : { cardRootMessageId: askTurnTarget.rootMessageId }; |
There was a problem hiding this comment.
Honor the frozen topic when an inline Ask creates its card
With shared/chat routing, unified reply cards and native CoT enabled, the first Ask can arrive before the answer card has a messageId, because native CoT suppresses the start card. publishReplyCardAsk then creates it using ask.rootMessageId (src/core/turn-reply-ask.ts:74-78), posting it to the outer chat, but the newly retained cardRootMessageId restricts text answers to the original topic. A production-store/publisher probe confirms zero candidates for text at the delivered card's location, so those replies no longer settle the Ask. Make initial inline delivery honor the frozen root, or use standalone delivery when no card exists.
AGENTS.md reference: AGENTS.md:L152-L152
Useful? React with 👍 / 👎.
| larkAppId: p.larkAppId, | ||
| chatId: p.chatId, | ||
| rootMessageId: p.rootMessageId, | ||
| cardRootMessageId: p.cardRootMessageId, |
There was a problem hiding this comment.
Backfill topic roots when restoring pre-change Ask records
When upgrading with a chat-scoped Ask already pending in a topic, its existing v2 record lacks cardRootMessageId, because the previous writer omitted that field. Restore leaves it undefined, and registerAsk/reattachByRequest do not apply the reconnecting input's root, so the new matcher treats this topic Ask as outer-chat-only. A real-store restore/reconnect probe with a controlled clock produces zero original-topic candidates and one outer-chat candidate even when reconnect supplies the correct root. Legitimate topic answers now miss the Ask, while unrelated outer-chat text can settle it. Backfill from authoritative origin context or explicitly handle legacy unknown-location records before applying the new matching semantics.
AGENTS.md reference: AGENTS.md:L172-L172
Useful? React with 👍 / 👎.
自动评审初步意见(最终以维护者审阅为准)整体修复方向正确: 但独立核实时发现以下 2 个问题,建议修改后再合入: 1.(建议按 P2 处理)内嵌 Ask 首次发卡落点与文字捕获区背离
用真实 建议修法:让 2.(建议按 P3 处理)升级瞬间已在途的旧持久化记录缺少 cardRootMessageId旧版本 需要注意: 本地验证记录
|
复审确认(head
|
补充:问题 2(升级兼容)的两个实现边界进一步用真实 store/broker 探针核实后,原评论中问题 2 的修法需要收紧,补充如下: 边界一: 边界二:不能用「字段缺失」判定旧记录——新版群外层 Ask 落盘同样没有该属性。 建议的落地形态:
问题 1(P2)的建议修法不变: |
群外层
botmux ask等待时,同 Bot 同群其它话题的文字会被当成该 Ask 的自定义答案,原会话收不到这条指令。旧匹配把rootMessageId=null当成了跨话题通配符;chat/shared 模式还会将原始话题归入 chat anchor,所以只比较会话 anchor 仍会串答案。修复后,群外层 Ask 只接受群外层文字;发在话题 A 的 Ask 只接受 A 的文字。原始消息位置在路由折叠前保留,内嵌回复卡 Ask 同样保留发起 turn 的冻结话题,持久化与恢复保留该位置。私聊继续沿用连续会话的答复语义。
影响面为 Ask 文字候选查询、提问入口和重启恢复投影;不增加配置,不改变调用身份、按钮答复权限或卡片交互协议。
复现与探针证据
另用真实 broker 与可控时钟验证人工取消/换绑、部分持久化失败、超时与重试交叠,7/7 通过。摘掉新增守卫后,4 个新增用例失败。
验收覆盖
验证
从 master
ec8cf07767fac4c5ad08f887bb7d8660cb916811整理单独提交后执行:bun run build bun run test test/ask-broker.test.ts test/ask-dormant-hook-text-routing.test.ts test/ask-resume-restart.test.ts test/ask-waiter-lifecycle.test.ts test/ask-custom-reply-candidate.test.ts test/ask-custom-input.test.ts test/ask-chat-scope-turn-target.test.ts test/turn-reply-ask.test.ts test/ask-explicit-fsync-failure.test.ts test/explicit-ask-continuation.test.ts test/ask-hook-claude.test.ts test/ask-hook-opencode.test.ts test/ask-hook-dsh.test.ts test/ask-custom-adversarial.test.ts test/daemon-rename-route.test.ts git diff HEAD^ HEAD --check完整构建通过,15 文件 507/507 通过,无 unhandled errors,diff 检查通过。尚未部署,线上效果未验证。