Skip to content

fix(release): backport four KAS, Claude-backend and sandbox fixes to 0.12.0 line - #31328

Merged
buluoray merged 4 commits into
release/0.12.0from
crew/slack/0.12.1-batch-6
Nov 6, 2026
Merged

buluoray merged 4 commits into
release/0.12.0from
crew/slack/0.12.1-batch-6

Conversation

@buluoray

@buluoray buluoray commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Bring four KAS, Claude-backend and sandbox fixes that merged on main after v0.12.0 onto release/0.12.0, one commit per fix, so the 0.12.1 patch ships them and each one can be reverted alone.

Why it matters

PR What a 0.12.0 user sees today
#30643 On KAS (the default backend), an MCP server that will not run is not named in the session notice, and a server's env and headers do not reach it when the session has no key yet.
#31064 Follow-up to #30643: without it, a plain http:// MCP server on another host with headers stops connecting through Crew's bridge. With it, it connects as before, and refusing it is an opt-in setting.
#30982 When Claude Code fails to start on the Claude backend, the chat loops on "Connection lost — retrying…" and ends on "Session stuck" instead of showing the error.
#30816 Sandboxed agent code can forge Dev Fleet's enablement file and start a pod, which runs outside the sandbox.

Not a goal

  • No fix that is not already merged on main; nothing is changed only here.
  • No version bump, no tag, no CHANGELOG.md change. Cutting v0.12.1-rc.N and the bare tag follow docs/build/release.md and stay with the maintainers.
  • No squash: a release line keeps one commit per fix, so any one of them can be reverted without the others.

What changed (motivation → approach → change)

Each main squash commit was cherry-picked with -x onto release/0.12.0 @ 982f542467, in this order, one commit each. All four applied clean. #30643 and #31064 travel together: #31064 is #30643's follow-up and restores plain-http header relay that #30643 alone would refuse.

# PR main commit release commit
1 #30643 name MCP servers KAS will not run, and relay env/headers without a session key 50ebe4221b 6eb5ea1351
2 #31064 relay plain-http mcp headers again unless the operator opts out f0d6dc0fc8 89c0c1a4b1
3 #30982 show a harness's own start error instead of a reconnect loop 312655623c 1f5a637e18
4 #30816 gate Dev Fleet pods on a sandbox-sealed host-exec grant 2406ca9013 f528cf34c0

Two Co-authored-by trailers named an internal address; they carry the same person's public noreply address here. No tree changed.

#30816 changes the Dev Fleet pod API's gate only: a pod starts when a gateway-written grant under a sealed directory exists, instead of when an agent-writable file says the app is enabled. #31064 changes kas_http_bridge.py's outbound opener and host check. Neither adds a listener, bind, route or auth path.

Backwards compatibility

Compatible: each change is the one already merged on main, and each PR's own compatibility note applies unchanged. #30816's own note applies: a Dev Fleet enabled before this version is re-enabled once so its grant is recorded, and the pod tool's refusal says so.

Removes nothing: no pick hides, deletes or renames anything 0.12.0 accepts beyond what its own main PR already reviewed.

Tests

Proof: not provable -- other: a backport of main commits whose proofs ran on their own PRs

  • CI does not run the backend suite on PRs into release/*, so the related set was run here: the test files this diff adds or changes, the test files that import a source module these picks touch, and for the widely imported chat_runner, config.sections, llm_helpers and apps.manager modules the tests that name the changed functions, plus the sandbox governance-mask and protected-name tests. 80 files, sequential batches of up to 20, one pytest process each, -n 0. 5128 passed. 2 tests fail, and both fail the same way on clean release/0.12.0 @ 982f542467, so neither comes from this diff: test_acp_harness_contract.py::test_a_missing_self_served_binary_names_its_install_command[copilot] and test_sandbox_governance_mask_model_loaders.py::TestASandboxedChildCannotMintAnAliasOfASealedLoaderFile::test_the_backend_denies_both_destinations.
  • flake8 and isort pass on every changed Python file, scripts/check_black_formatting.py passes, and mypy passes on the 21 changed source files.

Manual verification

N/A - every pick was verified on its own main PR. The 0.12.1 RC soak is the end-to-end check.

Related Issues

Backport of #30643, #31064, #30982 and #30816 to the 0.12 line for 0.12.1. Source issues: #30630, #30444, #30811.

Sibling sweep

Siblings: none -- each source PR carried its own sibling sweep; this PR only carries those fixes unchanged.

Pattern harvest

Not generalizable: this PR only carries four fixes already on main. Each source PR has its own harvest.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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.

iamwhatever and others added 4 commits November 6, 2026 09:43
…thout a session key (#30643)

- Bridge a remote server only when KAS itself would accept its url (https,
  or http to a loopback host, normalised as KAS's URL parser does). A plain
  http url to another host is named in the session notice instead of being
  bridged with its headers in cleartext.
- A plain-http (loopback) bridge ignores environment proxies, so its headers
  never reach an http_proxy in cleartext.
- In MCP registry mode, the notice names each server Crew withholds, and
  Crew's own servers, which KAS drops when the Kiro profile is
  registry-governed.
- A session batch with no session key yet (background or pooled runtime)
  names its launch snapshots with a random key, so stdio env and
  streamable-HTTP headers still reach the server.
- Move two config reads out of kas_agents.py for its line cap.

Fixes #30630

Co-authored-by: Joe Guo <12429733+iamwhatever@users.noreply.github.com>
(cherry picked from commit 50ebe42)
… out (#31064)

#30643 stopped bridging an MCP server's headers to a plain http:// url
on another host. That setup connected through Crew's bridge before, so
it is restored by default, and the refusal moves behind
agent.kas_refuse_plain_http_mcp_headers (off). The bridge bypasses
environment proxies only for a loopback host, so a remote http server
keeps its proxy route. The loopback host reading moves to the
standard-library bridge, without a regex, so both sides share it.

(cherry picked from commit f0d6dc0)
…op (#30982)

When Claude Code fails to start, the claude adapter answers with a
-32603 frame saying "Claude Code process exited with code 1". The chat
runner matched "process exited" in that text and treated it as the
agent process dying, so every turn re-queued behind "Connection lost -
retrying..." until "Session stuck", and the adapter's own error never
reached the user.

A process that answered a request is alive. acp_error_is_pipe_death now
reads only the client's own death wording on an AcpError with no
JSON-RPC code, and the dashboard turn uses it in both places it decides
pipe death. The answered error now ends on the error card with its text.

(cherry picked from commit 3126556)
Dev Fleet runs worktree code outside the agent sandbox (a pod). The gate read
apps/dev-fleet/installed.json, under the agent-writable, renamable apps/dev-fleet
directory, so a sandboxed shell could forge enabled:true and start a pod outside
the jail.

Authorize pods on a gateway-written marker under a top-level sealed, pre-created,
strict-no-follow host-exec-grants/ directory the sandbox cannot rename or symlink
around. The owner-authenticated enable_app writes the marker for the app it
enables (fresh and already-enabled paths); it is never derived from the
enablement record. Every disable path revokes it and fails closed if it survives.
The helpers are generic (no app id in core); only the pod gate reads dev-fleet's.

Co-authored-by: Joe Guo <12429733+iamwhatever@users.noreply.github.com>
(cherry picked from commit 2406ca9)
@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 6, 2026 10:11
@buluoray
buluoray requested review from Zedmor and removed request for a team November 6, 2026 10:11
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/sandbox_leaves.py

  • src/kiro_crew/sandbox_precreate.py

  • @buluoray posted a complete reasoning template for f528cf3.

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

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision f528cf34c0b6b098c5fbf7a2cb5f0ad2858b3be8 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of f528cf34c0b6b098c5fbf7a2cb5f0ad2858b3be8 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: these are four clean cherry-picks of fixes already merged on main, one commit each, with no code changed only on the release line.

Notes

  • After the upgrade, a Dev Fleet that was enabled before it cannot start a pod until it is re-enabled, because the new grant does not exist yet. The description already says so. Make sure the 0.12.1 release notes tell users about this one-time re-enable.

[DESIGN-REVIEWED] f528cf3

Description read

[DESCRIPTION-READ] c004c0376489dfea518259158d8c7731e396ffcebd3e36d47d91f6466c0c7b3f

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of f528cf34c0b6b098c5fbf7a2cb5f0ad2858b3be8 — 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

Nothing blocks: this backports four fixes already merged on main. Each has a linked issue (#30630, #30444, #30811), the new config key defaults off, and the deleted env-stripping pin is reversed on purpose and declared.

What this change ships

Inventory (7 items) — 7 justified

Intent: ship four KAS, Claude-backend and sandbox fixes already merged on main in 0.12.1, one revertible commit each. This is a FIX.

  1. The KAS session notice now names an MCP server that will not run, and why. — justified
  2. On KAS, a stdio server's env reaches it through Crew's local launcher even before a session key exists. — justified
  3. A plain-http MCP server on another host keeps getting its headers through the bridge. — justified
  4. New key agent.kas_refuse_plain_http_mcp_headers (default false) refuses those headers. — justified
  5. When the Claude backend fails to start, the chat shows the harness's start error instead of "Connection lost — retrying…" and "Session stuck". — justified
  6. A Dev Fleet pod now starts only on a gateway-written grant in the new sealed host-exec-grants/ directory, not on the agent-writable installed.json. — justified
  7. A Dev Fleet enabled before this version must be re-enabled once so its grant is recorded. — justified

[FIRST-PRINCIPLES-REVIEWED] f528cf3

Description read

[DESCRIPTION-READ] a97abe37a5c5f3501afa31a855fc7c55cc0f9ebd3b4d0d919bbf8a6b3526ee1c

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.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of f528cf34c0b6b098c5fbf7a2cb5f0ad2858b3be8 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f528cf3

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

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed f528cf34c0b6b098c5fbf7a2cb5f0ad2858b3be8 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] f528cf3

Verdict parsed from the review's SHA-scoped output markers for commit f528cf34c0b6b098c5fbf7a2cb5f0ad2858b3be8.

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

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@buluoray

buluoray commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: f528cf3
  • What rule changed: No new rule on this branch. fix: seal the Dev Fleet enablement record read-only in the sandbox #30816 (2406ca9013 -> f528cf34c0), cherry-picked clean, adds one crew-home leaf, host-exec-grants/, to the sandbox's READ-ONLY sealed leaves (sandbox_leaves.py) and pre-creates it (sandbox_precreate.py), so the seal exists from first start. The Dev Fleet pod gate now reads a gateway-written grant marker there instead of apps/dev-fleet/installed.json.
  • Before -> after (what was allowed/blocked, now): Before, sandboxed code could rename apps/dev-fleet aside and plant a forged enabled: true, and the pod gate would start a pod whose code runs outside the sandbox. After, the gate reads only host-exec-grants/, a top-level crew-home directory sealed read-only for sandboxed code and written only by the gateway on an owner enable; an empty or absent directory means no app is granted.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): A Dev Fleet enabled before this version refuses pod tools until it is re-enabled once (the refusal text says so). The directory is read-only, not hidden, and holds no secret, only which app is host-exec-enabled. Nothing is widened; the change fails closed.
  • Evidence checked (which sandbox result proves it): test_host_exec_grants.py, test_dev_fleet_pod_agent_api.py, test_sandbox_governance_mask.py and test_sandbox_protected_name_holds.py pass on this head (single process, -n 0); the governance-mask pin keeps the new leaf inside the three dispositions.
  • No regression:
    • Tools still work (which tools/commands were run, result): 80 related test files, 5128 passed; the 2 failures fail the same way on clean release/0.12.0 @ 982f542.
    • Backward compatible (old config / old data / old callers still work, how checked): fix: seal the Dev Fleet enablement record read-only in the sandbox #30816's own note applies: a prior Dev Fleet enable is re-recorded by enabling it once; no other app, config or stored data changes.
    • Existing tests (which suites passed on this head): above, plus flake8, isort, the black gate and mypy (21 changed source files) clean.
  • How to undo: Revert commit f528cf34c0 (fix: seal the Dev Fleet enablement record read-only in the sandbox #30816) on release/0.12.0; it is its own commit.

@buluoray
buluoray merged commit e652b27 into release/0.12.0 Nov 6, 2026
20 of 23 checks passed
@buluoray
buluoray deleted the crew/slack/0.12.1-batch-6 branch November 6, 2026 14:24
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 6, 2026
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