Repository navigation
fix(agents): let an installed agent become the default agent (release/0.8.0) - #16385
Conversation
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the fidelity claim: the picks' patch-ids match main's sources (#12686, 4a11ed2, 4576a29) — every shape judgment here inherits from main's review. Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: On release/0.8.0, let a crewmate bound to an installed agent's file name run, and let the picker's "Set as default" work on an installed template — a FIX (backport of five main-merged PRs).
[FIRST-PRINCIPLES-REVIEWED] 5452868 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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 (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the squashed commit's loader/handler hunks against main's post-#16512 state — patch-id covers only the two clean picks, the rest is author-asserted. Suggestions
[DESIGN-REVIEWED] 5452868 |
Opus 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: |
3a91c2a to
d194276
Compare
d194276 to
70752bc
Compare
70752bc to
b91911b
Compare
Co-authored-by: Premshay <28099628+Premshay@users.noreply.github.com> (cherry picked from commit fa1b47d)
…/0.8.0) Backport of #16323, #16410, #16455, #16512 to release/0.8.0, cherry-picked in main's merge order. * fix(agents): let an installed agent become the default agent (#16323) (cherry picked from commit 5c6268a) Backport adaptation: test/integration/conftest.py conflicted only on context; the source's added reset lines (config_loader import, docstring bullet, the three _MATERIALIZED_* resets and checks) were applied, nothing else. Every other file applied cleanly. * fix(agents): reset a default agent only when its template was removed (#16410) (cherry picked from commit f16fa23) Backport adaptation: test/integration/conftest.py conflicted on context only (a main-only updates-loop entry next to it); only this change's _MATERIALIZED_SEEN lines were applied. Every other file applied cleanly. * fix(agents): harden the default-agent healer and the file-name map (#16455) (cherry picked from commit 4a11ed2) * fix(agents): heal a default agent only after a scan that read every spec (#16512) (cherry picked from commit 4576a29)
b91911b to
5452868
Compare
Problem / Motivation
Goal: on release/0.8.0, a crewmate bound to an installed agent's file name runs, and an installed agent can become the default, without the healer that comes with that change overwriting a default the owner chose.
Both defects are present at the release/0.8.0 tip:
<Package>-<agent>.jsondeclaring"name": "<agent>", and kiro-cli lists agents by declared name only. A crewmate whosekiro_agentrecorded the file name fails closed on every turn with "Agent mode ... is not available".default_agent_not_alias.Why it matters
The first defect fails every turn for the crewmates it hits. The second makes a visible picker action fail every time.
Not a goal
What changed (motivation → approach → change)
Backport of #12686, #16323, #16410, #16455 and #16512 to release/0.8.0, in main's merge order, as two commits (the PR Hygiene cap). Each commit is grouped by author and carries every source's
-xline.fix(catalog): restore companion runtime_policy on member rows(fix(catalog): restore companion runtime_policy on member rows #12686), a clean pick whose patch-id matches the source. It is fix(agents): let an installed agent become the default agent #16323's prerequisite: an optionalProviderRegistry.agent_runtime_policyseam, emitted on owner-visible member rows. The public edition returnsNone, so its rows are unchanged.PUT /api/config/default-agentenrolls a user-level installed template as an alias in the same locked write that sets the default. Lineage is read strictly, a template an alias already runs makes that alias the default, and the enrollment is SEL-logged.default.~/.kiro/agentsalone. A project checkout's own spec and an edition-contributed agent both dispatch without a file there, so their defaults were reset at every boot and refresh. It now acts only on a name a landed snapshot in this process declared and the current one does not, and never on a name the edition supplies.config.jsonwrite for any caller. It now heals only on the owner's own fetch.refresh_materialized_agentsdefaults toheal_default=False, and only the owner's catalog fetch passesTrue.dispatch_kiro_agentnever stem-maps a name the edition contributes._MATERIALIZED_SEENand_MATERIALIZED_STEMSare bounded where they are kept (4096 entries, 256 characters per name). The oldest stale removals are evicted first, and one aggregate warning is written only when the drop count changes.agent_runtime_policydocstring and its spec row name the key as the dispatched agent.test/integration/conftest.pyconflicted on context only, both times, because main has an unrelated updates-loop entry beside these lines. Only these changes'_MATERIALIZED_*lines were applied. For every other file, the added and removed lines are identical to the sources'.Backwards compatibility
default_agenton the owner's own catalog fetch, after a template a running gateway saw is removed. App disable and template delete record the removal, and the owner's next picker open heals it.Tests
Regression proof on this branch: each pick's source files are reverted to their state before it, and the tests are kept.
test_agent_execution_catalog.py.test_config_api.py,test_config_loader.py,test_agent_execution_catalog.py,test_dashboard_state_ws.pyandtest_memory_smoke.py._MATERIALIZED_SEENso the test setup imports.#16323 has little bake time on main, so the suite run here is wide. It covers every test file referencing the changed modules: agent handlers and catalog, config loader, session agent selection, execution context, admission gate, default-agent, the materialized snapshot and the healer (252 files). It also covers all of
test/integration. Result: 17776 passed, 36 skipped. The failures (2 to 5 per run) are intest_acp_runtime.pyandtest_subagent_shared_scratch.py. They fail the same way under xdist on the untouched release/0.8.0 tip, pass in isolation, and neither file is touched here.Gates:
src/kiro_crewreports no issues (1863 files).session_agent_selection.pyoffender that is already present at the release/0.8.0 tip, and no new edge on added lines.Manual verification
N/A. The tests drive the real default-agent route, the real catalog route, and the real loader over real agent files and
config.json.Related Issues
Backport of #12686, #16323, #16410, #16455 and #16512 (#16409).
Pattern harvest
Not generalizable: these are backports, and each source PR carries its own harvest.
Checklist