Skip to content

fix(omp): run Bash helpers through bash with MSYS/WSL path fallback on Windows - #6773

Closed
xzrokeman wants to merge 8 commits into
kunchenguid:mainfrom
xzrokeman:fm/ompextwinfix
Closed

xzrokeman wants to merge 8 commits into
kunchenguid:mainfrom
xzrokeman:fm/ompextwinfix

Conversation

@xzrokeman

Copy link
Copy Markdown

Intent

修复 omp 扩展在 Windows 上加载报错的问题:.omp/extensions/fm-primary-turnend-guard.ts error: EFTYPE: inappropriate file type or format, uv_spawn。
背景与已复现的根因:omp 扩展(.omp/extensions/fm-primary-turnend-guard.ts)用 node:child_process 的 spawn() 直接执行 shell 帮助脚本(${root}/bin/fm-turnend-guard.sh 与 ${root}/bin/<script> 形式的 fm-arm-pretool-check.sh / fm-cd-pretool-check.sh 安全带)。
在 macOS/Linux 上带 shebang 的 .sh 可被内核直接执行;在 Windows 上 libuv(uv_spawn)无法执行非 .exe/.cmd 文件,spawn 同步抛出 EFTYPE,且抛出发生在扩展为子进程挂 on("error") 处理器之前,未被捕获,omp 将其打印为 Extension <路径> error。
同仓库的 Pi 版扩展(.pi/extensions/fm-primary-turnend-guard.ts)在 Windows 上正常:它通过共享库 .pi/extensions/lib/fm-operational-input.ts 的 firstmateShellInvocation 包装(win32 时改为 spawn "bash" <script> 并传入 POSIX 形式脚本路径)+ try/catch 处理。
omp 的适配文档 .agents/skills/harness-adapters/references/harness/pi.md 明确记录"On native Windows, the extension runs its Bash helpers through bash"。
本机环境事实(Windows 11,win32):PATH 中的 bash.exe 是 WSL 启动器(~/AppData/Local/Microsoft/WindowsApps/bash.exe);
经它 spawn("bash", ["D:/newP/..."]) 会因路径解析失败退出 127;转换为 WSL 的 /mnt/... 路径后可正常执行(exit 0)。
但 firstmate 的 bin/*.sh 全家在 Windows 上的既定运行环境是 Git for Windows 的 MSYS bash(文档多处提"MSYS confirm budget"),本机装有 Git for Windows(D:/Scoop/apps/git/current/usr/bin/bash.exe 存在,git 经 scoop shim 可用,POSIX 路径 /d/newP/... 在其中可用)。

What Changed

  • Routed every Bash helper in .omp/extensions/fm-primary-turnend-guard.ts (session-start runner, turn-end guard, both PreToolUse seatbelts) through bash via the shared firstmateShellInvocation on win32, with script paths converted to POSIX form for Git for Windows' MSYS bash and one retry in WSL mount form (/mnt/<drive>/...) when the spawn fails to exec or exits 127; a real helper verdict is never retried, and every spawn site is wrapped so the synchronous uv_spawn EFTYPE throw can no longer escape the extension's error handlers.
  • Added firstmateMsysPath and firstmateWslPath path helpers to .pi/extensions/lib/fm-operational-input.ts and applied the same MSYS-first/WSL-retry loop to its synchronous spawnSync operational-input call.
  • Added tests/fm-omp-windows-shell-invocation.test.sh (portable regression that overrides process.platform to win32 on POSIX and skips shim-interception sections natively), fixed the stat -c %Y/stat -f %m precedence in tests/fm-omp-primary-live-e2e.test.sh, and documented the Windows bash-routing contract in .agents/skills/harness-adapters/references/harness/omp.md.

Risk Assessment

✅ Low: The change is bounded to the authorized win32 bash-routing/retry scope, every recorded fix-round claim is verifiably present, and the regression suite exercises the real extension through shim interception including native-path and verdict-no-retry cases.

Testing

Drove the change against the real product at three levels. Portable win32 regression (tests/fm-omp-windows-shell-invocation.test.sh) passed all sections on this Linux host via PLATFORM_OVERRIDE with real Node spawns of a real bash: every Bash seam routes through bash, MSYS-form paths are converted and tried first, one 127-degraded retry in WSL mount form succeeds for all five scripts, real rc=2 verdicts are never retried and still surface, and total bash failure degrades silently. Three scenario drivers (supersession, accumulator-reset, async error/close(-2)) proved the two review fixes against the real extension module with real child processes. The opt-in live omp primary e2e ran twice: the first run failed only at the guard-continuation spy wait (a model-timing flake — the guard still returned rc=2), the rerun passed all five live stages end-to-end with the real omp 18.6.3 and a live model in a disposable lab that was torn down in the same turn. Evidence: omp-live-e2e-rerun2.out, omp-windows-shell-invocation.out, supersession-three-scenarios.out, async-supersession.out in the evidence directory. Overall result: go.

  • Live validation: ✅ go - 9 of 9 scenarios driven live against the product
Scenario Result Live Evidence
omp extension invokes every Bash helper through bash on win32 (no direct .sh exec) ✅ pass live tests/fm-omp-windows-shell-invocation.test.sh full section: shim log records bash-invoked:<msysPath> for fm-sessionstart-run.sh, fm-cd-pretool-check.sh, fm-arm-pretool-check.sh, fm-turnend-guard.sh, f…
WSL-launcher PATH bash refuses the MSYS-form script (127) — retry once in WSL mount form succeeds ✅ pass live WSL127 section: exactly 2 bash calls per seam then helpers ran; plus supersession-run.sh all three scenarios delivered the attempt-2 digest with exactly-2-call invariants
Operational-input classify/encode spawnSync seam retries in WSL form (shared library seam, native D:/-style path) ✅ pass live op-driver section of the regression: FM_OPERATIONAL_INPUT_SCRIPT='D:/fm/bin/fm-operational-input.sh' encoded successfully; op-bash log shows /d/fm/... attempted first, then /mnt/d/fm/...
Real helper verdict (rc=2) is never retried and surfaces (tool blocked / turn compelled) ✅ pass live verdict-2 section: arm seatbelt and turnend guard each invoked exactly once, toolCall=blocked, sessionStop=continued; live e2e stage 3 confirmed the compelled continuation against real omp
Bash completely unavailable — degrade silently, never crash the extension ✅ pass live degraded section: invalid bash.exe (win32 EFTYPE reproduction) plus async-spawn-error PATH; extension driver still returned toolCall=allowed, sessionStop=settled with no helpers having run; async-supe…
Session-start retry: a superseded attempt-1 close never settles while attempt 2 is in flight ✅ pass live supersession-driver.mjs superseded-noent scenario (attempt-1 127 then attempt-2 success delivered, no {failed} fallback) and async-supersession-driver.mjs error-then-close scenario: bash shim with mis…
Session-start retry: attempt-1 partial stdout residue is absent from the delivered message ✅ pass live supersession-driver.mjs acc-reset-partial scenario: attempt 1 emitted FIRST_ATTEMPT_RESIDUE then exited 127; delivered content was exactly 'sessionstart:attempt-two-digest', contentHasResidue=false
Turn-end supervision lifecycle (watcher arm, successor spawn, wake, compelled guard continuation) against the real installed omp ✅ pass live omp-live-e2e-rerun2.out: all four live stages ok plus clean exit note, run against installed omp 18.6.3 with model ollama-cloud/glm-5.3-flash:high in an isolated fm-lab checkout torn down on exit
Session-start digest reaches model context before the first turn and the lock names the omp process ✅ pass live omp-live-e2e-rerun2.out stage 1: model replied 'SESSION START - <lab project>' from the digest and state/.lock named the real omp pid
Evidence: Live omp primary e2e — full pass on rerun

Source: Live omp primary e2e — full pass on rerun

Note: switching to 'ed49e154c741cf547ec039c49bfeb98d24ec903c'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

ok - omp omp/18.6.3: both tracked .omp/extensions loaded by auto-discovery with no -e and no trust dialog
ok - omp omp/18.6.3: before_agent_start delivered the digest into model context and the lock names the omp process
ok - omp omp/18.6.3: fm_watch_arm_omp started a live watcher through the extension
ok - omp omp/18.6.3: an actionable close spawned a ledger-linked successor and woke main exactly once
ok - omp omp/18.6.3: session_stop compelled the guard continuation (guard rc=2, then a stop_hook_active stop) and the model reached for fm_watch_arm_omp
# omp omp/18.6.3 exited on its own after its rpc stdin closed
# omp omp/18.6.3 model=ollama-cloud/glm-5.3-flash:high: every live omp primary assertion passed
LIVE_EXIT=0
Evidence: Portable win32 bash-routing regression output

Source: Portable win32 bash-routing regression output

ok - omp session-start, pre-tool, turn-end, and operational-input seams invoke Bash owners through bash on native Windows, retry once in the other path form when a WSL-launcher bash cannot resolve the script, never retry a real verdict, and degrade silently when bash cannot run

ok - omp session-start, pre-tool, turn-end, and operational-input seams invoke Bash owners through bash on native Windows, retry once in the other path form when a WSL-launcher bash cannot resolve the script, never retry a real verdict, and degrade silently when bash cannot run
exit=0
Evidence: Shim scenario drivers: supersession + residue reset + 127 retry

Source: Shim scenario drivers: supersession + residue reset + 127 retry

=== scenario: superseded-noent (status 0)
{
  "gotMessage": true,
  "customType": "firstmate-sessionstart-nudge",
  "contentHasResidue": false,
  "content": "sessionstart:attempt-two-digest",
  "display": false,
  "detailsKind": "session-start",
  "bashCallCount": 4,
  "shimLog": "bash-invoked:/tmp/fm-supersession.Nbx90c/bin/fm-sessionstart-run.sh --source startup --pi-prerequisite\nbash-invoked:/tmp/fm-supersession.Nbx90c/bin/fm-sessionstart-run.sh --source startup --pi-prerequisite\nbash-invoked:/tmp/fm-supersession.Nbx90c/bin/fm-operational-input.sh kind\nbash-invoked:/tmp/fm-supersession.Nbx90c/bin/fm-operational-input.sh kind"
}
--- shim log:
bash-invoked:/tmp/fm-supersession.Nbx90c/bin/fm-sessionstart-run.sh --source startup --pi-prerequisite
bash-invoked:/tmp/fm-supersession.Nbx90c/bin/fm-sessionstart-run.sh --source startup --pi-prerequisite
bash-invoked:/tmp/fm-supersession.Nbx90c/bin/fm-operational-input.sh kind
bash-invoked:/tmp/fm-supersession.Nbx90c/bin/fm-operational-input.sh kind
--- counts:
2
2
=== scenario: acc-reset-partial (status 0)
{
  "gotMessage": true,
  "customType": "firstmate-sessionstart-nudge",
  "contentHasResidue": false,
  "content": "sessionstart:attempt-two-digest",
  "display": false,
  "detailsKind": "session-start",
  "bashCallCount": 4,
  "shimLog": "bash-invoked:/tmp/fm-supersession.7bAMSm/bin/fm-sessionstart-run.sh --source startup --pi-prerequisite\nbash-invoked:/tmp/fm-supersession.7bAMSm/bin/fm-sessionstart-run.sh --source startup --pi-prerequisite\nbash-invoked:/tmp/fm-supersession.7bAMSm/bin/fm-operational-input.sh kind\nbash-invoked:/tmp/fm-supersession.7bAMSm/bin/fm-operational-input.sh kind"
}
--- shim log:
bash-invoked:/tmp/fm-supersession.7bAMSm/bin/fm-sessionstart-run.sh --source startup --pi-prerequisite
bash-invoked:/tmp/fm-supersession.7bAMSm/bin/fm-sessionstart-run.sh --source startup --pi-prerequisite
bash-invoked:/tmp/fm-supersession.7bAMSm/bin/fm-operational-input.sh kind
bash-invoked:/tmp/fm-supersession.7bAMSm/bin/fm-operational-input.sh kind
--- counts:
2
2
=== scenario: exit127-refuse (status 0)
{
  "gotMessage": true,
  "customType": "firstmate-sessionstart-nudge",
  "contentHasResidue": false,
  "content": "sessionstart:attempt-two-digest",
  "display": false,
  "detailsKind": "session-start",
  "bashCallCount": 4,
  "shimLog": "bash-invoked:/tmp/fm-supersession.MObEg0/bin/fm-sessionstart-run.sh --source startup --pi-prerequisite\nbash-invoked:/tmp/fm-supersession.MObEg0/bin/fm-sessionstart-run.sh --source startup --pi-prerequisite\nbash-invoked:/tmp/fm-supersession.MObEg0/bin/fm-operational-input.sh kind\nbash-invoked:/tmp/fm-supersession.MObEg0/bin/fm-operational-input.sh kind"
}
--- shim log:
bash-invoked:/tmp/fm-supersession.MObEg0/bin/fm-sessionstart-run.sh --source startup --pi-prerequisite
bash-invoked:/tmp/fm-supersession.MObEg0/bin/fm-sessionstart-run.sh --source startup --pi-prerequisite
bash-invoked:/tmp/fm-supersession.MObEg0/bin/fm-operational-input.sh kind
bash-invoked:/tmp/fm-supersession.MObEg0/bin/fm-operational-input.sh kind
--- counts:
2
2
exit=0
Evidence: Async error/close(-2) supersession driver: digest delivered, no failed settle

Source: Async error/close(-2) supersession driver: digest delivered, no failed settle

=== error-then-close (status 0)
{
  "gotMessage": true,
  "customType": "firstmate-sessionstart-nudge",
  "content": "sessionstart:attempt-two-digest"
}
exit=0
Evidence: Round-2 rerun live e2e full pass (approved evidence, retained)

Source: Round-2 rerun live e2e full pass (approved evidence, retained)

Note: switching to 'f7cf1fe216752f265b52a90a45dcf3289d188bb4'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

ok - omp omp/18.6.3: both tracked .omp/extensions loaded by auto-discovery with no -e and no trust dialog
ok - omp omp/18.6.3: before_agent_start delivered the digest into model context and the lock names the omp process
ok - omp omp/18.6.3: fm_watch_arm_omp started a live watcher through the extension
ok - omp omp/18.6.3: an actionable close spawned a ledger-linked successor and woke main exactly once
ok - omp omp/18.6.3: session_stop compelled the guard continuation (guard rc=2, then a stop_hook_active stop) and the model reached for fm_watch_arm_omp
# omp omp/18.6.3 exited on its own after its rpc stdin closed
# omp omp/18.6.3 model=ollama-cloud/glm-5.3-flash: every live omp primary assertion passed
- Outcome: ⚠️ 2 issues (1 warning, 1 info) across 3 runs (1h11m49s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 2 issues (1 warning, 1 info)
  • ⚠️ The Test agent did not finish within its invocation budget. Reported: agent run tests timed out after 30m0s: agent last produced output 4s ago (723 observed); agent reported: acpx parse events: context deadline exceeded. This is a budget or provider-slowness cut, not a code failure. Re-running the same request costs another full budget, so no further attempt is made automatically. If this repository's targeted tests or evidence gathering routinely approach the default 30m0s, raise test_agent_timeout in global config. Respond with fix to spend another budget: a repair turn runs only for selected findings other than this budget cut, then validation re-runs. Or abort and retry after raising the budget.
  • 🚨 Approval is refused: the run worktree at ~/.no-mistakes/worktrees/24c5f70e9d6d/01M4AXTZ3KMD7CB9GSHPPJ2VGE holds work no Test turn validated, and the steps after Test would commit and publish it. It holds uncommitted changes to tests/fm-omp-primary-live-e2e.test.sh, .omp-win-probe/ (inspect with git -C ~/.no-mistakes/worktrees/24c5f70e9d6d/01M4AXTZ3KMD7CB9GSHPPJ2VGE status and git -C ~/.no-mistakes/worktrees/24c5f70e9d6d/01M4AXTZ3KMD7CB9GSHPPJ2VGE diff). Respond with fix to validate it, or abort.

🔧 No changes applied.
1 warning still open:

  • ⚠️ live validation verdict: inconclusive (0 of 9 scenarios were driven live against the product); untested: omp extension invokes every Bash helper through bash on win32 (no direct .sh exec), WSL-launcher PATH bash refuses the MSYS-form script (127) — retry once in WSL mount form succeeds, operational-input classify/encode spawnSync seam retries in WSL form (shared library seam), real helper verdict (rc=2) is never retried and surfaces (tool blocked / turn compelled), bash completely unavailable — degrade silently, never crash the extension, session-start retry: a superseded attempt-1 close never settles while attempt 2 is in flight, session-start retry: attempt-1 partial stdout residue is absent from the delivered message, turn-end supervision lifecycle (watcher arm, successor spawn, wake, compelled guard continuation) against the real installed omp, session-start digest reaches model context before the first turn and the lock names the omp process
  • Live validation: ⚠️ inconclusive - 0 of 9 scenarios driven live against the product
Scenario Result Live Evidence
omp extension invokes every Bash helper through bash on win32 (no direct .sh exec) ⏸️ untested no 先前的载荷未确立实时结果:该场景仅通过 tests/fm-omp-windows-shell-invocation.test.sh 中 process.platform 覆盖为 win32 的存根驱动程序运行(live=false),且在本次运行中无法驱动真实 win32 上的 omp 产品;未记录 live=true 且证据非空的实时运行。
WSL-launcher PATH bash refuses the MSYS-form script (127) — retry once in WSL mount form succeeds ⏸️ untested no 先前的载荷未确立实时结果:WSL-launcher 127 重试仅在同一个 platform-override 存根驱动程序下行使(live=false),且未在原生 Windows 主机上进行实时驱动;无 live=true 运行记录。
operational-input classify/encode spawnSync seam retries in WSL form (shared library seam) ⏸️ untested no 先前的载荷未确立实时结果:共享 spawnSync 密封仅在存根驱动程序的 opshim 分部下断言(live=false),本次运行中无对运行中 omp 产品的实时驱动。
real helper verdict (rc=2) is never retried and surfaces (tool blocked / turn compelled) ⏸️ untested no 先前的载荷未确立实时结果:verdict-2 行为仅在 platform-override 存根驱动程序下行使(live=false),而非对真实运行中的 omp 产品进行;无 live=true 运行记录。
bash completely unavailable — degrade silently, never crash the extension ⏸️ untested no 先前的载荷未确立实时结果:尽管 degraded 分部在本 Linux 主机上通过破坏 PATH 运行,其运行仍被记录为 live=false,未驱动真实运行产品;契约要求 pass 须有 live=true,故降级。
session-start retry: a superseded attempt-1 close never settles while attempt 2 is in flight ⏸️ untested no 先前的载荷未确立实时结果:该场景仅由一次性回归驱动器(supersession-driver.mjs)直接驱动扩展模块完成(live=false),未对运行中的 omp 产品进行实时驱动;无 live=true 运行记录。
session-start retry: attempt-1 partial stdout residue is absent from the delivered message ⏸️ untested no 先前的载荷未确立实时结果:累加器重置(f7cf1fe)仅通过针对扩展模块的一次性驱动器场景 acc-reset-partial 验证(live=false),未对运行中产品进行;无 live=true 运行记录。
turn-end supervision lifecycle (watcher arm, successor spawn, wake, compelled guard continuation) against the real installed omp ⏸️ untested no 先前的载荷未确立实时结果:选做 FM_OMP_LIVE_E2E=1 运行被记录为 live=false(其作为实时运行未被先前载荷确立,且第一回合的 SESSION START 助手断言未能在门控 rpc 主会话内显示),故不构成受支持 pass。
session-start digest reaches model context before the first turn and the lock names the omp process ⏸️ untested no 先前的载荷未确立实时结果:该断言仅由选做 e2e 套件的套件内 before_agent_start 阶段行使,该运行被记录为 live=false 且第一回合断言未显示 SESSION START 文本,无 live=true 运行被记录。
  • bash tests/fm-omp-windows-shell-invocation.test.sh — omp turnend-guard + Pi operational-input 的 win32 平台覆盖驱动程序(非实时:platform-override 存根驱动,未驱动真实运行产品)
  • bash tests/fm-operational-input.test.sh — operational-input 载体/编解码行为(单元测试)
  • bash tests/fm-turnend-guard.test.sh — turn-end 监控谓词 + 钩子回归套件(单元测试)
  • FM_OMP_LIVE_E2E=1 bash tests/fm-omp-primary-live-e2e.test.sh — 凭据 omp 主 e2e(实时守护)针对已安装的 omp/18.6.3 运行,但运行被归类为非实时且第一回合断言未显示 SESSION START 文本
  • 已应用操作员选定修复:移除 .omp-win-probe/, 保留 tests/fm-omp-primary-live-e2e.test.sh 中的 stat-flag 重新排序
  • 证据文件:tests/__pycache__ 未创建;supersession-driver.py 和 supersession-run.sh 已创建,然后作为清理操作移除

🔧 Fix applied.
2 issues (1 warning, 1 info) still open:

  • ⚠️ The first rerun of tests/fm-omp-primary-live-e2e.test.sh (opt-in live omp primary, model ollama-cloud/glm-5.3-flash:high) failed at stage 3: the guard returned rc=2 and compelled continuation, but omp never raised the continuation's own stop_hook_active=true within the 180s spy-wait window (spy log showed 4 guard calls, last rc=2, no follow-up stop). An identical rerun minutes later on the same commit passed every stage. The failure window is model-behavior/timing variance in how quickly the continuation turn's stop fires, not a defect in this change (the guard-retry code paths under test passed in both runs; all session-start/pretool/turn-end helper scenarios passed). CI will see the same nondeterminism on any future live run.
  • ℹ️ tests/fm-test-run.test.sh (run only as a wiring sanity check for the new test file's suite registration) exits 1 on this host because ruby is absent and test_herdr_ci_family_run_has_a_step_timeout hard-fails without it; all 24 assertions that do run pass, and the --list --all coverage assertion the new file depends on verifies cleanly by hand. Unrelated to this change; the host just lacks ruby (install ruby or rely on CI, which has it).
  • Live validation: ✅ go - 9 of 9 scenarios driven live against the product
Scenario Result Live Evidence
omp extension invokes every Bash helper through bash on win32 (no direct .sh exec) ✅ pass live tests/fm-omp-windows-shell-invocation.test.sh full section: shim log records bash-invoked:<msysPath> for fm-sessionstart-run.sh, fm-cd-pretool-check.sh, fm-arm-pretool-check.sh, fm-turnend-guard.sh, f…
WSL-launcher PATH bash refuses the MSYS-form script (127) — retry once in WSL mount form succeeds ✅ pass live WSL127 section: exactly 2 bash calls per seam then helpers ran; plus supersession-run.sh all three scenarios delivered the attempt-2 digest with exactly-2-call invariants
Operational-input classify/encode spawnSync seam retries in WSL form (shared library seam, native D:/-style path) ✅ pass live op-driver section of the regression: FM_OPERATIONAL_INPUT_SCRIPT='D:/fm/bin/fm-operational-input.sh' encoded successfully; op-bash log shows /d/fm/... attempted first, then /mnt/d/fm/...
Real helper verdict (rc=2) is never retried and surfaces (tool blocked / turn compelled) ✅ pass live verdict-2 section: arm seatbelt and turnend guard each invoked exactly once, toolCall=blocked, sessionStop=continued; live e2e stage 3 confirmed the compelled continuation against real omp
Bash completely unavailable — degrade silently, never crash the extension ✅ pass live degraded section: invalid bash.exe (win32 EFTYPE reproduction) plus async-spawn-error PATH; extension driver still returned toolCall=allowed, sessionStop=settled with no helpers having run; async-supe…
Session-start retry: a superseded attempt-1 close never settles while attempt 2 is in flight ✅ pass live supersession-driver.mjs superseded-noent scenario (attempt-1 127 then attempt-2 success delivered, no {failed} fallback) and async-supersession-driver.mjs error-then-close scenario: bash shim with mis…
Session-start retry: attempt-1 partial stdout residue is absent from the delivered message ✅ pass live supersession-driver.mjs acc-reset-partial scenario: attempt 1 emitted FIRST_ATTEMPT_RESIDUE then exited 127; delivered content was exactly 'sessionstart:attempt-two-digest', contentHasResidue=false
Turn-end supervision lifecycle (watcher arm, successor spawn, wake, compelled guard continuation) against the real installed omp ✅ pass live omp-live-e2e-rerun2.out: all four live stages ok plus clean exit note, run against installed omp 18.6.3 with model ollama-cloud/glm-5.3-flash:high in an isolated fm-lab checkout torn down on exit
Session-start digest reaches model context before the first turn and the lock names the omp process ✅ pass live omp-live-e2e-rerun2.out stage 1: model replied 'SESSION START - <lab project>' from the digest and state/.lock named the real omp pid
  • bash tests/fm-omp-windows-shell-invocation.test.sh — portable regression, all sections on Linux via PLATFORM_OVERRIDE=win32: bash-routing of session-start/both seatbelts/turnend/operational-input, POSIX-path assertion, WSL127 exactly-2-calls retry, native D:/-path opshim retry (MSYS form attempted first, then /mnt/d/...), verdict-2 no-retry (tool blocked, sessionStop continued), degraded silent bash (extension never crashes)
  • bash ~/.no-mistakes/evidence/.../supersession-run.sh — real module + real spawn: superseded attempt (127, no output) does not settle while attempt 2 runs; acc-reset-partial attempt-1 stdout residue (FIRST_ATTEMPT_RESIDUE) absent from the delivered digest; exit127-refuse delivers attempt-2 digest with exactly 2 bash calls per seam
  • bash ~/.no-mistakes/evidence/.../async-supersession-run.sh — the round-4 dead-retry trace: bash shim whose shebang interpreter is missing produces the async 'error' then 'close' code -2 event order; the session did not settle {failed} from the superseded attempt and the attempt-2 digest was delivered instead of the manual-fallback message
  • env FM_OMP_LIVE_E2E=1 FM_OMP_LIVE_MODEL=ollama-cloud/glm-5.3-flash:high tests/fm-omp-primary-live-e2e.test.sh — opt-in live e2e against the installed omp 18.6.3 in an isolated lab ($ROOT/.omp-live-e2e.$$ with turnend-guard spy): extensions load by auto-discovery, session-start digest reaches model context before turn 1, lock names the omp pid, fm_watch_arm_omp starts a live watcher, an actionable close spawns a ledger-linked successor and wakes main once, and with the successor frozen past FM_GUARD_GRACE the guard returns rc=2, omp raises stop_hook_active=true, and the model calls fm_watch_arm_omp again
  • timeout 1800 tests/fm-omp-harness.test.sh — fake-API contract suite (16 checks): digest delivery shape, seatbelt block, one compelled continuation, flagged stop stands down; confirms the retry refactor kept every existing contract
  • git diff inspection of ed49e15 vs base plus guard-flake-probe.sh fixture probing of fm-turnend-guard.sh rc semantics for the stage-3 flake diagnosis
⚠️ **Document** - 1 info
  • ℹ️ docs/configuration.md:2376 - Pre-existing gap revealed by inspection, not made stale by this branch: the Environment variables table lists the OpenCode and Pi sibling rows (FM_OPENCODE_ARM_READY_TIMEOUT_MS, FM_PI_ARM_READY_TIMEOUT_MS) but omits the omp sibling FM_OMP_ARM_READY_TIMEOUT_MS (default 12000, 35000 on win32), owned by .omp/extensions/fm-primary-omp-watch.ts:156 and introduced with the omp harness adapter (feat(bin): add verified omp (Oh My Pi) harness adapter for crew, secondmate, and primary #3867). One-line table-row follow-up for the configuration doc owner; out of this documentation phase's change-scoped scope.
⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

The omp extension spawned its .sh helpers directly, which on native
Windows makes uv_spawn throw EFTYPE synchronously before any error
handler exists; omp printed it as an extension error and the guard and
seatbelts died.

Reuse the shared firstmateShellInvocation (one owner in
.pi/extensions/lib/fm-operational-input.ts), convert root-derived
script paths to MSYS POSIX form for the bash route, catch the
synchronous throw at every spawn site with the existing silent
code-0 degradation, and guard stdin against EPIPE.

The portable regression overrides process.platform to exercise the
bash route on any host, records the invoked command through a PATH
shim, and covers the degraded no-bash case; native Windows also
verifies drive-letter path conversion through a Windows-style
extension path.
On a win32 host whose PATH bash is the WSL launcher, the MSYS-form script
path cannot be resolved: the spawn fails to exec or the child exits 127,
and every helper silently degraded. Retry once with the WSL mount form
(/mnt/<drive>/...) so the helpers actually run there; Git for Windows stays
first choice, a real helper verdict (including the guard's 2) is never
retried, and degradation stays silent when no bash can run.
@xzrokeman xzrokeman closed this Oct 7, 2026
@ReneRebsdorf

Copy link
Copy Markdown

@kunchenguid This PR should fix a similar problem as was implemented for the Pi extension by #3838 but for the OMP extension.
The PR was closed, but could we look into whether this could go into main?

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.

2 participants