Skip to content

fix(bridge): 支持无回复回合静默结束#554

Open
xiongz-c wants to merge 1 commit into
masterfrom
codex/no-reply-sentinel
Open

fix(bridge): 支持无回复回合静默结束#554
xiongz-c wants to merge 1 commit into
masterfrom
codex/no-reply-sentinel

Conversation

@xiongz-c

Copy link
Copy Markdown
Collaborator

背景 / 动机

Botmux 会在模型未调用 botmux send 时,将 transcript 中的 final answer 兜底转发到飞书,避免有价值的回答静默丢失。但当模型判断本轮无需回复、又在 final 中解释“保持沉默”时,这段解释仍会被 fallback 当成正常回答发出。

现有协议缺少一个机器可识别的“本轮正常完成但无需用户可见回复”结果;仅依靠“没信息量就不发”的自然语言提示无法与 final fallback 正确配合。

改动

  • 在中英文首轮 routing 提示和短 follow-up reminder 中加入精确静默协议:无需回复时不调用 botmux send,final 只输出 BOTMUX_NO_REPLY,且不解释沉默原因。
  • 非 adopt transcript bridge 对去除首尾空白后精确等于 BOTMUX_NO_REPLY 的 final 静默处理,同时仍保留 turn 完成语义。
  • 不做关键词或自然语言推断:包含 BOTMUX_NO_REPLY 的其他正文仍按正常 final 转发。
  • /adopt 会话保持原语义,不解释该标记,避免改变外部 CLI 会话的原生输出。

默认值 / 兼容性依据

无需新增配置,协议默认对 botmux-aware 的非 adopt 会话生效。原有 botmux send marker 门控和 transcript final fallback 均保留;只有精确 sentinel 命中时新增静默分支。

测试覆盖

  • 覆盖精确 sentinel(含首尾空白)静默、解释性正文不误吞、adopt 模式不解释 sentinel。
  • 覆盖 TraeX 首轮 system hints 和普通 follow-up reminder 均包含静默协议。
  • 回归 structured bridge queue、turn terminal 和 final-output delivery 相关路径。

验证

  • pnpm vitest run test/bridge-fallback-gate.test.ts test/prompt-builder.test.ts test/cli-adapters.test.ts:374 passed
  • pnpm vitest run test/codex-bridge-queue.test.ts test/bridge-final-output-retry.test.ts test/claude-turn-terminal-contract.test.ts:89 passed
  • 远端 Linux 隔离目录执行 5 个相关测试文件:424 passed
  • 本地及远端 Linux 隔离目录执行 pnpm build:通过
  • git diff --check:通过
  • pnpm test:9839 passed、22 skipped、8 failed;对其中持续失败的 4 个文件在本分支与未修改的 origin/master 上分别单进程复跑,均为相同的 7 个既有失败(172 passed、5 skipped),涉及 workflow 文件系统清理、distillation 环境及 VC meeting 测试,与本改动无差异

影响范围

改动涉及共享 prompt 文案与 transcript bridge fallback gate,覆盖 TraeX、Codex、CoCo、Claude 等使用该公共路径的非 adopt 会话。无需迁移配置,不改变显式 botmux send、普通 final fallback、adopt 会话或不使用 transcript bridge 的消息路径。

@xiongz-c
xiongz-c requested a review from deepcoldy as a code owner July 22, 2026 07:37
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.

1 participant