Skip to content

Probe Each Interpreter install.ps1 Tries Rather Than Taking the First One Found #4031

Closed

Description

@ptr727

Raised by the local strict review of the #1172 fix, on code that change did not touch.

host-setup/agent-safety/claude/install.ps1 picks its interpreter the way install.py did before #1172. Its python3 branch is taken because Get-Command finds the name, not because it runs. Its python branch probes with 2>$null and reads only the exit status against the major version 3, not the 3.11 floor.

Failing case. Take a Windows host with no py launcher, a working Python 3.12 python.exe on PATH, and the default WindowsApps python3 app execution alias. The wrapper hands install.py to the alias, which prints the Store message and exits 9009. Nothing installs, though a working python sits on PATH.

Fix shape. Do what install.sh now does under #1172. Run each candidate (py -3, python3, python) with a probe that prints a value only Python 3.11 or newer prints, compare the output, leave the probe's stderr visible, and fall through to the next candidate on a mismatch.

install.py itself now probes the launcher it writes into settings.json, so this affects which interpreter runs the installer, not which one the hooks are registered under.

Activity

  1. added
    pre-existing
    on Nov 10, 2026
  2. ptr727 commented on Nov 20, 2026

    @ptr727
    OwnerAuthor

    Backlog burndown question, 2026-11-19. The fix edits host-setup/agent-safety/claude/install.ps1, which is under host-setup/agent-safety/, so it needs the maintainer's approval before an attended run implements it. Do you approve the fix shape the issue states?

    Options

    1. Approve (recommended). Probe each candidate (py -3, python3, python) by running it with a probe only Python 3.11 or newer passes, leave the probe's stderr visible, and fall through on a mismatch, as install.sh does since Validate the Interpreter the Agent-Safety Installer Writes Into settings.json #1172. A Linux host writes it, and the Windows CI job verifies it with a test that drives install.ps1 against stub candidates (one exiting 9009, one working). The merge waits on the maintainer's diff read.
    2. Decline. A Windows host whose python3 is the Store alias keeps failing to install the kit although a working python is on PATH.

    Effect on work in flight: none.

  3. added
    decision
    on Nov 20, 2026
  4. ptr727 commented on Nov 20, 2026

    @ptr727
    OwnerAuthor

    Maintainer's answer, 2026-11-19 (backlog burndown): approved. Probe each candidate (py -3, python3, python) for Python 3.11 or newer, leave the probe's stderr visible, and fall through on a mismatch, as install.sh does since #1172. Verify through the Windows CI job with a test driving install.ps1 against stub candidates. The design is approved. Being under host-setup/agent-safety/, it needs an attended run, and merging its pull request waits on the maintainer's go-ahead after reading the diff.

  5. removed
    decision
    on Nov 20, 2026
  6. ptr727 commented on Nov 22, 2026

    @ptr727
    OwnerAuthor

    Backlog burndown claim (round 3, 2026-11-22): branch burndown/windows-ps1-probe-and-profile. Predicted files: host-setup/agent-safety/claude/install.ps1, new tests/test_install_ps1.py, host-setup/windows/install-tools.ps1, tests/test_install_agents.py (shared with #4113). No other group may edit these files while this claim stands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pre-existing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions