From 0647d547ffaba43ecca911f7057b7d60258cbdd3 Mon Sep 17 00:00:00 2001 From: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com> Date: Sat, 31 Oct 2026 12:05:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(ci):=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?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E5=9C=A8=E4=BD=9C=E4=B8=9A=E4=B8=AD=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E5=9B=BA=E5=AE=9A=20Vim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit alacritty-headless (windows-2025) 反复在「Build and test candidate shell on Windows」 失败。用 job API 取每步结论可定位到该步(无需日志),本地按同配置复现后原因明确: 'vim' is not recognized as an internal or external command shell scenario timeout — Ran 6 tests in 33.099s candidate-tui 场景会在真实 shell 里键入 vim 命令(shell.cpp:723),而 docs/research/joint-conpty-baseline.md:35 要求「需在 PATH 中显式提供固定 Vim」。 Git for Windows 的 vim.exe 位于 usr/bin,不在 hosted runner 默认 PATH,于是缺失 表现为 33 秒场景超时,而不是一条可读的失败原因。 两处修复: - run.py: candidate-tui 启动前检查 shutil.which('vim'),缺失立即 RuntimeError; 按 more-capture-ech.md「skip 不代替运行证据」,这里是失败而非 skip - core-candidate.yml: Windows 上把 Git 自带的 usr/bin 加入 GITHUB_PATH, 找不到则显式失败,保证该作业真的能跑 Vim 场景 --- .github/workflows/core-candidate.yml | 13 +++++++++++++ experiments/shell/run.py | 16 ++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/.github/workflows/core-candidate.yml b/.github/workflows/core-candidate.yml index 9f56ba18..f41effe0 100644 --- a/.github/workflows/core-candidate.yml +++ b/.github/workflows/core-candidate.yml @@ -85,6 +85,19 @@ jobs: run: cmake --build build --config Release --target core_measure - name: Build and test candidate C++ adapter run: cmake --build build --config Release --target candidate_core_test && ctest --test-dir build -C Release -R candidate_core --output-on-failure + - name: Provide fixed Vim from Git for Windows + if: runner.os == 'Windows' + shell: bash + run: | + exec_path="$(git --exec-path)" + for candidate in "$exec_path/../../../usr/bin" "$exec_path/../../usr/bin"; do + if [ -f "$candidate/vim.exe" ]; then + echo "$(cd "$candidate" && pwd)" >> "$GITHUB_PATH" + exit 0 + fi + done + echo "fixed Vim is required on PATH for candidate-tui; see docs/research/joint-conpty-baseline.md" >&2 + exit 1 - name: Build and test candidate shell on Windows if: runner.os == 'Windows' run: cmake --build build --config Release --target shell_test_launcher && ctest --test-dir build -C Release -R candidate_shell_tui --output-on-failure 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) From 91a06bce6706eb5e60238c78bc050f2b53d057ac Mon Sep 17 00:00:00 2001 From: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com> Date: Sat, 31 Oct 2026 12:27:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?revert:=20=E7=A7=BB=E9=99=A4=20workflow=20?= =?UTF-8?q?=E7=9A=84=20Vim=20=E8=B7=AF=E5=BE=84=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #269 的 CI 结果是决定性的:该 PR 不含本步骤,两个 alacritty Windows 作业仍然 5m50s / 6m05s 通过。也就是说 hosted runner 上 Vim 本来就在 PATH,真正的失败 一直是 route_terminal_events 对 kind 8/9/10/11/13 抛异常,而不是缺 Vim。 本步骤因此没有依据,还引入一个新失败面(Git 安装位置变化时 exit 1)。 保留 run.py 的前置检查:它只在本地没有 Vim 时把 33 秒场景超时换成一条带文档 指引的即时失败,对 CI 无副作用。 --- .github/workflows/core-candidate.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/core-candidate.yml b/.github/workflows/core-candidate.yml index f41effe0..9f56ba18 100644 --- a/.github/workflows/core-candidate.yml +++ b/.github/workflows/core-candidate.yml @@ -85,19 +85,6 @@ jobs: run: cmake --build build --config Release --target core_measure - name: Build and test candidate C++ adapter run: cmake --build build --config Release --target candidate_core_test && ctest --test-dir build -C Release -R candidate_core --output-on-failure - - name: Provide fixed Vim from Git for Windows - if: runner.os == 'Windows' - shell: bash - run: | - exec_path="$(git --exec-path)" - for candidate in "$exec_path/../../../usr/bin" "$exec_path/../../usr/bin"; do - if [ -f "$candidate/vim.exe" ]; then - echo "$(cd "$candidate" && pwd)" >> "$GITHUB_PATH" - exit 0 - fi - done - echo "fixed Vim is required on PATH for candidate-tui; see docs/research/joint-conpty-baseline.md" >&2 - exit 1 - name: Build and test candidate shell on Windows if: runner.os == 'Windows' run: cmake --build build --config Release --target shell_test_launcher && ctest --test-dir build -C Release -R candidate_shell_tui --output-on-failure