Repository navigation
fix: say how to update a pip install the gateway cannot auto-update - #38666
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Every item traces to #36220 or the existing spec rule that no badge points at a What this change shipsInventory (6 items) — 6 justifiedIntent: a pip, pipx or Windows install that cannot update itself tells its user to run
[FIRST-PRINCIPLES-REVIEWED] f504938 Description read[DESCRIPTION-READ] bf3785ce0766a617648cf36dcd2f676826d478cb227ab7105e502446de874195 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the pin check now comes first, in the same order as the update's own preflight, and the notify line names the step that already exists for that install shape. [DESIGN-REVIEWED] f504938 Description read[DESCRIPTION-READ] f2bb53e623901ef6ae70f272e4ba6f38c094870ea80443765b7133397c352da3 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
On a plain pip or pipx install the gateway logs at every update check that auto-update cannot apply, but not what to do, and its reason reads "only the managed venv updates itself unattended". The line now ends by pointing at `kirocrew update`, which prints the in-place upgrade and the restart for a pip environment and re-runs the installer for pipx. A host whose security policy pins the update source gets no step, since that command refuses there too. The wheel route now checks the pin first, as the update's own preflight does, so a pinned pip, pipx or Windows install reports the pin rather than its install shape. The two install-shape reasons say what they mean without "managed venv".
|
Rebased: main moved in
[operator: bolichen97] |
72deaaf to
f504938
Compare
Code change approver recommendation: A person should decideWhy: the decider estimates an 8% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier pending: being reviewed. The wheel route now checks the policy source pin first, the same order as wheel_apply.preflight_bases, which Tier: pending: being reviewed. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
I reviewed head f504938. The wheel route now checks the policy source pin first, in the same order as the update preflight and the kirocrew update wheel path, so a pinned pip, pipx or Windows install reports the pin and is not told to run a command the pin refuses. The new notify step only appears for an unpinned wheel install. MANAGED_BY_KIROCREW is wired through both the gateway import and the runtime module's manifest. The new parametrized test would fail on the base and passes here, along with the rest of the related update tests, and every CI check on this head is green, so nothing blocks.
Problem / Motivation
Goal: A pip or pipx install of Kiro Crew that the gateway cannot auto-update says, in plain words, to run
kirocrew update, and a host whose security policy pins the update source is told about the pin instead.On a plain
pip installinto a user-made venv, with auto-update on and a newer release out, the gateway logs at every update check:It names no step, and "managed venv" is an internal term a pip user cannot act on.
Why it matters
Everyone who installs with the install guide's
pipforms (and pipx, and Windows) sees this line at every start and has no way to learn from it how to update.kirocrew updatealready prints the right in-place command for that install shape, but nothing points at it.Not a goal
kirocrew updateprints or does.kirocrew update.What changed (motivation → approach → change)
The gateway already knew it could not update a pip or pipx install by itself, but it stopped at saying so.
kirocrew updateis the step that fits each of those installs: on a plain pip environment it prints the in-place upgrade command and the restart, and on pipx it re-runs the installer.So the gateway's notify line (
slack/gateway_runtime/update_schedule.py) now ends with; to update it, run `kirocrew update` from your own terminalon a wheel install. A host whose security policy pins the update source gets no step, becausekirocrew updaterefuses there too. For that to hold on every wheel install, the wheel route inplatform/update_capability.pychecks the pin first, the order the update's own preflight uses, so a pinned pip, pipx or Windows install reports the pin instead of its install shape. The two shape reasons the line quotes say what they mean without "managed venv":only the install script's own environment updates itself, not a pip or pipx install, and on Windowsthe install script's self-updating environment is macOS and Linux only. The cli spec's effect paragraph says the same.Backwards compatibility
Compatible: nothing that works today stops working. The route (
None) is the same for every input; what moves is which reason wins when a pinned wheel install also fails another check, and the wording of the two install-shape reasons, which the notify line and the version-compliance lines quote.Reader: src/kiro_crew/slack/gateway_runtime/update_schedule.py:_check_for_updates_legacy -- release -- below the policy's minimum version, a pinned pip, pipx or Windows install, and a pinned managed venv with no trusted
opensslor an unsafe CDN base, takes the existingeffect.blockedbranch, as any other pinned managed venv or git checkout already does: it logs "not applying" and lights no badge, where before it lit one with akirocrew updateorpip installhint that the pin refusesTests
test/test_update_check_install_aware_auto_apply.py::TestAutoUpdateEffect::test_a_wheel_install_that_only_notifies_says_how_to_update(pip-or-pipx, windows, pip-pinned-away): the step appears for an unpinned wheel install, not for a pinned one, and "managed venv" never appears. All three fail on the base.Determinism: the new test ran five times with
-n0(3 passed each run) and once with its three ids in reverse order (3 passed).Proof: PROVEN test/test_update_check_install_aware_auto_apply.py::TestAutoUpdateEffect::test_a_wheel_install_that_only_notifies_says_how_to_update[pip-or-pipx], test/test_update_check_install_aware_auto_apply.py::TestAutoUpdateEffect::test_a_wheel_install_that_only_notifies_says_how_to_update[windows], test/test_update_check_install_aware_auto_apply.py::TestAutoUpdateEffect::test_a_wheel_install_that_only_notifies_says_how_to_update[pip-pinned-away] (head 3451a4ef622a)
Manual verification
On Linux, with a wheel built from this patch and installed into a fresh
python3.12 -m venv, and the installed__version__lowered to 0.12.1 (the stable feed reports 0.12.2):… cannot apply it unattended (only the install script's own environment updates itself, not a pip or pipx install) — notifying instead; to update it, runkirocrew updatefrom your own terminal.kirocrew updatethen prints the plain-pip message, the in-place pinned-wheelpip installandkirocrew restart, and exits 1 with the version unchanged.security_policy.jsonwithupdates.source: "https://git.corp.example/platform/*"; confirmed loaded):… cannot apply it unattended (the update source is not the one the security policy pins) — notifying instead, with no step.kirocrew updaterefuses withUpdate blocked by security policy.auto_updatefalse: noAuto-update is online.The base was also reproduced on the released 0.12.1 wheel, which prints the old line with no step.
Real-machine verification
Machine: EC2 m7i.2xlarge, Ubuntu 24.04 x86_64, 8 vCPU / 32 GiB
Before (main c22557c):
kirocrew gateway --port <free port> --no-open --no-tunnel --no-cronsfrom the released 0.12.1 wheel in a fresh venv, auto-update on ->Auto-update is on, but this install (kirocrew) cannot apply it unattended (only the managed venv updates itself unattended) — notifying instead; the new test on that base fails 3 of 3.After (head f504938; the gateway runs used 3451a4ef622a, the same patch before clean rebases): the same command -> the line ends with
; to update it, run `kirocrew update` from your own terminal, and a pinned host gets the pin reason with no step (both quoted above). On head f504938's tree, on another machine of the same type: the new test 3 passed in each of 3 runs; 35 related test files 1725 passed, 1 failed, and that one (a host-git fixture self-check intest/test_host_git_repo_exec_neutralization.py) fails on main 5e49873 too.Cleanup: the gateway machine is terminated (describe-instances returns nothing for it); it had no key pair and no inbound rules.
Related Issues
Fixes #36220
Sibling sweep
Swept: git grep -n "managed venv" -- src/kiro_crew/platform/update_capability.py src/kiro_crew/slack/gateway_runtime/update_schedule.py
Sibling: src/kiro_crew/slack/gateway_runtime/update_schedule.py -- changed here
Sibling: src/kiro_crew/platform/update_capability.py -- changed here
Pattern harvest
Not generalizable: a single log line that lacked a remediation step, and one refusal order that did not match the preflight it mirrors.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commitsContribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.