From bb1fb33ab3341ce8c8085ee054b38d8814460421 Mon Sep 17 00:00:00 2001 From: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com> Date: Sat, 31 Oct 2026 12:16:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(shell):=20=E5=80=99=E9=80=89=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=99=A8=E7=9A=84=E5=89=AA=E8=B4=B4=E6=9D=BF/?= =?UTF-8?q?=E9=A2=9C=E8=89=B2/=E5=B0=BA=E5=AF=B8/=E5=AD=90=E9=80=80?= =?UTF-8?q?=E5=87=BA=E4=BA=8B=E4=BB=B6=E4=B8=8D=E5=86=8D=E4=BD=BF=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #267 在 CI 上补上固定 Vim 后,candidate-tui 改用真实 Vim 运行,随即撞到下一条: stage=50 … screen 中 [New] 与 READY 都已就位 unsupported terminal event kind 该串只在 shell.cpp:826 抛出。对照 ffi.rs:326-342 的完整映射,候选适配器会发出 1-13 全部 13 种事件,而本处只处理 1,2,3,4,5,6,7,12,于是 8(ClipboardStore)、 9(ClipboardLoad)、10(ColorRequest)、11(TextAreaSizeRequest)、13(ChildExit) 任何一种都会让整个场景中止。 本修改补齐 8/9/13,并把 10/11 一并列为忽略:该 harness 比较的是文字、模式与 生命周期,不拥有剪贴板,退出码从 session 读取,这些通知对它没有语义。default 分支保留,未来新增 kind 仍会明确失败而不是被静默吞掉。 验证:本机装上与 CI 同源的 Vim 9.1(Git for Windows usr/bin)后, candidate_shell_tui 与 candidate_core 均通过;1-13 现已全部有分支覆盖。 --- experiments/shell/shell.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/experiments/shell/shell.cpp b/experiments/shell/shell.cpp index 94d14d7d..29aa6e1f 100644 --- a/experiments/shell/shell.cpp +++ b/experiments/shell/shell.cpp @@ -821,8 +821,13 @@ class ShellWindow { case 2: terminal_title_ = utf16(event.bytes); break; case 3: terminal_title_.clear(); break; case 4: MessageBeep(MB_OK); break; - case 5: case 7: case 12: break; + case 5: case 7: case 10: case 11: case 12: break; case 6: begin_close(); break; + // The candidate adapter also reports clipboard traffic (8, 9) and the + // child's exit status (13). This harness compares text, modes and + // lifecycle; it owns no clipboard and reads the exit code from the + // session, so these are drained instead of failing the scenario. + case 8: case 9: case 13: break; default: throw std::runtime_error("unsupported terminal event kind"); } } From fc14fee7f1434726c95e1750f9cbc3b03bea8037 Mon Sep 17 00:00:00 2001 From: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com> Date: Sat, 31 Oct 2026 12:33:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(shell):=20candidate-tui=20=E7=BC=BA?= =?UTF-8?q?=E5=B0=91=20Vim=20=E6=97=B6=E5=BF=AB=E9=80=9F=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 并入 #267 的可用部分:candidate-tui 会在真实 shell 里键入 Vim 命令,缺少 Vim 时 不应跑满 33 秒场景超时,而应立即给出带文档指引的失败。 按 more-capture-ech.md「可选依赖缺失导致的 skip 不代替运行证据」,这里是失败 而不是 skip。与事件分派修复同属 candidate-tui 场景的健壮性,故并入本 PR;#267 的 workflow 部分已被证伪并移除。 --- experiments/shell/run.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/experiments/shell/run.py b/experiments/shell/run.py index a4878c4d..dc054577 100644 --- a/experiments/shell/run.py +++ b/experiments/shell/run.py @@ -40,6 +40,21 @@ } +def require_fixed_vim(mode): + """candidate-tui types a Vim command into the real shell, so Vim must be on PATH. + + Without this check a missing Vim surfaces as a 33-second scenario timeout whose + only trace is the shell echoing "not recognized as an internal or external + command"; the requirement itself is documented in + docs/research/joint-conpty-baseline.md and is a failure, not a skippable + optional dependency (docs/research/more-capture-ech.md). + """ + if mode == "candidate-tui" and shutil.which("vim") is None: + raise RuntimeError( + "candidate-tui drives Vim inside the shell but no fixed Vim is on PATH; " + "see docs/research/joint-conpty-baseline.md") + + def validate(row, mode): if mode in WORKSPACE_DATA_MODES: closed = 3 if mode in ("ui-workspace-save", "ui-workspace-restore") else 0 if mode == "ui-workspace-empty" else 1 @@ -430,6 +445,7 @@ def close(self, record=None): def execute(exe, mode, out, timeout=40, settings_source=None, *, resources=False): if mode in ("ui-paste-system", "ui-clipboard-system", "ui-copy-system", "ui-copy-bytes-system", "ui-copy-context-system", "ui-actions-system"): require_hosted_clipboard(os.environ) + require_fixed_vim(mode) if resources and mode != "ui-workflow-sessions": raise ValueError("resource observation is limited to the bounded sessions workflow") out.mkdir(parents=True, exist_ok=False)