Repository navigation
fix(send): 统一续轮中的飞书强调格式提示 - #2716
Conversation
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: 66acf88a95
ℹ️ 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".
| expect(followUp).toContain('短进度优先纯文本'); | ||
| expect(followUp).toContain('强调仅包短词或无中文标点的短语'); | ||
| expect(followUp).toContain('标点和后文放在 `**` 外'); |
There was a problem hiding this comment.
Assert formatting delivery without pinning localized wording
Any harmless edit to ai.followup.feishu_safe_emphasis now breaks these literal substring assertions even when the correct fragment still reaches every input channel. This conflicts with the root AGENTS.md requirement “不钉文案和文档措辞”. Resolve the expected fragment via t() or use a unique override fixture, and assert its placement and context kind rather than copying the shipped Chinese sentences. Apply the same correction to the equivalent assertions added in the other two test files.
AGENTS.md reference: AGENTS.md:L149-L149
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in fcd0268. Tests now resolve the localized fragment through t() instead of copying shipped wording; bare transcript prompt consumers strip <botmux_formatting>, with dashboard and insight-preview regressions added. Focused suite: 202/202; build and diff-check pass.
| }); | ||
| // transcript + solo keeps the historical contract that visible content starts | ||
| // with the user's text. Hook mode still extracts this block into its sidecar. | ||
| if (formattingBlock && bare) blocks.push({ key: 'formatting', text: formattingBlock }); |
There was a problem hiding this comment.
Strip the new block when extracting bare transcript prompts
With inline injection, replyDelivery: 'transcript', and solo: true, this appends the formatting block without a <user_message> wrapper. The fallback extractor in src/services/insight/prompt.ts does not remove botmux_formatting, and the dashboard’s cleanPromptText in src/dashboard/web/insights.ts also leaves it intact. Consequently, a short follow-up such as 继续 appears in the insight timeline and conversation replay with the internal formatting instructions presented as part of the user’s request. Update those consumers alongside the new envelope tag so they retain only the actual user text.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in fcd0268. Tests now resolve the localized fragment through t() instead of copying shipped wording; bare transcript prompt consumers strip <botmux_formatting>, with dashboard and insight-preview regressions added. Focused suite: 202/202; build and diff-check pass.
在内置发送技能和有飞书传输的续轮中统一注入安全强调格式,并覆盖 inline、Claude hook sidecar 与 transcript 模式。noTransport 与零提示注入保持不变。 Co-Authored-By: Claude Code <[email protected]>
66acf88 to
fcd0268
Compare
|
你好,这个 PR 的自动评审群已建,麻烦点击链接加入群聊、查看评审意见并跟进后续修改: (本条为自动流程发出的提示消息) |
deepcoldy#2716 新增的 <botmux_formatting> 是续轮前置块:claude-family 等 injectsSessionContext 会话的续轮里它取代 <botmux_reminder> 成为首个 块,非注入式 CLI 的续轮里它插在 session_id/role 与 reminder 之间。 两处显式枚举的块清单漏登记: - resumable-session-discovery 的 BOTMUX_LEADING_BLOCK_TAGS:/clear 或 转写轮转后新文件首个存活用户回合是续轮时,botmux 自己的会话在 /adopt 列表里漏判成外部会话(矩阵实测 24 个 CLI × 多配置共 372 组 true→false,补标签后归零) - claude-code 的 BOTMUX_ENVELOPE_TAGS:无 <user_message> 的 bare/hook 形态下短消息的提交指纹被格式块占据,补登后指纹只含用户正文 补 5 条回归测试(发现 4 + 指纹 1),vitest/bun 双腿变异均咬红。 Co-Authored-By: Claude Code <[email protected]>
自动评审(首次 review,最终以维护者复审为准)整体方向没问题:新增的续轮格式提示在 inline / Claude hook sidecar / transcript / Codex App additionalContext / EBSD service-user 各路径接线一致,noTransport、mira、zero-injection、adopt 桥接的豁免口径与 P2(已修复):
|
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
复审补两个 P3: - bare(replyDelivery=transcript + solo)续轮刻意把 <botmux_formatting> 追加在用户正文之后且无 <user_message> 壳,三个「还原用户原文」的消费 者此前只剥标签不剥块体,内部格式提示混进可见文本:/rewind 轮次预览 (summarizeUserText)、恢复失败/重投卡片的任务行(userMessageExcerpt, 同时覆盖 ordinary-recovery-retry 的 2000 字摘出路径)、codex/traex 原生标题模型输入(extractBotmuxLarkNativeSessionTitlePrompt)。三处 在无壳兜底路径先整块剥掉该块。 - mir 走 normalizeMircliPrompt 自行展平信封,新块不在其摘要项里,模型 实际收不到格式提示:新增 summarizeFormatting,以 EBSD 同款 「Response formatting:」纯文本行透传;无信封兜底输入也剥掉该块, 不让原始 XML 漏给 mircli。mira 维持排除(自有 runner 协议)。 补 6 条回归测试(三展示面各 1 + mir 3),五处守卫 vitest/bun 双腿变异 均咬红。 Co-Authored-By: Claude Code <[email protected]>
复审两条 P3 已修(追加提交
|
复审第三轮:bare(replyDelivery=transcript + solo)续轮没有 <user_message> 壳,<botmux_formatting> 追加在用户正文之后;/adopt 发现侧不走泛标签剥离、直接 truncateTitle 的标题路径因此把内部提示 带进 picker 标题(选中后还会进新会话卡片与 resume 列表): - claude 家族历史扫描与 live enrich 共用 cleanUserPromptForTitle 入口,在此整块剥除(覆盖 fallbackTitle、herdr live title、 claudeFirstUserTurn.prompt) - codex/traex rollout 四个标题赋值点(canonical fallback、legacy event_msg title、history_mutation 与 response_item 的 weakTitle) 统一经 titleFromUserText 剥块后再 truncateTitle;只动标题赋值, 不参与首回合镜像绑定的 text 不变 - 抽出 utils/stripBotmuxDisplayBlocks 单一实现,上一轮三处展示面 (context-rewind、ordinary-recovery-notice、session-title)与 mir 无信封兜底改调它,消除正则重复 helper 范围只限 <botmux_formatting>:codex bare 形状里的前导 <session_id> 在 master 同形状下本就进标题(bare solo 不可识别的 既有缺口的一部分),不在本特性里扩大行为变化。 补 5 条端到端标题断言(claude 1 + rollout 4,含 traex 强弱两条 路径;codex 用例同时钉死 session_id 既有部分保留)。共享 helper 变异 9 处调用点测试全红,rollout/claude 两个接线旁路变异分别 4/1 红,vitest 与 bun 双腿一致。 Co-Authored-By: Claude Code <[email protected]>
复审第三轮:/adopt 标题消费点已补(追加提交
|
复审第四轮:grok 的 discoverGrokSessions 不走 claude 家族与 rollout 的标题入口,自己在 readFirstUserChunk 后直接 truncateTitle。grok 适配器 injectsSessionContext=true 且在结构化转写白名单,bare (replyDelivery=transcript + solo)续轮可达,形状与 claude 家族相同 (用户正文 + 追加在后的 <botmux_formatting>);来源结构识别只过滤 掉带完整信封的 opening,bare 漏判后标题会带上内部提示,显示在 /adopt picker。补调 stripBotmuxDisplayBlocks 后再截断,并加 discoverGrokSessions 端到端标题断言(无 generated_title、回退首个 用户块的夹具)。变异双腿咬红(vitest 1,bun 另加预存 /proc/fd 环境性 1 红)。 Co-Authored-By: Claude Code <[email protected]>
复审第四轮:grok /adopt 标题已补(追加提交
|
| 来源 | 适配器 | 标题出处 | 状态 |
|---|---|---|---|
discoverClaudeFamilySessions |
claude-code / genius(seed/relay 同系) | cleanUserPromptForTitle 共同入口 |
已剥(b9d4f4ae8) |
discoverRolloutSessions |
codex / traex | 4 个标题赋值点经 titleFromUserText |
已剥(b9d4f4ae8) |
discoverGrokSessions |
grok | 首提示回退标题 | 已剥(本次 6cf4800) |
discoverAntigravitySessions |
antigravity | truncateTitle(display) |
bare 不可达(不在转写白名单);send 完整信封在标题赋值前被来源识别丢弃;前置格式块已在 9b4652b 加入 BOTMUX_LEADING_BLOCK_TAGS |
| OpenCode v1/v2 | opencode / opencode2 | SQL title 列(CLI 自有摘要) |
非 prompt 文本,无关 |
| tmux/zellij/orca live pane | 各适配器 | 进程/窗格名 | 非 prompt 文本,无关 |
| pi/coco/mtr/hermes/cursor | — | 无 listResumableSessions 磁盘入口(仅 live pane) |
无 prompt 标题路径 |
claude 家族剩余两个 truncateTitle 是 Claude 自有的 customTitle/aiTitle(非注入轮文本);rollout 的 nativeMetadata.title 同理。dashboard cleanPromptText 与 insight safePromptPreview 的内联正则行为正确(浏览器 bundle 与 service 层各自内联),是否改调 helper 纯属整洁性,按复审意见不动。
定向 10 文件 352 过(唯一红为上述 grok /proc/fd 预存环境项);bunx tsc、bun run build 通过。
复审第五轮:traex 还有不经 rollout 解析的 DB 标题路径, RolloutSessionMetadata.title 在 discoverRolloutSessions 里优先于 rollout 推出的标题,上一轮的 titleFromUserText 对它无效: - normalizeTraexThreadDetails:threads.name/title 在 ≤0.207 库默认 就是首条 prompt,bare(transcript + solo)续轮的格式块因此进 picker resume 行;此 normalizer 同时喂 readTraexThreadTitle, herdr/tmux/zellij live pane 的 traexLiveTitle 一并覆盖。剥后 纯空白(标题整块都是内部块)按空标题处理 - findTraexThreadByPid:orca live 发现单独 SELECT threads.title/ first_user_message,不经 normalizer,两个可能镜像首 prompt 的 列统一过 stripBotmuxDisplayBlocks 后再截断 真实 SQLite 夹具 3 条断言(normalizer 三行 + reader e2e + orca pid 路径),两处守卫摘除 vitest/bun 双腿各 1 红。 Co-Authored-By: Claude Code <[email protected]>
复审第五轮:traex DB 标题两条路径已补(追加提交
|
| 展示位置 | 标题来源 | 状态 |
|---|---|---|
| /adopt 磁盘行:claude-code/genius | discoverClaudeFamilySessions,首提示走 cleanUserPromptForTitle;customTitle/aiTitle 是 Claude 自有标题 |
已剥 9b4652b/b9d4f4ae8 |
| /adopt 磁盘行:codex/traex rollout | rollout 4 赋值点 → titleFromUserText |
已剥 b9d4f4a |
| /adopt 磁盘行:traex DB 覆盖标题 | normalizeTraexThreadDetails → nativeMetadata.title(优先覆盖) |
已剥 本次 |
| /adopt 磁盘行:grok | discoverGrokSessions 自有标题 |
已剥 6cf4800 |
| /adopt 磁盘行:antigravity | send 完整信封标题前被来源识别丢弃;bare 不可达(零注入直返裸文本,不在转写白名单) | 无需改 |
| /adopt 磁盘行:opencode v1/v2 | SQL session.title,CLI 自有摘要列 |
非 prompt 文本 |
| /adopt live 行:herdr/tmux/zellij traex | traexLiveTitle → readTraexThreadTitle → normalizer |
已剥 本次 |
| /adopt live 行:orca traex | findTraexThreadByPid 自有 SELECT |
已剥 本次 |
| /adopt live 行:其它 | 手设 pane label / Claude TUI 终端标题 / orca terminal 名 | 非 prompt 文本 |
| /rewind 预览、恢复卡片、重投摘要 | summarizeUserText / userMessageExcerpt | 已剥 28a02de |
| 会话原生标题(spawn 时) | extractBotmuxLarkNativeSessionTitlePrompt | 已剥 28a02de |
| 提交确认指纹 | BOTMUX_ENVELOPE_TAGS | 已剥 9b4652b |
| dashboard insight / insight 预览 | 作者提交内联正则 | 作者已修 |
| mir 模型输入 | normalizeMircliPrompt 透传/剥块 | 已修 28a02de |
pi/coco/mtr/hermes/cursor 无 listResumableSessions 磁盘入口;worker-pool 两处会话标题走已修复的 extractBotmuxLarkNativeSessionTitlePrompt。
|
@wzono 感谢这个 PR,已合入 master( 想法和接线都很扎实:五条续轮模型输入路径(inline / Claude hook sidecar / transcript / Codex App additionalContext / EBSD service-user)的豁免口径与既有 reminder 一致,展示层清洗也随块补齐。评审过程中自动评审与维护者复审沿「新增信封块的下游消费点」这条线多轮收敛,维护者追加了五个修复提交(未改动你的原提交):
Follow-up(非本 PR 阻断):bare transcript-solo 续轮本身不带 botmux 结构特征、在 |
|
🚀 Released in v3.57.0 |
- prompt-builder:ebsd 信封自 deepcoldy#2716 起已带共享格式指引,期望值改用 feishuReplyPresentationGuidance。 - output-handoff-doc-provider:deliverFinalOutput 新引用的地址策略函数注入测试作用域。 - local-address-egress:bun 下一次性推进假时钟会先于首次发送的退避定时器,原用例永久挂起(CI 中被 SIGKILL),改为分步推进直到发送落定。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
改了什么
botmux-send指南中说明飞书安全强调格式<botmux_formatting>提示为什么
长生命周期会话的后续轮次不会重新获得完整首轮说明,容易重新生成飞书不稳定的强调格式。将短小、独立的格式提示放入各实际模型输入路径,可避免每轮重复整份发送说明。
影响面
只增加提示上下文,不修改消息渲染、发送 API、权限或持久状态。Codex App 使用 application-grade additional context;EBSD 保留原 service-user 安全信封,格式提示不会被解释为本地命令。
验证
bun run test -- test/prompt-builder.test.ts test/initial-user-turn-opening.test.ts test/codex-app-clean-prompt.test.ts:3 个测试文件、183 个测试全部通过bun run build:通过git diff --check origin/master...HEAD:通过🤖 Generated with Claude Code