fix(bridge): 支持无回复回合静默结束#554
Open
xiongz-c wants to merge 1 commit into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 会在模型未调用
botmux send时,将 transcript 中的 final answer 兜底转发到飞书,避免有价值的回答静默丢失。但当模型判断本轮无需回复、又在 final 中解释“保持沉默”时,这段解释仍会被 fallback 当成正常回答发出。现有协议缺少一个机器可识别的“本轮正常完成但无需用户可见回复”结果;仅依靠“没信息量就不发”的自然语言提示无法与 final fallback 正确配合。
改动
botmux send,final 只输出BOTMUX_NO_REPLY,且不解释沉默原因。BOTMUX_NO_REPLY的 final 静默处理,同时仍保留 turn 完成语义。BOTMUX_NO_REPLY的其他正文仍按正常 final 转发。/adopt会话保持原语义,不解释该标记,避免改变外部 CLI 会话的原生输出。默认值 / 兼容性依据
无需新增配置,协议默认对 botmux-aware 的非 adopt 会话生效。原有
botmux sendmarker 门控和 transcript final fallback 均保留;只有精确 sentinel 命中时新增静默分支。测试覆盖
验证
pnpm vitest run test/bridge-fallback-gate.test.ts test/prompt-builder.test.ts test/cli-adapters.test.ts:374 passedpnpm vitest run test/codex-bridge-queue.test.ts test/bridge-final-output-retry.test.ts test/claude-turn-terminal-contract.test.ts:89 passedpnpm 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 的消息路径。