Repository navigation
Conversation
- AskUserQuestion 的 options[].description 透传到 ask 卡片与 turn-reply 卡片, 按钮行下方列出「选项:说明」;IPC 侧校验类型与长度(bad_option_description), 重放判等纳入 description - botmux ask --mention <open_id>:卡片第一问前注入真实 <at>,被点名者能收到通知; daemon 按 peer cross-ref 与 bots-info 剔除 bot open_id,避免飞书 100290 整卡拒收 - mentionedOpenId 随持久化 ask 跨重启保留;IPC 中值为 null 的字段视为未提供 Co-Authored-By: Claude Code <[email protected]>
Codex Review SummaryThis 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: 7dbff48ba6
ℹ️ 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".
| sessionId: input.sessionId, | ||
| chatType: input.chatType, | ||
| answererOpenId: input.answererOpenId, | ||
| mentionedOpenId: input.mentionedOpenId, |
There was a problem hiding this comment.
Forward the parsed mention into the daemon ask input
For a normal botmux ask --mention ... request, handleAskRequest in src/daemon.ts reconstructs askInput without copying boundAsk.mentionedOpenId. Both registration branches receive that stripped object, so input.mentionedOpenId is undefined here even though the CLI and API parser accepted it. Consequently, neither renderer receives the requested mention, and the new flag does not notify its target. Forward the validated and bot-filtered ID when constructing the daemon's ask input.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c0e1d5f. The daemon now preserves mentionedOpenId; inline descriptions are capped against the card budget; mixed choice/input batches render descriptions. Focused ask suites: 140/140; build and diff-check pass.
| elements.push({ | ||
| tag: 'markdown', | ||
| text_size: 'notation', | ||
| content: described.map(option => `**${safe(option.label)}**:${safe(option.description!.trim())}`).join('\n'), |
There was a problem hiding this comment.
Include inline descriptions in the card byte budget
In unified reply-card mode, four questions with four options each and 600 Chinese characters per description are accepted by both hook adapters and question validation, but these elements already produce a request over 37 KB in a minimal envelope, exceeding the 30,000-byte limit. Unlike the standalone renderer, this path does not cap descriptions; buildTurnReplyCard only shrinks activity, and TurnReplyCardStore.update leaves the asks intact during its overflow retry before throwing Reply-card summary exceeds size limit. Previously deliverable asks therefore fail to publish. Include description blocks in the inline size-fitting fallback.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c0e1d5f. The daemon now preserves mentionedOpenId; inline descriptions are capped against the card budget; mixed choice/input batches render descriptions. Focused ask suites: 140/140; build and diff-check pass.
| const described = q.options.filter((opt) => opt.description?.trim()); | ||
| if (described.length > 0) { |
There was a problem hiding this comment.
Display descriptions in mixed choice and input batches
When a --questions-file batch combines a choice question with an input field or an inputMode: 'text' question, the newly accepted option descriptions are silently omitted. The form branch delegates to buildAskFormElements, which never reads descriptions, while the text-reply branch skips this block; buildTurnReplyAskElements has the same omissions. Adding a follow-up input therefore hides the explanation of an otherwise identical choice. Render descriptions in the form and text-reply paths as well as the button-only path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c0e1d5f. The daemon now preserves mentionedOpenId; inline descriptions are capped against the card budget; mixed choice/input batches render descriptions. Focused ask suites: 140/140; build and diff-check pass.
Co-Authored-By: Claude Code <[email protected]>
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
混合题型卡片会把选项说明逐行渲染;行为断言分别验证两个选项仍可见,不钉旧分隔符。 Co-Authored-By: Claude Code <[email protected]>
|
自动评审初评(最终以维护者复审为准)。已把分支基于最新 master 重新 rebase(无冲突), 1.(P2)承诺的「daemon 剔除 bot open_id」没有实现, PR 描述、ask 技能文档( 按本 PR 自己的断言,这会触发飞书整卡拒收,ask 卡片发不出去。建议在 2.(P2)form 批次( Codex 上轮的 P2-3 只修了一半:
实测:一个含「带 description 的选择题 + 一个 text input」的合法 questions-file,两种卡里都搜不到说明文本和 at 标签。建议在 3.(P2)standalone 卡的选项说明没有总量预算,合法载荷可把卡片撑过 30KB 导致发送失败 turn-reply 路径这次加了每条 400 字、全卡 2000 字总预算;standalone 路径( 4.(P3,渲染面不一致)standalone 卡的 text-reply 混合批次也不显示说明
5.(P3,测试缺口)
次要项(不阻断,供参考):
本地验证:rebase 到最新 |
结构护栏改为定位 createAskInput(boundAsk),继续验证会话身份绑定先于可观测 ask 注册,不钉内联对象实现。 Co-Authored-By: Claude Code <[email protected]>
|
二轮评审合并意见(初评 + 一轮独立探针/变异复核后的最终清单):0 P1 / 4 P2 / 6 P3,仍不可合,需作者再改一版。 下列每条都在 rebase 到当前 master 的代码上重新复现过;第 1~3 条即上一条评论的三项,范围和修法有修正/升级,第 4 条起为新增。 P2(阻断)1. 2. form 批次(questions-file 选择题 + 输入框)里选项说明不渲染,且 3. 溢出时预算分配优先级反了:被牺牲的是审批正文,而说明不受预算约束。 4.(新增)hook 来源的 description 超 1000 字会让整个 ask 降级成终端原生 picker。 P3(应随本 PR 修)5.(新增) 建议修法顺序
验证基线:rebase 到最新 master 无冲突; |
|
补充第三轮(针对新 head 5.(新增 P2,身份安全护栏被削弱) 6.(新增 P2) 当前 head 的 CI 11 项全绿,但绿只说明测试与构建通过;评审阻断项仍为 0 P1 / 6 P2 / 6 P3,需要作者动 src 后重新提交。 |
|
实现附则(接前面三轮清单,最终 0 P1 / 6 P2 / 10 P3;本条只把几条修法收紧,避免返工): A. 第 6 条( B. 第 3 条(预算)按「改分配优先级」实现,不要新叠一个固定总量上限。 C. 第 4 条(hook 来源 clamp)不要在 D. 两条既有测试在修完后必须仍绿(修法边界):
另:该用例里的 |
|
预算修法的测量口径与边界用例(接第四条附则 B;最终清单 0 P1 / 6 P2 / 12 P3,新增两条测试口径提示): E. 判断「正文保住」只能看
因此实现上推荐**「渲染→用 F. 预算回归用例必须用真实长度的夹具,否则边界会被测宽。 G. 以上数字均在 rebase 到当前 master 的代码上用 |
|
第六评,新增 1 条 P2、1 条 P3,并修正上一条里的一个成本常数。最新合计 0 P1 / 7 P2 / 13 P3(src 仍 0 改动,以下数字均在 rebase 到当前 master 的代码上实测)。 7.(新增 P2,内容丢失)选项说明被 400 字硬截断后,剩余内容在系统任何出口都不存在——与预算无关。
13.(新增 P3)settle(已作答)后的 PATCH 卡把选项说明整块丢掉。 成本常数更正:每个说明块的固定开销约 83 B(短 label)/ 113 B(真实中文 label),不是 30 B。 建议把第 2、3、7、13 条作为一处设计一次改完(分开改会互相返工):
其余条目(身份收口五字段 Omit、hook 来源 clampDescription 显式参数、渲染面 at 口径只收 label/description、代理对保护、 |
|
第七评:新增 1 条 P3(N15)、两处修法范围/顺序说明。最新合计 0 P1 / 7 P2 / 14 P3(src 仍 0 改动)。 N15(新增 P3)文档 ask(私聊送达)与 H. 第 2 条(form 卡补说明块)与第 3 条(预算重分配)必须同一批改,不能先补渲染。 I. 第 7 条(N13)只需改渲染与附件,持久化侧不用动(已实测确认)。 最终阻断项仍为 7 条 P2(bot/外应用 ou_ 剔除、form 批次 description+mention 丢失且须与预算同批改、预算优先级与正文优先分配、hook 超长 description 改 clamp、身份来源断言恢复、 |
|
第八评:新增 1 条 P2(N16)、1 条 P3(N17),并更正前几评里一处风险面描述。最新合计 0 P1 / 8 P2 / 15 P3(src 仍 0 改动;以下数据均在 rebase 到当前 master 的代码上独立实测)。 N16(新增 P2)带 description 的 hook ask 在典型用法下就会被 3000B 准入门挤出 turn-reply 内嵌,落到本 PR 尚未修好的 standalone 路径。
模型在 AskUserQuestion 的选项说明里写一两句中文(30–60 字)是常态,所以本 PR 的描述功能在 hook 主路径上大概率落到 standalone——而那正是第 3 条(预算)、第 7 条(N13 截断无出口)、第 13 条(N14 settle 消失)所在的渲染面。这不是边角组合,是功能主路径的有效性问题,故按 P2 处理。 配套事实(独立扫描确认):
修法取舍(二选一,建议前者):
N17(新增 P3)一条选项说明内部多行时,与下一选项之间没有分隔,视觉串行。 N13 措辞边界补准:400 字截断后,完整内容在持久化(put/list 整对象 JSON,往返无损)与 broker 的 阻断项更新为 8 条 P2(新增 N16),P3 15 条(新增 N17),其余条目以前七评为准。 |
|
第九评:两条实现边界澄清,不新增阻断项,清单维持 0 P1 / 8 P2 / 15 P3(其中第 13 条 N14 的修法范围按下述第 1 点收窄理解)。 1. 第 13 条(settle 后保留说明)的修法只上提 description,不要把 mention 前缀一起提到结算卡。 2. 第 3 条(预算重分配)与第 7 条(N13 附件)要保留并扩展现有 prompt 截断语义,不要误判现状。
其余 8 条 P2 / 15 条 P3 以前八评为准;作者改完后请在新 head 跑构建、ask 相关测试与预算边界用例(envelope 字节 + |
|
第十评:不新增条目,给第 3 条(P2-3)补一个必须一并处理的失败形状。清单维持 0 P1 / 8 P2 / 15 P3。 「正文截到 0 仍超限」时会产生孤儿附件(本 PR 让该形状变得可达)。 |
|
第十一条(对上一条措辞的精确化,不改任何结论与分级,仍为 0 P1 / 8 P2 / 15 P3): 上一条说「description 出现前,这个分支基本不可达」表述不够准确,更正为:「问题正文超长 → 截断 → 附完整正文附件」这条路径一直存在、可用且已有测试覆盖(长 prompt 的 ask 正常走它);此前基本不可达的只是其中「卡被选项说明撑到 30KB 以上」这一个触发源——没有 description 时要靠异常多的选项或超长 label 才凑得够。 这对实现的含义是:第 3 条与上一条不需要新写一套截断/附件机制,复用现有已验证的 prompt 截断与附件链路即可,新工作只有三件——①让 description 进入同一份预算参与退档;②附件正文补上完整 description、触发条件加上「任一说明触顶」;③发附件前先对最终卡做 fit 判定,避免卡片确定性拒收(230099/100290 均为不重试的 400)后,已发出的附件成为群里永久残留(dispatcher 在附件与卡片发送之间没有撤回动作)的无按钮孤儿。 |
|
感谢贡献!原分支不允许维护者推送,又与 master 有冲突,所以维护者另开了 #3181 接管本 PR:#3181
|
改了什么
AskUserQuestion与 OpenCodequestion的options[].description现在一路透传到 ask 卡片和 turn-reply 卡片,在按钮行下方以「选项:说明」列出。没有 description 时整块不渲染,旧调用方的卡片不变。bad_option_description;空白说明归一化为未提供。questionsShape)把 description 纳入比较。只改了说明的同一问题不会误复用旧卡片。botmux ask --mention <open_id>:ask 卡片不像botmux send的回复那样天然 @ 触发者,不点名时没人收到通知。加--mention后,卡片第一问前注入真实<at>。ou_xxx和ou_xxx:显示名两种写法。非ou_形态由 CLI 直接 exit 2,不请求 daemon。bots-info.json剔除 bot 的 open_id,避免飞书 100290 整卡拒收。mentionedOpenId随持久化 ask 跨重启保留,重发的卡片仍带通知。--mention的用法。null的字段视为未提供,不再触发unsupported_fields。为什么
影响面
core/ask-*(api / args / broker / types / persist-store / questions / hook)、im/lark/ask-card.ts、im/lark/turn-reply-ask-elements.ts、daemon.ts(mention 发卡前过滤)、cli.ts、i18n、ask 技能定义。--mention、不带 description 时,渲染结果与现在一致。botmux ask都覆盖。XPI 宿主 ask 的「指定成员」中性标签逻辑没有改。测试验证
新增用例覆盖:
parseAskMention接受和拒绝的形态;<at>,不传 mention 时不渲染;--mention透传,以及非法值 exit 2。截图:卡片 UI 截图待补(draft 期间补上)。
🤖 Generated with Claude Code