Skip to content

fix: 0.12.2 batch 6 (update fix, SageMaker option) and the 0.12.2 version - #35596

Merged
bolichen97 merged 8 commits into
release/0.12.0from
hotfix/0.12.2-batch6
Nov 11, 2026
Merged

bolichen97 merged 8 commits into
release/0.12.0from
hotfix/0.12.2-batch6

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Land the last 0.12.2 batch on release/0.12.0 (the update fix that never restarts a running gateway, the Decisions model SageMaker option and three more fixes from main) together with the bare 0.12.2 version and CHANGELOG, so v0.12.2-rc.1 can be tagged on the version commit.

These are our own fixes from main. Each is adapted to release's code and leaves out what needs code only on main; the adaptations are listed below.

Why it matters

0.12 users lose work today when an update restarts a running gateway (sessions between turns read as idle, and a clicked Update restarts at once). This batch makes an update take effect only when the person quits or restarts Kiro Crew. It also ships the Decisions model SageMaker option the internal edition needs, and the version commit the gate build tags.

Not a goal

  • No new behaviour on release beyond the listed fixes.
  • No tag and no release run in this PR; the tag is pushed after the merge.
  • No change to main; the 0.12.2 CHANGELOG section is ported to main when 0.12.2 reaches stable.

What changed (motivation → approach → change)

On release/0.12.0 at f8a8175029, in this order (rebase-merge keeps each commit):

# PR Fix
1 #34031 keep auth store writes and status reads off the event loop
2 #34643 always send a remote MCP server's oauth block to the KAS engine
3 #34749 say when KAS cannot sign in to a server with its own client
4 #34982 Decisions model: SageMaker endpoint option, refused hosted options hidden (with main's picker, which release lacked)
5 #35088 never restart a running gateway; apply an armed update at the next start
6 #35091 desktop: install updates on quit, never while the app runs
7 version 0.12.2 in the three version files and the ## [0.12.2] CHANGELOG section

Release adaptations: release's code is kept around each patch; main-only code the patch does not need is left out (for example main's ended About phase, main's upcoming-update notice, main-only locale keys, main-only imports in main.js and ipc-registrar.js). The sandbox pin numbers moved by the new update_next_start.json read-only leaf are re-derived for release (protected-name counts 328/335/336, package line budget 35,116) and the error-code baseline is regenerated on release. The only carried helper is the sessionCookieHeader import in website/electron/main.js, which release already exports.

Backwards compatibility

No config key, CLI flag or API is removed or renamed. POST /api/update now arms the update for the next start instead of applying it; a legacy force=true arms too. Every earlier CHANGELOG section is byte-identical.

Tests

The no-interrupt update smoke passed on the main heads of #35088 and #35091: Linux (AL2023) scenarios 1 to 7f and 9 to 9c, and the macOS desktop app built by CI (95 of 95 checks: D-a to D-d, 8e, 8f, 8g). On this branch, on a DevSpace: compileall and flake8 on the 102 changed Python files, an import of all 46 changed modules, locale JSON parse, node --check on the changed Electron files, and one run each of the pin files test_security_gate_liveness.py, test_sandbox_governance_mask.py and test_sandbox_protected_name_holds.py. The full suites run on the v0.12.2-rc.1 release run ("Test Release Candidate SHA") before any stable tag.

Proof: not provable -- other: a backport batch of main fixes, each proven in its own main PR

Manual verification

N/A: each fix was verified in its own main PR and by the update smoke above.

Screenshots / video

N/A: no visual change beyond what the main PRs showed.

Related Issues

0.12.2 hotfix, batch 6: #34031, #34643, #34749, #34982, #35088, #35091.

Pattern harvest

Not generalizable: a release backport batch, not a new defect fix.

Checklist

  • Each commit is a backport of a main commit with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

bolichen97 and others added 8 commits November 11, 2026 19:48
…34031)

On Windows hosts with on-access antivirus, a file open or stat can take
seconds, and the loop watchdog kills the gateway once the event loop is
silent for its exit budget. Three request paths parked the loop on disk:

- RevokedNonceStore held its dict lock across the denylist write
  (mkdir, open, owner-only lockdown, write, replace). The write runs on
  a worker thread, but is_revoked takes the same lock on the loop for
  every cookie request, so one slow sign-in write stalled the loop
  until the watchdog killed the gateway. The dict lock now covers dict
  operations only and a second lock serializes the writes; each writer
  snapshots under it, so the last write still carries every nonce.
- RefreshStateManager held its dict lock the same way across the
  refresh store write (staging, synced write, rename, directory sync).
  Rotation and revocation write on a worker, but GET /api/auth/me and
  POST /api/auth/refresh take that lock on the loop through
  validate_refresh_token and the refresh handler's checks. The lock now
  covers the snapshot and the degraded mark only. Every writer already
  holds _write_sequence_lock across its mutation and its write, so the
  writes stay ordered and the last one carries the newest state.
- status_snapshot read config.json (a stat and two opens) for the
  background-turn cap on every /api/status poll and WS or SSE status
  frame until the first unattended turn sized the cap's semaphore. The
  shared cached_status_snapshot funnel takes those stats in a worker,
  as it already does for the counts and the bundle id.

(cherry picked from commit 3eff86a)
Backports main's SageMaker picker to release/0.12.0, then #34982 at
its head ae6e747 on top, so a user can pick a SageMaker endpoint as
the Decision model in Settings and a ceiling hides what it refuses.

Carried from main (not on release):
- handlers/decisions_sagemaker.py as its own module, so decisions.py
  stays under the line cap: PRESET_SAGEMAKER, the sagemaker body and
  address builder, ProviderRefused, and the connection test route
  (POST /api/decisions/provider/sagemaker-test, registered in
  routes/system.py and the handlers facade)
- GET fields sagemaker and sagemaker_available, active "sagemaker"
- impl_sagemaker: build_endpoint, SageMakerAddressFieldError,
  boto3_installed, profile_exists, typed credential-provider and
  answer-stream errors, 63 character name and region bounds
- picker: SageMaker option and its name, region and profile inputs,
  Test connection, refusal sentences; client saveDecisionsSageMaker and
  testDecisionsSageMaker; DecisionsCard passes consent that stands for
  the configured endpoint
- i18n keys decisions_provider_sagemaker* in every locale
- user and spec docs, tests and picker vitest

From #34982 (ae6e747):
- hosted_permitted includes the ceiling endpoints list, and
  sagemaker_permitted probes the configured region, botocore
  sagemaker-runtime regions, then the static tuple with ca-west-1
- hosted Jev and SageMaker are hidden when refused
- the provider PUT answers 403 decisions_capability_denied for a
  refused hosted or regional host, and so does the consent PUT ON
- a refused or unset hosted default reads as active "none"
- capability.targets_denied point is str | None

Left out: the PR screenshots and capture script, and every unrelated
main change in the touched files.
Applies the delta between the earlier #34982 head and its merged
content (a54ae2d, head d599402): unaudited offer probes, the
configured_refused payload field and its picker and card reading, the
botocore region cache, the malformed-address 403, and the
decisions_hosted_refused string in 13 locales.

Release keeps its own wording in capability.py (Enterprise, not LTS).
#35088)

Backport of #35088 (head e655adb) onto release/0.12.0 for the 0.12.2
hotfix. A click arms the update; the apply runs at the next start, before
the gateway serves, and nothing restarts a running gateway.

Release adaptations: kept release surrounding code in the docs, locale
JSONs, FeaturePreviewsSection and AboutPanelUpdateFlow (no ended phase),
dropped files deleted on release, re-derived the sandbox pin numbers.
Backport of #35091 (head e858992) onto release/0.12.0 for the 0.12.2
hotfix, on top of the backport of #35088 whose decision entry its docs
link to.

Release adaptations: dropped the main-only relay Crew opener option,
chromium sandbox, find-bin and launch-services imports and the
client-only launch fallback probe site; kept sessionCookieHeader import
in main.js; dropped the desktopRestart test deleted on release.
Move the three version files to the bare 0.12.2 and add the [0.12.2]
CHANGELOG section for the hotfix backports merged on release/0.12.0
since v0.12.1, written from git log v0.12.1..release/0.12.0. The gate
build v0.12.2-rc.1 is tagged on this commit, as for 0.12.1-rc.3, so
the bare v0.12.2 can name it.

website/electron/package-lock.json stays as it is.
@github-actions

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/sandbox_leaves.py

  • src/kiro_crew/sandbox_precreate.py

  • src/kiro_crew/security/paths_lists.py

  • src/kiro_crew/security_posture.py

  • No reasoning template for 3dbc9db yet.

How to clear this check:

  1. The PR author posts the template below as a PR comment, with
    every field filled (N/A needs a reason). Keep the
    Head commit line: it must name the current head SHA.
  2. The check turns green within a minute, with no push.
  3. A new push resets this check: post it again for the new head.

Only the author's comment counts this way. A reviewer can instead
paste the filled template into an "Approve" review on this head.
Merging still needs a reviewer's approval.

## Sensitive change review
- Head commit: 3dbc9db00247b8032687a5a88f10a9ec3ca07c95
- What rule changed:
- Before -> after (what was allowed/blocked, now):
- Worst case if wrong (breaks commands / leaks secret / locks user out):
- Evidence checked (which sandbox result proves it):
- No regression:
  - Tools still work (which tools/commands were run, result):
  - Backward compatible (old config / old data / old callers still work, how checked):
  - Existing tests (which suites passed on this head):
- How to undo:

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 3dbc9db00247b8032687a5a88f10a9ec3ca07c95 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

The update change rewrites what a clicked Update does by default. Whether rfc-update-architecture.md (in-progress) covers "never restart a running gateway" is a judgement call, so it is a note rather than a block.

Notes

  • Item 1 — inherited: "POST /api/update now arms the update for the next start instead of applying it". The only recorded decision is docs/decisions/2026-11-10-updates-never-restart-a-running-gateway.md, and this diff adds it. The base RFC covers arming and "install on next quit" (lines 59, 652–666) but does not plainly cover every unattended path.
  • Item 4 — rides along: "a SageMaker endpoint option" is a new capability inside a fix: batch whose Not-a-goal says "No new behaviour on release beyond the listed fixes". It is declared, and the old options stay the default.

What this change ships

Inventory (9 items) — 7 justified

Intent: ship the 0.12.2 hotfixes so that updating 0.12 never kills live work, then tag rc.1 (FIX, a backport batch).

  1. Clicking Update arms it for the next start and no longer restarts — inherited
  2. Unattended paths (scheduler, stale-asset watchdog) no longer restart the gateway — justified
  3. The desktop app installs updates on quit, never while it runs — justified
  4. Decisions model gains a SageMaker endpoint option; refused hosted options are hidden — rides along
  5. Auth store writes and status reads move off the event loop — justified
  6. A remote MCP server's oauth block always reaches KAS — justified
  7. KAS says when it cannot sign in with its own client — justified
  8. New read-only sandbox leaf update_next_start.json — justified
  9. Version 0.12.2 and its CHANGELOG section — justified

[FIRST-PRINCIPLES-REVIEWED] 3dbc9db

Description read

[DESCRIPTION-READ] 49d9eadd7acdaa54df5d9b03866f30f7010c2d375237ec7965ed6d09260a64c1

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@bolichen97
bolichen97 marked this pull request as ready for review November 11, 2026 21:21
@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 11, 2026 21:21
@bolichen97
bolichen97 requested review from buluoray and removed request for a team November 11, 2026 21:21
@bolichen97
bolichen97 merged commit 3d06d46 into release/0.12.0 Nov 11, 2026
13 of 25 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Security Scope Review -- 🔴 could not complete (fails closed)

No scope verdict for 3dbc9db00247b8032687a5a88f10a9ec3ca07c95 (the candidate stage failed). This lane fails CLOSED: an unmeasured tightening must not read as "nothing newly refused". See the job logs, then re-run -- or record /ai-review override scope 3dbc9db00247b8032687a5a88f10a9ec3ca07c95 <class>: <reason> if a human has judged the scope by hand.

@bolichen97
bolichen97 deleted the hotfix/0.12.2-batch6 branch November 11, 2026 21:21
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — 🔴 changes requested (blocking)

GPT 6.1 found at least one blocking issue that must be resolved before merging 3dbc9db00247b8032687a5a88f10a9ec3ca07c95. Adjudication upheld 3 of 3 blocking finding(s); those must be resolved before merging.

This comment is updated in place on each push.

BLOCKING -- src/kiro_crew/update_boot_apply.py:199 -- Policy-governed desktop updates never consume their arm

if hosted_by_desktop():
Trigger: On a desktop-hosted gateway with a policy-defined apply command, the owner clicks Update through the policy-managed About controls; /api/update records the arm, then the owner quits and reopens the app.
Outcome: Gateway boot skips the arm, while Electron’s startup and quit handlers also stand down for policy-governed installs. The selected apply command never runs, leaving the update pending across subsequent starts.
Anchor: defect
Fix: Give the desktop owner a policy-provider apply path after gateway shutdown or before gateway startup, while preserving the prohibition on running the marker command over a policy provider.

BLOCKING -- website/src/hooks/useInstallDispatch.ts:42 -- Desktop Restart now interrupts running work without confirmation

const result = await relaunch()
Trigger: With an armed desktop update and an active turn or task, the owner clicks Restart now in About or UpdateModal; this hook invokes update:relaunch, which quits the app and stops its gateway.
Outcome: Running work is interrupted without the work-in-flight warning and opportunity to decline provided by the gateway restart flow.
Anchor: defect
Fix: Check running work and obtain the shared restart confirmation before invoking desktop relaunch; treat declining as a quiet cancellation.

BLOCKING -- website/electron/runtime/update/managed-lane.js:243 -- Cancelling a mirrored update leaves Electron armed

} else if (adoptedFromGateway && updateArm.read()) {
Trigger: With automatic updates disabled, the owner arms a managed desktop update through managedInstall(), which successfully mirrors the arm to the gateway, then cancels it from the browser About panel. Polling sees the cancellation, but adoptedFromGateway remains false.
Outcome: The gateway acknowledges cancellation, yet Electron retains its arm and executes the update command when the owner quits.
Anchor: defect
Fix: Track successfully mirrored arms as gateway-linked and reconcile their cancellation before quit-time application, rather than withdrawing only arms originally created by polling.

[BLOCK-MERGE] 3dbc9db
[GPT-REVIEWED] 3dbc9db

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1: MEDIUM. A feature is broken on a whole class of installs. I confirmed boot skips an armed update when the desktop hosts the gateway (src/kiro_crew/update_boot_apply.py:199). On the Electron side, a governed install never runs the arm on quit (website/electron/runtime/update/managed-lane.js:165, :194) and never adopts it (:228). Nothing applies it later, so the owner's click does nothing on every restart. The fix needs one apply path for the policy provider, which is a fair cost against a feature that never works for governed desktops.

F2: MEDIUM. Running work is lost without confirmation. useInstallDispatch.ts:42 goes straight to update:relaunch, which quits the app (website/electron/ipc-registrar.js:1015, managed-lane.js:512) without checking for running work. The PR already ships website/src/utils/workInFlight.ts, so the fix is a call to an existing check before relaunch. That is cheap.

F3: HIGH. An update the owner cancelled is installed anyway, and nothing on screen says so. managedInstall arms main and mirrors the arm to the gateway (managed-lane.js:483-494) but never sets adoptedFromGateway. So when the gateway reports a cancellation, the withdraw branch at :243 does not fire, and the quit handler applies the update (:200-202). The fix is small: mark the arm gateway-linked once the gateway accepts it.

[ADJUDICATION] 3dbc9db00247b8032687a5a88f10a9ec3ca07c95 total=3 uphold=3 downgrade=0
UPHOLD F1 src/kiro_crew/update_boot_apply.py:199 reason=harm-warrants-remedy
UPHOLD F2 website/src/hooks/useInstallDispatch.ts:42 reason=harm-warrants-remedy
UPHOLD F3 website/electron/runtime/update/managed-lane.js:243 reason=harm-warrants-remedy
[GPT-ADJUDICATED] 3dbc9db00247b8032687a5a88f10a9ec3ca07c95

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 3dbc9db00247b8032687a5a88f10a9ec3ca07c95 false-positive: <reason, 20 to 500 characters>

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