diff --git a/src/amplifier_app_opencode/prereqs.py b/src/amplifier_app_opencode/prereqs.py index f6ea9b1..50735e4 100644 --- a/src/amplifier_app_opencode/prereqs.py +++ b/src/amplifier_app_opencode/prereqs.py @@ -52,20 +52,27 @@ OPENCODE_INSTALL_SH = "https://opencode.ai/install" OPENCODE_NPM_PACKAGE = "opencode-ai" -# Minimum amplifier-agent version amplifier-opencode requires. >= 0.12.0 is the -# first version whose HTTP face honours `provider.config` from the host config -# we pass via `--host-config`. Below it, `serve` accepted the file but dropped -# that block on every turn, so `--host-config` silently did less than it does -# under `run` -- and `debug.rawLlmPayloads` is rejected outright as an unknown -# key. Since we document `--host-config` as the way to configure the engine, the -# floor has to be the version where it actually applies. -# (0.11.0 remains the floor for namespaced reseller model ids -# (`github-copilot/`), without which Copilot's `claude-sonnet-5` collides -# with the native anthropic provider's; 0.10.0 for `GET /v1/skills` and -# `GET /v1/modes`, which the skills and modes bridges read; 0.9.3 for -# `auth set --stdin`, which onboarding uses to hand the provider key to the -# agent off-argv. 0.12.0 subsumes all three.) -MIN_AGENT_VERSION = "0.12.0" +# Minimum amplifier-agent version amplifier-opencode requires. >= 0.14.0 is the +# first version whose `serve` lifecycle is correct on Windows. We drive `serve` +# for every turn, and below it three POSIX assumptions were wrong there. The +# damaging one: `os.kill(pid, 0)` was used as a benign liveness probe, but on +# Windows CPython maps `CTRL_C_EVENT` to `GenerateConsoleCtrlEvent`, and since +# `CTRL_C_EVENT == 0`, signal 0 delivers a real console Ctrl+C to the target's +# process group -- so `serve status` could interrupt the very server it was +# reporting on. `signal.SIGKILL` also does not exist on Windows and raised +# `AttributeError` when escalating a stop, and `start_new_session=True` is a +# POSIX-only way to detach a restart. 0.14.0 additionally stops refusing to +# write `serve.json` on Windows, where the 0600/0700 permission verification +# could never pass against NTFS. +# (0.12.0 remains the floor for `provider.config` being honoured from the host +# config we pass via `--host-config`, without which `serve` dropped that block +# on every turn and `debug.rawLlmPayloads` was rejected as an unknown key; +# 0.11.0 for namespaced reseller model ids (`github-copilot/`), without +# which Copilot's `claude-sonnet-5` collides with the native anthropic +# provider's; 0.10.0 for `GET /v1/skills` and `GET /v1/modes`, which the skills +# and modes bridges read; 0.9.3 for `auth set --stdin`, which onboarding uses to +# hand the provider key to the agent off-argv. 0.14.0 subsumes all four.) +MIN_AGENT_VERSION = "0.14.0" # The silent, launch-time auto-install/self-heal targets this exact known-good # git tag rather than a moving branch, so a reliability tool never drags users # onto un-vetted ``main``. Kept in lockstep with MIN_AGENT_VERSION: to adopt a diff --git a/tests/e2e/suites/onboarding/conftest.py b/tests/e2e/suites/onboarding/conftest.py index de52f24..18a5157 100644 --- a/tests/e2e/suites/onboarding/conftest.py +++ b/tests/e2e/suites/onboarding/conftest.py @@ -57,7 +57,7 @@ SENTINEL = "sk-e2e-SENTINEL-DO-NOT-LEAK-abc123" # Version the fake agent reports for ``--version``. Comfortably above -# ``prereqs.MIN_AGENT_VERSION`` (0.12.0 as of this writing) so the preflight's +# ``prereqs.MIN_AGENT_VERSION`` (0.14.0 as of this writing) so the preflight's # version-floor check passes without this suite needing to track that constant. FAKE_AGENT_VERSION = "99.0.0"