Repository navigation
fix: backport four user-reported KAS and MCP fixes to 0.12.1 (batch 28) - #32174
Conversation
A KAS session is handed a custom agent's own prompt on its wire definition, and the runtime records that text in the session's native documents. The session-start [AGENT SYSTEM PROMPT] block repeated it, so the persona reached the model twice. The block is now withheld when it would repeat that recorded text word for word; any other text, and the turn after a compaction, keep it. The record is written only where KAS is known to apply the prompt: a relay kiro-cli at or above the release floor. Crew's bundled engine and an older or unreadable release record nothing, so the block stays. Part of #13305 (cherry picked from commit 568b039) Release backport: docs/architecture/context-management.md conflicted in one table row; resolved by keeping release's text and adding this change's clause. Code and tests applied unchanged. Original author: Bolin Chen (#31875).
An MCP server whose env holds ${NAME} or ${env:NAME} for a variable
the gateway does not have starts with the literal text as that value.
The usual cause is an app opened from Finder or the Dock: it inherits
launchd's environment and never reads the shell profile that exports
the token, so the server answers every call with an authorization
error and nothing in the session says why.
At session start, beside the remote-header secret:// guard it mirrors,
mcp_ref_guard.warn_unset_env_placeholders names each such stdio server
and variable in one log line and on the session's MCP problem summary.
Names only, never a value: a reference that is not a plain identifier,
such as ${NAME:-default}, is skipped. The server still starts as
before, so the names-only summary a spawned run's prompt gets leaves
the entry out. Each server is judged against the environment that
expands it: the kiro-cli child's scrubbed environment for a spec
server kiro-cli starts itself, the routed path's placeholder view for
every other. Both composition sites, AcpClient and AcpRuntime, call
it.
The macOS troubleshooting guide gains a section on the symptom, how to
spot it, and the two routes that supply the value whatever the launch
path: the vault with a routed server, or the data home's .env file.
The owning spec in docs/architecture/mcp.md records the check, and the
two descriptions of ACP_BACKENDS_SPEC_SERVERS_OFF_WIRE name it as a
reader.
Closes #4970
(cherry picked from commit 2c8e9aa)
An app agent that lists @kirocrew-computer timed out KAS readiness while computer use was off: the app-agent copier read the managed server's invocation directly and skipped its spec_gate, so kiro-cli spawned a backend that advertised no tools. Both copier paths now resolve through managed_mcp_spec_entry with include_opt_in=True, so a gate-closed server is not copied and an opt-in server an app agent names still is. The computer-use enable flip re-materializes every enabled app's agents, each under its app lifecycle lock, so app agents follow the flip without a restart. Builds on #26325 by christopher-h-johnson. (cherry picked from commit e37780d)
POST /api/mcp/toggle writes a mute into the kiro global or the crew store, never into an agent file it does not own. The rewriter's wrap guard read only the entry in front of it, so an agent-declared server muted in a scope was wrapped into a broker stub. The KAS projection subtracts a stubbed name before its own scope check (#30924) runs, so the session-level stub started the server the user turned off. mcp_cleanup.mcp_scope_muted_aliases is the scope half of mcp_server_muted_in_any_store, read once per rewrite pass. The per-agent wrap guard, the settings injection and the crewmate half skip a name it holds, and withdrawn_worker_stubs withdraws one. The set is fingerprinted (schema 13), so a mute saved in the crew store, which the fingerprint did not sign, cannot be served from a cached overlay. On a pass whose settings file cannot be signed the set is held only to "no new mute", since that file is one of the scopes. Closes #31115 Co-authored-by: Raymond Chen <chenmingwei23@users.noreply.github.com> (cherry picked from commit 25a74e8)
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: these are four clean backports of fixes already merged on Notes
[DESIGN-REVIEWED] aa1a4dc Description read[DESCRIPTION-READ] 2d5b43f72d2d244ba458deaa9dda24a3d227eb74568cc3d87588bd2d22544198 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Each of the four picks is a fix already merged on What this change shipsInventory (8 items) — 8 justifiedIntent: give 0.12.x users four user-reported KAS and MCP fixes from
[FIRST-PRINCIPLES-REVIEWED] aa1a4dc Description read[DESCRIPTION-READ] 46d3b9196fb11e94747c4f18356cf14a4cef73e223ef60d6aa5dce269e271469 That sha256 names the PR description this verdict read. 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: |
Problem / Motivation
Goal: Bring four user-reported KAS and MCP fixes that merged on
mainafterv0.12.0ontorelease/0.12.0, one commit per fix, in a PR of their own so they can be reviewed and reverted apart from the low-risk batches.Why it matters
${VAR}env placeholders on MCP servers in~/.kiro/settings/mcp.jsonare reported as never expanded; this fix names a placeholder that will not resolve.@kirocrew-computertimes out KAS readiness when computer use is off.Not a goal
main; nothing is changed only here.CHANGELOG.mdchange. Cuttingv0.12.1-rc.Nand the bare tag follow docs/build/release.md and stay with the maintainers.What changed (motivation → approach → change)
Each main squash commit was cherry-picked with
-xontorelease/0.12.0@4d9f6b123e, in merge order, one commit each.568b039b3c60c325a0782c8e9aa07024662bfd24e37780db6323b2c755d725a74e8c5eaa1a4dcd99The one hand-resolved hunk is documentation. In #31875,
docs/architecture/context-management.mdconflicted in one table row. It was resolved by keeping this branch's text and adding #31875's clause about a KAS session start. Every other file in #31875, and every file in the other three picks, has added and removed lines identical to its main commit. Because of the resolved hunk, #31875's commit is authored with the public identity the push guard requires and names Bolin Chen as the original author in its message; the other three keep their original authors.builder-security checked: no pick changes a bind, a listener, a route, an auth check, an ingress rule or a storage grant. #31513 changes which MCP servers the MCP gateway wraps, so a server a config scope mutes is not started; it adds no new endpoint.
Backwards compatibility
Compatible: each change is the one already merged on
main, and each PR's own compatibility note applies unchanged.Removes nothing: no pick hides, deletes or renames anything 0.12.0 accepts.
Tests
Proof: not provable -- other: a backport of main commits whose proofs ran on their own PRs
release/*, so the related set was run here: every touched test file plus every test file that imports a touched module, 164 files, one pytest process per batch of 20,-n 0. 8122 passed. 3 failed, and all 3 fail the same way on a cleanrelease/0.12.0checkout:test_acp_launch_goldens.py::test_the_client_launch_hands_child_env_defaults_to_kiro_cli_alone[copilot],test_acp_launch_goldens.py::test_the_launch_of_every_known_harness_matches_the_golden[copilot]andtest_harness_parity.py::test_is_kiro_cli_is_positive.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.
Screenshots / video
Why no screenshot: backend-only change.
Related Issues
Backport to the 0.12 line for 0.12.1 of #31875, #31562, #31337 and #31513. Source issues: #13305, #4970, #26315, #30920, #31115.
Sibling sweep
Siblings: none -- each source PR carried its own sibling sweep; this PR only carries those fixes.
Pattern harvest
Not generalizable: this PR only carries fixes already on
main. Each source PR has its own harvest.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.