Repository navigation
fix(apps): run an app's own agent past a same-named checkout spec - #22915
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The guard's removal has a red-on-base test as provenance. The new KAS binding is a second session-keyed map that points at the same registered file the skill pin already holds. Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: let a palette-opened app agent run its own registered spec when the checkout has a same-named agent. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] c081dc6 Description read[DESCRIPTION-READ] 67fb73fe08a0e88155ef69409fc075e9226fa19a50ff8ecfba13b1f282c6cf4a That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the checkout scan is removed together with the bare-name resolution it guarded, and on KAS the turn's session is bound to the app's registered file before the session is claimed. Notes
[DESIGN-REVIEWED] c081dc6 Description read[DESCRIPTION-READ] 840b9fb923ad0a91fd11aeabc6e35867b496d4ca8ddfef750f7283e8de825ab0 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 |
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: |
e984e17 to
3fe2a1a
Compare
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
3fe2a1a to
887e278
Compare
887e278 to
3fbddba
Compare
|
[operator: bolichen97]
|
|
[operator: bolichen97] Two reds on the previous head 887e278 are main's, not this PR's:
The GPT security finding (span=4803882cd425) was fixed in code at 3fbddba, not overridden. |
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
|
[operator: bolichen97] Head 3fbddba: all four reds come from main, none from this PR.
Plan: no push for these reds. Once the card ratchet fix is on main, I rebase onto it, which also brings in #22951, and re-run CI. |
…p the checkout scan
3fbddba to
c081dc6
Compare
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
Problem / Motivation
Goal: A palette-opened app agent runs its app's registered spec on KAS and Kiro even when the checkout has an agent of the same name, instead of being refused.
Today a turn on a session a palette command opened for its app's own agent is refused when the checkout (or a fallback folder) holds a spec of the agent's bare name. That per-turn guard existed because the bare name used to decide which spec ran. On kiro-cli the turn now launches a Crew-written copy from an empty folder, and KAS resolves a user-level name before any checkout spec. So the guard refuses turns that would run the right spec. On KAS, the skill scope and injected prompt still read the agent by name, checkout first.
Why it matters
A user who opens an app command in a repository with its own
deployagent cannot run the app'sdeployagent at all. The maintainer ruling on #19323 kept the guard only until the launch copy was proven. That copy has merged, with the test that a checkout spec written between the check and the spawn is not the one launched.Not a goal
app_agent_refusedrow kind. It still carries the reserved-name, missing, ambiguous and backend refusals.What changed (motivation → approach → change)
The refusal only asked which spec the bare name resolves to, and neither allowed backend uses that answer any more. So
app_command_agent_refusalkeeps only the checks no checkout can fix: a reserved name, and the app's registered file being installed and the only user-level spec with that name. It takes no folders. The checkout scan, its fallback folder list and the helpers only that scan used are removed.So that no checkout spec sets anything on KAS, an admitted app-owned turn binds its session to the app's agent before the claim (
apps/agent_launch.py). Any other turn of that key removes the binding first, so a recreated or switched slot runs its own agent. The KAS projection of a bound session then reads the registered file by its path (acp/harness/kas.py). If that file is gone by then (the app was switched off after the check), the session is refused instead of falling back to the checkout's spec. The turn also pins its session's skill scope and injected prompt to that file on both backends (skill_scope_pin.py). Before, only kiro-cli turns did. The specs inapp-kit-platform.mdandacp-client.mddescribe the reduced check.Backwards compatibility
Compatible: every turn that ran before still runs, with the same spec. A turn that a checkout's same-named spec refused now runs the app's own registered spec.
Reader: src/kiro_crew/dashboard/chat_turn/turn_admission.py:_check_owner -- chat -- the only caller of
app_command_agent_refusal, updated to the two-argument form; test_app_command_agent_guard.pyReader: src/kiro_crew/agent_sdk/init.py:project_claims_agent_name -- chat -- its only non-test caller was the removed checkout scan (grep of origin/main across src/, website/ and app bundles); removed with it
Reader: src/kiro_crew/acp/managed_agent_shadow.py:project_claims_agent_name -- chat -- only called through the SDK wrapper above; the reserved-name gate keeps its own scan (
_project_agent_claim_refusal); test_managed_agent_shadow.pyReader: src/kiro_crew/dashboard/chat_turn/app_agent_binding.py:_app_agent_start_dirs -- chat -- only the removed scan read it; test_chat_runner_base_surface.py pins the module surface
Reader: src/kiro_crew/apps/manager_lookup.py:_same_dir_key -- chat -- only the removed home-folder exemption read it; test_manager_facade.py pins the facade
Reader: src/kiro_crew/dashboard/slot_persistence/metadata_codec.py:_read_app_agent_owner -- chat -- unchanged; persisted
app_agent_ownerstays<app>/<agent>; test_slot_metadata_codec.pyTests
test_a_checkout_spec_of_the_bare_name_neither_refuses_nor_scopes_the_turn[kiro|kas]: a checkout spec of the bare name, with its own grants and skills, sits in the session's project before the turn. The turn runs, the session is pinned to the registered file, andskill_search, dollar skills and the injected directory see only the app's skills. Red onorigin/main(both cases are refused there), green here.test_a_bound_session_whose_registered_file_is_gone_is_refused: the app's file is removed after the check, with a same-named checkout spec present. The KAS session is refused, and an unbound session still resolves the name.test_a_bound_session_projects_the_registered_fileandtest_a_binding_applies_only_to_the_agent_it_namespin the bound and other-agent cases.test_an_admitted_turn_binds_its_session_before_the_claimpins that an admitted turn binds before allocation and a refused one does not.test_a_turn_not_bound_to_the_app_drops_the_keys_bindingpins that a turn not bound to the app drops its key's binding and leaves other keys alone.test_a_checkout_spec_of_a_launch_name_does_not_refuse_the_turn: now runs the real check with the session in that checkout, instead of patching it.test_the_registered_unique_agent_is_allowed, plus the existing user-level, reserved-name and unregistered tests, call the two-argument check.Targeted runs: the app-agent and KAS test files plus related files (
-n 2, 1993 passed). isort, flake8, mypy and semgrep (diff-scoped) are clean.Manual verification
N/A - unit coverage sufficient: the turn harness runs the real admission path with a real checkout on disk, on both backends.
Related Issues
Refs #19323
Pattern harvest
Not generalizable: a guard retired after the mechanism it stood in for (the launch copy) merged with its proof test, as the ruling on #19323 planned.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)