Repository navigation
fix: show and refuse agent harnesses this host cannot sandbox - #34147
bolichen97 wants to merge 1 commit into
Conversation
Sensitive Change ReviewSensitive files changed:
|
82cea47 to
a445ede
Compare
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: |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: every save surface and the rows now read the launch's own predicate, the rendered evidence shows the refused rows, and the listed breaking change only refuses values that already failed every session start. Notes
[DESIGN-REVIEWED] 9d4b08f Description read[DESCRIPTION-READ] 4308795bb4d44527fe445cdfd534755f08f1ed7d5e7a3d143f65c23b4236c186 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) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. Both refusal states appear in the screenshots, in light and dark themes. The blind reader read the faded "Use … →" button as switched off. The pill and detail text are existing first-run setup strings, now reused here. Notes
[UX-REVIEWED] 9d4b08f Description read[DESCRIPTION-READ] df3d2261366c6ec88b800b719099fddb98aca7fa1df7fe120e0a5e30e8377cff That sha256 names everything this verdict read: the PR description, plus the 6 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 item traces to a refusal the launch already makes ( Notes
What this change shipsInventory (6 items) — 4 justifiedIntent: stop Settings and the save paths from accepting a harness every session start then refuses on this host. FIX.
[FIRST-PRINCIPLES-REVIEWED] 9d4b08f Description read[DESCRIPTION-READ] 156480f531602e4e3b445003c1db6a56fb30bcfd762e1f564e8f77f52b05825a 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: |
a445ede to
99e57ce
Compare
|
Rebased: main moved in website/src/pages/developer/AgentBackendTab.tsx, src/kiro_crew/dashboard/handlers/core_config_patch.py, src/kiro_crew/dashboard/handlers/core.py, src/kiro_crew/agent_sdk/tool_gate.py, src/kiro_crew/crewmate_harness.py, src/kiro_crew/dashboard/agent_admin/crew_update.py, website/src/api/acpBackend.ts, website/src/i18n/en.context.json and the three spec/feature-map docs since this head went green (69d3a9a -> 63b9e03); CI re-running. GitHub reported a merge conflict in AgentBackendTab.tsx: main's per-row screen-reader sentence (#33206) made [operator: bolichen97] |
buluoray
left a comment
There was a problem hiding this comment.
Request changes on 99e57ce. The product logic is still correct after the rebase. Two small fixes are needed before merge. A refused harness row still tells the user "New sessions switch from Kiro CLI to OpenAI Codex.", which can never happen on that host; the UX lane BLOCK on this point holds. Separately, the PR's +20 test lines push test/test_config_patch.py over the line cap on main, so both Ratchets lanes are red. Decisive lines: website/src/pages/developer/AgentBackendTab.tsx:1698-1705 (switch sentence still shown on a refused row), test/test_config_patch.py (2,016 lines once merged with main, over the 2,000-line cap)
99e57ce to
1d46ca1
Compare
|
Rebased: main moved in src/kiro_crew/dashboard/handlers/core_config_patch.py, src/kiro_crew/dashboard/handlers/core.py, test/test_config_patch.py, website/src/i18n/en.context.json and the three spec/feature-map docs since this head's CI ran (63b9e03 -> a0bf0ca); CI re-running. The rebase takes main's split of test/test_config_patch.py (#35214), which keeps that file under the 2,000-line cap with this PR's test in it (1,930 lines). It applied with no conflict, and the PR's own patch is unchanged apart from the fix answering the review on 99e57ce. [operator: bolichen97] |
[operator: bolichen97] |
|
[operator: bolichen97] @buluoray thanks, both are in 1d46ca1:
The Sensitive Change Review check still needs a maintainer's filled template in an Approve review on the new head. |
|
[operator: bolichen97] Rebased onto current main to resolve the merge conflict in docs/feature-map/README.md and website/src/pages/developer/AgentBackendTab.tsx. |
9c2a117 to
2f38d4c
Compare
|
Rebased: main moved in This head is rebased onto current main and resolves both merge conflicts. In the feature map it keeps main's text in the [operator: bolichen97] |
2f38d4c to
d06c164
Compare
|
[operator: bolichen97] The Backend Tests (3.12, 1) and Backend Tests (Windows) (4) reds on d06c164 are main's, not this PR's. The fix is #39479 (tracked in #39478 and #39487). This PR rebases onto it once it merges; no push and no override for these reds until then. Backend Tests (Windows) (5) failed on |
d06c164 to
f82ce16
Compare
|
Rebased: main moved in docs/feature-map/README.md, the agent host contract and crew mode specs, src/kiro_crew/crewmate_harness.py and website/src/i18n/en.context.json since this head's base (3b772f5 -> ae93f16); CI re-running. The reds on d06c164 came from main, not from this change: the module-cache reset ratchet flagged a tombstone-sweep memo with no per-test reset (Backend Tests 3.12 shard 1 and Windows shard 4; fixed on main by #39479), and a Windows-only watcher timing test timed out (Windows shard 5; fixed on main by #39545). Coverage Gate and PR Readiness only fold those shards. The patch itself is unchanged: the rebase moved context lines only. On the new head the related backend tests (1668) and the two Agent Harness frontend test files (90) pass, and type check, lint, formatting and the diff-scoped static analysis rules are clean. [operator: bolichen97] |
|
[operator: bolichen97] Sensitive change review
|
|
[operator: bolichen97] The Bundle Size Gate red on f82ce16 is main's, not this PR's. Main's own push run for ae93f16 (this head's base) fails the same check the same way: |
Settings > Agent Harness offered every enforced harness (Antigravity, Codex, Copilot, DeepSeek, Goose, MiMo Code, OpenCode, Pi, Strands) on hosts where the launch always refuses them, such as native Windows or agent.sandbox off, and saved the choice without a warning. Every later session then failed. The launch's refusal is now one shared predicate, tool_gate.sandbox_floor_refusal, read by each /api/acp-backends row (sandbox_refusal: host or setting), the agent.acp_backend PATCH and the crewmate harness pin. The page shows a refused row with first-run setup's badge and sentence for its cause and disables Use; the two saves refuse with the launch's own sentence. Closes #33728
|
Rebased: main moved in docs/feature-map/README.md, the agent host contract and crew mode specs, src/kiro_crew/crewmate_harness.py, test/test_crewmate_harness.py and website/src/i18n/en.context.json since this head's base (ae93f16 -> b85217a); CI re-running. The only red on f82ce16 was the Bundle Size Gate, and it was red on main too (a first-load chunk over its budget). Main's fix #39727 has merged, and this head sits on top of it. The patch is unchanged: the rebase moved context lines only, next to main's #38927, which made Pi a crewmate-capable harness. On this head's patch, on Ubuntu 24.04: all 66 local gates ran. The bundle-size gate is green (first load 9.26 MB of its 9.43 MB budget). The only two reds fail the same way on a clean main checkout: one auto-tier label ranking test, and the Electron shell tests on a machine without the Electron binary. The three changed backend test files (504 tests) and 18 Agent Harness and Settings frontend test files (633 tests) passed twice, the second run reordered. 3503 neighbouring backend tests passed, semgrep and the flake-pattern ratchet are clean, and the proof is still PROVEN. A smoke on a real gateway with [operator: bolichen97] |
|
[operator: bolichen97] Sensitive change review
|
f82ce16 to
9d4b08f
Compare
Problem / Motivation
Goal: Settings > Agent Harness says which harnesses this host cannot run and why, and neither that page, a config PATCH nor a crewmate harness pin can save one.
On native Windows (and on Linux or macOS with
agent.sandbox: "off"), Settings > Agent Harness offers Antigravity, Codex, Copilot, DeepSeek, Goose, MiMo Code, OpenCode, Pi and Strands as ordinary choices and saves them without a word. Every session started afterwards, crewmates pinned to that harness included, is then refused at launch withAcpToolGateUnroutable: ... cannot run on native Windows .... The user learns the choice was dead only after making it.Why it matters
Anyone on native Windows who tries a non-Kiro harness ends up with a gateway whose every new chat fails until they find the setting again. The refusal itself is correct; the page offering the choice is the bug.
Not a goal
agent.sandbox: "off"save while an enforced harness is selected. The row then shows the refusal and its reason.kirocrew config setand hand edits ofconfig.json. They write the file directly; the page then shows the stored harness as refused.spawn_run(backend=...). It is a one-off request, and its own launch already answers it with the same sentence.sandbox_blocked_backends.What changed (motivation → approach → change)
The launch refuses an enforced harness when its credential mask cannot be applied (
enforce_sandbox_floor). That check ran only at session start./api/acp-backendscomputed each row from build capability and policy alone, so the page, the PATCH allowlist and the crewmate pin check could not know.The fix gives that check one shared form and has every save surface read it, so they cannot disagree with the launch:
agent_sdk/tool_gate.pysandbox_floor_refusal(backend, mode)returns the sentenceenforce_sandbox_floorraises (or"");enforce_sandbox_floorraises itGET /api/acp-backendsrowsandbox_refusal:"host"(no sandbox backend, e.g. native Windows),"setting"(agent.sandboxleaves the host's sandbox off), or""website/src/api/client/config.tscarries the field,acpBackend.tsreads it as asandbox_refusedstate that blocks Use, andAgentStatusBadgetakes it asrefusedPATCH agent.acp_backendacp_backend_sandbox_refusedand the launch's sentencePUT /api/agents/{name},crewmate_harness.py)The row reuses first-run setup's translated strings, so no locale file changes; their translator context in
en.context.jsonnames both screens. Specs (agent-host-contract.md,crew-mode.md) and the feature map describe the new row field and refusals.Backwards compatibility
Breaking:
PATCH agent.acp_backendand a crewmateacp_backendpin now refuse an enforced harness whose credential mask cannot apply on this host. Every such value already made each session start fail. Writer sweep on origin/main @ b85217a:website/src/pages/developer/AgentBackendTab.tsx(patchMut): disables Use on that row first, so it never sends one.website/src/components/KiroPrerequisiteGate.tsx(configuredBackendCanStart): first-run setup already holds these back throughsandbox_blocked_backends.website/src/pages/members/CrewProfileSettings.tsx(harness pick): gets the 400invalid_acp_backendwith the launch's sentence instead of a stored pin that refused every session.website/src/components/allSettings/AllSettingsList.tsx(Settings > Advanced): writes noagent.acp_backendof its own; its row links to Settings > Agent Harness (_OWNING_PAGESinconfig_all_settings.py).Reader: src/kiro_crew/acp/launch.py:_sandbox_preflight -- chat -- unchanged:
enforce_sandbox_floorraises the same sentence throughsandbox_floor_refusal; test_acp_tool_gate.pyReader: src/kiro_crew/dashboard/agent_admin/crew_update.py:api_kirocrew_agent_update -- crew page --
"", KAS, Claude Code and a host that can sandbox still save; test_crewmate_harness.py::TestCrewmateHarnesses::test_the_save_accepts_exactly_the_offered_listReader: src/kiro_crew/dashboard/handlers/core_config_patch.py:api_kirocrew_config_patch -- chat -- every non-enforced harness and
""still save; test_config_patch.py::test_picking_kiro_cli_stores_kiro_and_the_response_says_kiroTests
test_config_patch.py::test_a_harness_the_launch_refuses_on_this_host_is_not_saved: the PATCH answers 409 with the launch's sentence and writes nothing.test_crewmate_harness.py::TestCrewmateHarnesses::test_a_harness_the_launch_refuses_on_this_host_is_not_saved: the crewmate pin is refused with the same sentence; KAS still saves. The neighbouring "save accepts exactly the offered list" test now pins a host that can sandbox, so it no longer depends on the test machine.test_agent_sdk_backend_install.py::...::test_the_status_row_says_when_the_launch_refuses_the_harness_here: the row says"host"or"setting"by the host's sandbox backend, and""for Kiro CLI; the pinned row shape carries the field.acpBackend.eligibility.test.ts:sandbox_refusedblocks Use and outranks a missing install and a failed check.AgentBackendTab.test.tsx: a refused row's Use is disabled, and each cause shows its own badge and sentence with no Check again and no "New sessions switch" line, even when the harness is not installed.Determinism: on Ubuntu 24.04 the three changed backend test files passed twice (504 tests, the second run in reversed file order on 3 workers), and the two changed frontend test files with sixteen neighbouring Agent Harness, Settings, Kiro account, Kiro sign-in, first-run setup and crewmate-profile test files passed twice (633 tests, the second run with
--sequence.shuffle).Proof: PROVEN test/test_agent_sdk_backend_install.py::TestEndpointPayloadShape::test_owner_gets_one_row_per_backend_in_the_pinned_shape (head d2ff40172fa1)
Manual verification
Ran on a Linux cloud host (Ubuntu 24.04) against an isolated gateway with
agent.sandbox: "off". On main, the rows carry nosandbox_refusalandPATCH agent.acp_backendtogooseanswers 200 and stores it. On this change:Captured Settings > Agent Harness from this change through the repo's capture entry (
website/capture/settings-agent-harness.html) on a Vite dev server, with fixture rows for both causes, and checked that Use is disabled in each. Not run on a native Windows host (none here): the Windows sentence is the launch's existing branch, and the PATCH and pin tests compare againstsandbox_floor_refusalwhichever branch the host takes.Screenshots / video
Native Windows (
sandbox_refusal: "host"): every enforced harness reads Host can't sandbox. OpenAI Codex is checked and not installed: the row shows why it cannot run instead of an install command, Use is disabled, and no "New sessions switch" line promises a switch.agent.sandbox: "off"on a host that has a sandbox (sandbox_refusal: "setting"): Sandbox turned off, with the setting's own sentence and a disabled Use.Dark theme
Related Issues
Closes #33728
Sibling sweep
Swept: git grep -nE "sandbox_blocked_backends|credential_mask_applies(" -- src/kiro_crew website/src
Sibling: src/kiro_crew/kiro_prerequisite_service.py -- not affected -- first-run setup already reads
credential_mask_appliesforsandbox_blocked_backendsbefore it offers a harnessSibling: src/kiro_crew/stt/codex.py -- not affected -- Codex dictation already checks
credential_mask_appliesbefore it offers itselfSibling: src/kiro_crew/dashboard/messaging_api/spawn.py -- not affected -- a spawn is a one-off request and its own launch answers it with the same sentence; nothing is saved to fail later
Pattern harvest
Rule candidate: review-prompt
Pattern: a refusal that only runs at launch, with a save path (settings page, PATCH, pin) that offers the same choice without asking it
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)