Repository navigation
fix: 0.13 backport batch 2, part 1 (line-budget rows, #31606, 0.13 feature follow-ups) - #37413
Conversation
(cherry picked from commit 06111a2)
…t holds (( (#31606) * fix(security): read << inside arithmetic as a shift, not a heredoc * fix(security): read a closed arithmetic shift as data in the heredoc reader In heredoc mode with tracking on, read_commands follows each $((...)) / ((...)) span in its one pass. A << inside the span is held as a heredoc until the span closes with )) on that line; then it is a shift, so no body follows and a wipe on the next line is read as a command. A span that closes as subshells or is still open at the newline reads exactly as on main. The rm floor joins this reading with its untracked one, so it only adds refusals; rm_floor.py and the default reading are unchanged. Deep nesting stays linear. --------- Co-authored-by: Zejiang Guo <zejiangg@amazon.com> Co-authored-by: Ray Xu <buluoray@gmail.com> (cherry picked from commit b12ad9c)
Sensitive Change ReviewSensitive files changed:
How to clear this check:
Only the author's comment counts this way. A reviewer can instead |
Design Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)Design-level review of Design-Verdict: PASS cannot evaluate: missing screenshots of the new vault picker on the browser card, the MCP folder-use question, and the paused sidebar filter chip. This revision adds these surfaces on BlockersNew user-visible surfaces with no rendered evidence of this revision
Notes
[DESIGN-REVIEWED] 0409e6b Description read[DESCRIPTION-READ] bb9b2a35aafcd31d73c38df0ca3241cb792427bd42af6e5a407c620f083db873 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 |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing screenshots of the new UI this PR adds. The description says "this PR adds no UI of its own," but the diff adds visible controls and copy. The blind read was not performed. Evidence gaps
Notes
[UX-REVIEWED] 0409e6b Description read[DESCRIPTION-READ] 0e97f669cb8b5075b0f49a9d4d3402139d08bf1e9f21e1430e6dff2659f3180d That sha256 names everything this verdict read: the PR description, plus the 3 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 Every pick is a cherry-pick of a main change, and each one closes a named gap in a 0.13 feature. The product-shape picks are covered by base RFCs that are not drafts: drift-check Notes
What this change shipsInventory (10 items) — 8 justifiedIntent: give 0.13 users the main follow-ups that 0.13 features need to feel finished. A FIX/backport.
[FIRST-PRINCIPLES-REVIEWED] 0409e6b Description read[DESCRIPTION-READ] 80d2eea48ee3bc8ec7f74ddc7ea36dda5ccf2ec177d65653d2f38238fdf4128c That sha256 names the PR description this verdict read. Recompute it with |
Security Scope Review -- ✅ PASSWhich legitimate operations does Verdict basis: adjudicated, zero confirmed regressions. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: PASS Reason: The only shell-gate change is the shared reader TIGHTENING: the recursive-force ADJUDICATED: 23 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: posix (18 rows). The diff assumes bash's arithmetic and heredoc grammar. The rows test that grammar's edges: a shift then a scoped UNADJUDICATED: The s3 download exemption, [SCOPE-REVIEWED] 0409e6b |
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: |
Opus 5.5 Review — 🔴 changes requested (blocking)Reviewed The security package's line budget now has 36 lines of headroom that no change accounts for. BLOCKING — test/security_line_budget/rm-floor-arithmetic-shift.txt:1 [BLOCK-MERGE] 2073ea3 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Unchain the one chained ternary the module detector reports in agent_sdk/ (the exact-or-case-folded server name in mcp_problems.mcp_server_state) into if/elif/else, and flatten the four-deep name/entry filter in mcp_json_reach.mcp_json_server_names with a continue. Fix comments and docstrings that say something the code does not: backend_identity says the public build refuses acp_backend "claude" (it is baseline-selectable) and lists three backend ids; provider_identity calls the "acp" provider the kiro-cli-and-KAS family and names acp_backends as a stdlib-only link in an import chain it is not part of; backends_members says deepseek has no mirror, leaves mimocode, goose, deepseek and pi out of the client-path member lists, and says KAS's session array comes from _mirrored_session_mcp (only codex's does); mcp_problems names two of the five unattended runs that wait on declared MCP servers and one of the two surfaces that print the not-ready note, and mcp_json_reach calls that wait "the cron wait". Drop a tracker id and the "as before" / "today's" narration from the edited docstrings, keeping the reason the Tool Search entry sends no empty neverDefer list. No behaviour change: every changed file except mcp_problems.py and mcp_json_reach.py is AST-identical to its base once docstrings and comments are dropped, and the two rewritten conditionals are equivalent for every input. (cherry picked from commit 2ea45a8)
Behind the secrets_vault preview, a credentials quick ask offers the vault logins for the page's base domain (eTLD+1 from the bundled Public Suffix List; exact host and port where there is none; never an https login on an http page) by name. A click fills the login through the same bound, re-verified fill a typed answer takes, read in the gateway only. With no match the card offers an off-by-default Save to vault; after a fill lands the typed login is stored as a new item under a free name. The agent's ask op and outcome words do not change, and no value or username reaches the agent, a log, the SEL or the replay. Adds publicsuffixlist==1.1.2.20261109 (MPL-2.0) as a runtime dependency. Co-authored-by: CrysisDeu <crysisdeu@users.noreply.github.com> (cherry picked from commit 0711f58)
… servers (#36462) * refactor: keep the process adapter for the session and ask it for mcp servers Steps 1 and 2 of issue #35740. No harness changes behaviour. AcpClient now keeps the ProcessAdapter that process_adapter_for builds for the spawn (_process_adapter), from before resolve_spawn runs until _reset_state drops it. Before this change the adapter was a local that was dropped after the spawn, so the opencode and MiMo Code launches wrote what their config read-back found onto the client as ten _opencode_* / _mimocode_* fields. Those facts now live on the adapter, in one HarnessReadBack dataclass (denies_in_force, denies_unenforced, native_mounts, config_mcp_servers, disabled_servers). Every reader goes through one accessor, AcpClient._harness_read_back, which returns an empty read-back when no adapter is kept. The two places in client_mcp_array.py that picked the opencode or MiMo Code field by backend become one read each. ProcessAdapter gains session_mcp_servers(session), whose default adds no server. The opencode, MiMo Code, goose, DeepSeek, Copilot and pi adapters override it to call the client method that exists today, and those client methods keep their names. The six per-harness lines at each of the three session/new and session/load sites in client_start.py become one call to _adapter_session_mcp_servers. A client that reaches those sites without having spawned asks a fresh adapter for its backend, so it gets the same list as before. The Claude lines and the kiro-cli arm are unchanged. The H6 splice test now pins the adapter splice plus claude's, and a new test pins that each adapter asks only its own client hook. * test: pin a late mimo code permission event after a reset _reset_state drops the MCP array cache and the process adapter together. A MiMo Code permission request that arrives after that still asks which servers the session placed, so the array resolves cold with no adapter kept, and the projection records disabled_servers on an empty read-back that nothing reads. The test answers the same placed and foreign servers before and after the reset. It passes on main and on this branch, and it fails with a RuntimeError against a read-back accessor that refuses the write when no adapter is kept. (cherry picked from commit 9b4805e)
The notification bridge already delivers a routed channel's notes, the pending tool-approval note included, to the owner's DM on Discord, Telegram and Webex, but Feishu was in neither of its transport lists, so an owner reachable only on Feishu heard nothing while an approval waited. Feishu joins BRIDGE_TRANSPORTS and TRANSPORT_SINKS and the Deliver to row gets its label. It is served by the same TransportBridgeSink and owner-DM leg as the other transports, so routing, governance, rate limit, redaction and the single allow-listed owner rule are unchanged. It stays out of REPLY_TRANSPORTS: answering from Feishu needs an inbound reply reader and is tracked separately. Closes #32130 (cherry picked from commit 1438766)
* feat(relay): send profileArn on lease renew and release for a personal Crew A personal relay Crew's host signs in to the lease service as its owner, and the service needs the owner's profile ARN on RenewCrewLease and ReleaseCrewInstanceLease to tie the lease to that profile. LeaseHostTokenSource takes an optional profile_arn reader. With a reader, both calls append profileArn as the last body key. Headers are unchanged: an IAM Identity Center sign-in still sends no TokenType and an outside identity provider still sends EXTERNAL_IDP. A reader that returns nothing or raises sends today's body and logs one INFO line with no value in it. A team Crew on a crew API key cannot take a reader. Nothing passes a reader yet, so every existing config sends byte for byte the same requests. The host never calls VerifyCrewConfig. Tests pin today's renew and release bytes for a team Crew on API_KEY and for the default config, and cover the profile ARN for both sign-in kinds, the no-ARN case, and that no ARN or credential reaches the logs. * feat(relay): host a personal Crew with its owner's Kiro sign-in A personal Crew's host leases with its owner's own Kiro sign-in, IAM Identity Center or an organization's identity provider, not a key, and the lease service needs that sign-in's profile ARN on each call. tunnel.relay_lease_credential takes a new value, kiro-sign-in. With it, the lease client reads the Crew's sign-in for each renew and release through KasAuthProvider, as the relay viewer does, so the token is refreshed near its end. After an HTTP 401 the one retry refreshes the refused token; a second 401 stops, as today. The sign-in's auth method names the TokenType, and its profile ARN goes on the same call through the profile ARN reader. A token type set beside kiro-sign-in keeps Remote Control from starting. Builder ID, social and a sign-in with no profile are refused before any request, with a message that names what to sign in with and what to sign out of. Every sign-in failure backs off and reads again, so signing in again resumes hosting without a restart. No message carries a token, a refresh token or the profile ARN. Every other value (secret://NAME, a file, a team Crew's API key) sends today's requests and never loads the sign-in module, and nothing dials unless Remote Control is on. The settings text, the config baseline and the platform spec say so. (cherry picked from commit ea6253e)
…36336) The notification bridge lets the owner answer a bridged tool approval by replying approve or deny on Telegram and Discord. Webex is now the third reply transport (B4g): a bound approval note posted to the owner's Webex DM shows what the call will run and how to answer, and the owner's reply in that note's thread settles the same decision. Webex has no quoted reply, so a reply is a message whose parentId names the note. The bridge addresses the owner's DM by email, so the note is linked under the email and a reply is looked up under its sender's personEmail, only in a direct room; the owner is that email against the one configured owner DM, the identity the email allow-list already authorizes on. The shared reader decides and audits the answer under the same rules as the other reply transports. A stop, a message with a file or a card press is never an answer, and since a thread stays open after the answer, only an exact approve or deny in it is taken: every other message in the thread goes to the turn path as before. The note is sized to one Webex message in UTF-8 bytes. (cherry picked from commit 02a5f9e)
* relay viewer: send profileArn when opening a personal relay Crew The control plane needs the owner's profile ARN on CreateCrewAccessToken to open a personal Crew. The viewer now reads the profile ARN the Kiro sign-in stored, next to its bearer and token type, and adds profileArn to the mint body only when the Crew list marked that endpoint crewType PERSONAL and the sign-in has a profile. Every other mint sends the same body as before, so a team Crew's request is unchanged. ListCrewEndpoints is unchanged. A personal Crew with no profile in the sign-in is minted as before, with one INFO line that carries no token or ARN value. The test credential carries no profile. * test(relay): accept profile_arn in the executor test's mint fake (cherry picked from commit ba3a1ca)
…36658) `record_person_steer_result` commits the `steer` event (`apply_person_steer`) and then appends its `work/recorded` crew-log entry, undoing the event when the append does not land -- but it ran that commit-then-record sequence bare, inside the board lock. A cancellation (gateway shutdown) landing between the commit and the append left the steer event in the cache with no crew-log entry and no undo, so the Board and sidebar showed an answered steer that the next `work_ledger_rebuild` silently dropped, and callers reported `not_recorded` while the cache said otherwise. Wrap the commit-and-record block in a nested coroutine and drive it through `_drain_before_cancelling`, the same way the worker-report route and the conductor write path already do: once the event commits, the append (or the restore) finishes before the cancellation is re-raised. Pre-commit reads and refusals are unchanged. (cherry picked from commit 7009e5c)
…e Kiro sign-in card (#36595) The card said only "Signed in with Google". It now names the account (email, else account name) read from the top bar usage reading, but only while the saved main harness is KAS: on any other harness that reading names kiro-cli's login, not the sign-in this card manages. A sign-in, a sign-out or a main-harness switch now drops that reading with the model list, so the card never names the previous login until the next poll. An e-mail follows the account popup's hide toggle (hidden by default), read through usePersistedBool in both places so they live-sync. Open, the card shows it blurred beside the same Show/Hide e-mail toggle the popup has; folded, it names the account only when it is visible. Fixes #36156 (cherry picked from commit c114ed9)
…e run (phase 3b, #1643) (#36717) * feat(tracing): workflow, phase and outcome spans; completion joins the run (#1643) Phase 3b of the native tracing RFC. A workflow run is now one trace, as one more run kind of the 3a surface root helper (TRIGGER_WORKFLOW): WorkflowRunner.run opens a "workflow <name>" anchor around the whole run and ends it with "workflow outcome <status>" and the spend roll-up. Each ctx.phase() is a "phase <title>" span from its phase_started event to the next phase or the run's end, with its own roll-up. A phase that a parallel branch closes while another branch's call under it still runs is exported once that call is released, so its roll-up keeps the call's spend. Each live ctx.agent() call is one turn under its phase, named "invoke_agent <phase>:<label>", with a turn id derived from the run and agent id, so running the same run again rebuilds the same tree. A call replayed from a prior run streams no turn, so a resumed run emits no span for it. run_background pins the turn that launched the run, and the completion turn the dashboard starts joins the run's trace under its root and links to that launcher, whether it starts at once or drains from the queue (meta.workflow_run_id). A retry of that turn carries the same meta, so it joins the same run. phase_started gains phase_index (the phase's 1-based ordinal), and agent_started gains the index of the phase its call ran in, so a consumer never recounts phases. * fix(tracing): trace a workflow's authoring turn under its phase A run started from an intent authors its script in a task the runner starts for the author. A turn root bound by the runner's own task is refused there, so the authoring turns rooted unrelated traces, the Authoring phase had no model children and the outcome understated the run's spend. The author task now binds its own call under the Authoring phase and releases it when authoring ends. The two fixed sleeps in the workflow tracing tests are replaced with event barriers (await_until, until_parked), and the dashboard composition pins gain the workflow auto-turn's lazy tracing import and its extra_meta argument. --------- Co-authored-by: Kyle Seaman <kseam@dev-dsk-kseam-1b-55230d27.us-east-1.amazon.com> (cherry picked from commit 875b273)
… project folder (#36277) A routed MCP server runs in one fixed folder outside the session sandbox, shared by every chat, so a server that works on the project's files answered every worktree from the wrong folder. Nothing can tell from a server's config whether it uses the folder, so MCP Management now asks. - mcp_gateway.cwd_use records the answer per server (uses_cwd / not_used; absent is unanswered). - POST /api/mcp-gateway/servers/stub refuses stub=true (cwd_unconfirmed) for a server that is not Kiro Crew's own and is not answered not_used. That route is the only writer of launch approvals, and the rewriter wraps a server only for an approved launch, so an unanswered server never gets a live stub on kiro-cli or KAS. - The routed-set resolver drops a server answered uses_cwd. - A server routed before the question keeps running until answered; its row asks once. - The dashboard asks in plain words with an example, and "Not sure" counts as "it uses the folder", the safe choice. Co-authored-by: Joe Guo <zejiangg@amazon.com> (cherry picked from commit 538bad7)
An agent's ask_question card with one single-select question can be answered from Slack's buttons (B4e). The reply transports (Telegram, Discord, Webex) now answer it too (B4g): the bridged note shows the card's options numbered from 1 inside the same code fence an approval's command sits in, and the owner's reply with a number answers the card exactly as the dashboard would for that option. The question binds for the same owner an approval does (Slack's, else a reply transport's owner DM). The registry now records what a binding decides, so the shared reply reader reads a question reply as the number of an offered option and an approval reply exactly as before, and tells the owner which kind of answer it expects. On Webex, whose thread stays open, a question's thread takes only a number and an approval's only approve or deny. (cherry picked from commit c917dfc)
2073ea3 to
0409e6b
Compare
|
span=0281f47ded8c
|
|
span=92e0b48751fc
|
Problem / Motivation
Goal: Ship in 0.13 the fixes and small completions that a 0.13 feature needs to feel done, so no 0.13 user has to wait for 0.14 for them.
Backport batch 2, part 1, onto
release/0.13.0(headb91bc876264, after batch 1). The rule for this batch: a feature that is new in 0.13 (merged to main before the 0.13 cut ata29fcc3c2e6b, not in 0.12) gets the later main changes without which a 0.13 user would hit a pit or find it unfinished. The PR also carries the security line-budget row files (#37239) first, so later security picks bring their own row instead of editing a constant.One commit per pick, each made with
git cherry-pick -xin main's merge order. All applied with no conflict; nothing was hand-resolved.06111a27b684test/security_line_budget/, so security picks stop conflicting on one constant. Test-only.b12ad9c367f4x=$((1<<2)). It brings its own budget row (heredoc-reader-arithmetic-shift.txt,+36), as on main.2ea45a8e545f0711f587095f9b4805e93e5414387662489dea6253ef01c7701e45f1249902a5f9ef50ceapproveordeny.ba3a1caec32767014fc3b6fa875b273f12a9c917dfc31f90bcb94e5c4ee67009e5cd3d41c114ed9012d8538bad7fc752Each prerequisite is a fix from main with its own tests, and none changes behaviour beyond what its own PR describes. Without it, the pick it is needed by conflicts on code it added.
Why it matters
0.12.2 was the last 0.12 release, so 0.13 is the next release users get. Each of these 0.13 features would ship with a known gap that only 0.14 closes: a personal relay Crew that cannot be opened or hosted, bridged notes that cannot be answered on Webex or by number, Feishu owners left out, traces with missing spans, and a vault the browser card cannot use.
Not a goal
What changed (motivation → approach → change)
Cherry-picks only. No hunk was hand-resolved and no line is new.
Backwards compatibility
Compatible. Each pick behaves as it does on main, where it was reviewed. #36248 adds the
publicsuffixlist==1.1.2.20261109dependency tosetup.cfg, as on main. Nothing is removed: no key, path or record.Tests
Test changes come from the picks.
Release PRs get no backend test lanes in CI, so the backend tests ran locally on this head, on top of batch 1: one pytest process per batch of 20 files, no xdist. The run covered 323 test files (every test file the picks touch, plus every test file that imports a module they change): 16,089 passed, 61 failed. None comes from this PR:
test_browser_quick_ask_vault.py(21): this test machine's venv lackspublicsuffixlist, which feat(browser): sign in from the secrets vault on the live card #36248 adds. With the pinned version on the path, all 32 pass.test_agent_refactor_contracts.py(36): fails only when it shares a batch with other files; run alone, all 68 pass.test_folder_steering_provider_dedup.py,test_kas_cli_floor.py,test_worker_agent_spawn_gate.py(4): fail the same way on a cleanrelease/0.13.0and on a cleanmainlocally, while main's CI is green.test_security_gate_liveness.pypasses with the cap equal to the measured package size (36,250 + the one +36 row = 36,286, no spare room);test_shell_commands_reader.pyandtest_shell_heredoc_reader.pypass.Frontend on this head:
tsc -p tsconfig.app.jsonclean,scripts/check-i18n-keys.mjsOK, the 16 vitest files the picks touch pass. flake8 and black on every Python file in the diff: clean.Manual verification
N/A. Unit coverage above; the same changes are on main.
Screenshots / video
Why no screenshot: this PR adds no UI of its own; each frontend change is a cherry-pick of a main PR that carried its own review evidence on main.
Related Issues
Backport of the main PRs listed above. Follows #37389.
Sibling sweep
Siblings: none -- the backport touches the same sites the picked PRs changed on main
Pattern harvest
Not generalizable: backport of already-reviewed changes
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...). A backport batch keeps one commit per pick.Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.