Repository navigation
fix(passthrough): Riff 后端判为无透传面,斜杠命令不再拆成两次远端任务 - #3080
Merged
Merged
Conversation
Riff 会话里的 /compact、/model 等透传命令走 raw_input,命令文本和回车各写一次, Riff 后端把每次写入都当成一个远端任务并在 prompt 前拼接 system 块, 命令到不了斜杠解析器,还绕过了普通消息封装。把 riff 加入无透传面集合, 这些命令改走普通消息路径。其他 CLI 的判定不变。
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
November 7, 2026 16:32
This was referenced Nov 7, 2026
deepcoldy
pushed a commit
that referenced
this pull request
Nov 7, 2026
按复审意见修订 #3133,仍仅文档与注释、零行为变化: - slash-commands 中/英:/fast 的 fail-closed 只在透传分支触发,真实 Riff (cliId=riff)的 /fast 在 #3080 后走 forward/unknown_slash、按普通消息封装, 原文「Riff 上 fail-closed 明确提示」与同节新增段落矛盾;改为 RPC 输入/Mojo 走透传被明确拒绝、Riff 按上一段普通消息处理 - passthrough-commands 注释:stale 形状(非 remote cliId + backend=riff)命中的是 reconcilePairedBackendId 第二条分支(丢弃 remote backend 回落默认/pty), 不是「remote cliId 钉同名后端」的第一条,按实测改准 - 设计文档无 raw 面名单顺手补全既有的 minimax 漏登 Co-Authored-By: Claude Code <[email protected]>
|
🚀 Released in v3.59.0 |
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.
Refs #839(本 PR 只做后端约束,合入后在 issue 里说明范围再手动关闭)
症状
Riff 会话里发
/compact、/model等透传命令(包括 bot 配置的customPassthroughCommands),daemon 按「原样透传」走raw_input:worker 先写命令文本,再单独写一次回车。Riff 后端把每一次写入都当成一个远端任务(首次创建任务,之后都是 follow-up),并在每个 prompt 前拼接 system 提示块,结果是:根因
判定「这个 CLI 能不能收敲进去的命令」的谓词
cliHasNoRawPassthroughSurface只登记了 codex-app / mira / mir / dsh / ebsd / minimax。Riff 没有本地 CLI,也没有终端输入面,但resolvePassthroughCommands仍对它返回完整的透传集合。修法
把
riff加入无透传面集合。Riff 会话的 cliId 和 backendType 在 spawn 时强制成对(riff↔riff,见remote-cli-ids),所以按 cliId 判定等价于按后端判定,不需要给谓词加参数。效果:Riff 会话里的这类命令改走和 codex-app 等相同的普通消息路径(一次远端任务、正常封装)。同一谓词驱动的
/slash列表、卡片压缩按钮的兑底拒绝、/model选择器一并对齐(卡片上的压缩按钮本来就对远端 CLI 隐藏)。Codex RPC 输入模式:不拦(真机结论)
在隔离环境(临时 HOME / CODEX_HOME、私有 tmux socket)用 codex-cli 0.164.0 复现 RPC 模式的形态:
codex app-server --listen ws://127.0.0.1:<port>,建线程并跑一轮;codex --remote <ws> -c check_for_update_on_startup=false resume --no-alt-screen <threadId>(与 worker 的面板参数一致);/compact(文本、间隔 200ms、回车)。app-server 随即在同一线程上开新 turn,出现
contextCompactionitem,约 3 秒后turn/completed status=completed,面板显示Context compacted。也就是说 RPC 模式的--remote面板能收/compact,本 PR 不改 RPC 会话的透传行为。对老用户零行为变化的依据
riff。谓词入参仍只有 cliId(以及 dsh 的 runtime),不读 backendType / codexRpcInput,所以非 Riff 会话的透传集合逐字不变。codex-app, dsh, ebsd, minimax, mir, mira, riff,即原有 6 个加 Riff,其他 CLI 的判定没有任何变化。codex)的/compact仍在透传集合里,有断言覆盖。/slash列表:已有 CLI 的未声明命令不会因此变成普通消息。验证
riff从集合里去掉后,两条新增测试失败;修复后通过。passthrough-commands、command-handler、card-builder-stop-compact、card-handler-stop-compact、command-router-oracle-diff、command-trigger-reserved-commands、app-slash-commands、slash-commands-doc-sync,8 个文件 711 条全部通过;bun 侧passthrough-commands14 条通过。tsc --noEmit、bun run build通过。