Repository navigation
fix(kas): start an unpinned chat on kiro-cli's default model - #34146
Closed
bolichen97 wants to merge 1 commit into
Closed
bolichen97 wants to merge 1 commit into
bolichen97 wants to merge 1 commit into
Conversation
kiro-cli starts a chat on its cli.json chat.defaultModel when nothing pins a model. KAS reads no cli.json, so a KAS chat with no model pinned in Crew started on KAS's own default, and only a notice named the setting. An unpinned KAS start or resume now reads the setting off the loop and serves it through a new handle method, serve_unpinned: set_model does the write, with the KAS spelling of the id, then the session's intent (_model) is put back, the same way ensure_served_default already moves a KAS session off an unlisted auto, which now shares the method. Only _resolved_model_id moves, so the session still reads as unpinned: a reasoning effort asked for with no pin binds to the served model, an engine-fallback promotion does not turn it into a pin, a restart reads the setting again, and an explicit pick afterwards is a pin as usual. The notice is removed, since the setting is now honoured. A sub-agent sharing its parent's KAS process, a warm worker's fresh conversation and a workflow per-step session do not take this start. Issue #33744 tracks them, with a strict xfail test for the fresh conversation. Closes #33023
bolichen97
enabled auto-merge (squash)
November 9, 2026 22:18
Collaborator
|
This PR and #34155 both fix #33023: an unpinned KAS chat starts on the kiro-cli Please keep one of #34146 and #34155 and close the other, carrying over anything only this one has. |
5 tasks done
Contributor
Author
|
[operator: bolichen97] Closing as superseded: #34155 already fixed this on main, so rebasing this PR would only redo merged work. |
auto-merge was automatically disabled
November 11, 2026 15:43
Pull request was closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem / Motivation
Goal: A KAS chat with no model pinned in Crew starts on the model kiro-cli's
chat.defaultModelnames, as the same chat does on kiro-cli.kiro-cli starts a chat on its
cli.jsonchat.defaultModelwhen nothing pins a model. KAS reads nocli.json, so on KAS that chat starts on KAS's own default model instead; today a start notice only names the setting and tells the user to pick the model by hand.Why it matters
Anyone who set a default model in kiro-cli and moves to the KAS engine gets a different model, with a different cost and quality, on every new unpinned chat, and has to pin it again in Crew to get back what kiro-cli gave them.
Not a goal
new_conversation) and a workflow run's per-step session still start on KAS's default (KAS sub-agent and fresh-conversation sessions ignore kiro-cli's chat.defaultModel #33744).What changed (motivation → approach → change)
An unpinned KAS chat now starts on kiro-cli's
chat.defaultModelwhen it names one. It used to start on KAS's default, because KAS reads nocli.json.The model must not become a pin. A pin changes how the rest of Crew treats the session: a reasoning effort asked for with no pin is dropped, an engine fallback overwrites the pin, and picking away and back reads wrong after a restart. So the start path reads the setting off the event loop and hands it to
AcpSessionHandle.serve_unpinned. That method switches the model throughset_modeland then puts the session's intent (_model) back, so only the model the session runs (_resolved_model_id) changes.ensure_served_defaultalready moved a KAS session off an unlistedautothis way; it now calls the same method.The start notice and its plumbing are removed, since the setting is now honoured. The acp-client and model-selection specs describe the new start.
Backwards compatibility
Compatible: a pinned chat and every kiro-cli chat start exactly as before; an unpinned KAS chat changes model only when the user's kiro-cli settings name one.
Reader: src/kiro_crew/dashboard/chat_turn/turn_spec_hooks.py:_notice_steer_upgrade -- chat -- no longer asks for
kiro_cli_model_notice; the other notice rows it reads are unchangedReader: src/kiro_crew/providers/acp.py:AcpProvider.kiro_cli_model_notice -- chat -- removed; its only reader was the row above, and
test/test_acp_bindings.py's inventory drops itReader: src/kiro_crew/acp/session_provider.py:AcpSessionProvider.kas_default_model_notice -- chat -- removed; its only reader was
AcpProvider.kiro_cli_model_noticeReader: src/kiro_crew/acp/kas_cli_settings.py:default_model_notice -- chat -- removed; its only caller was the KAS start path in
providers/acp_runtime_start.pyTests
test_acp_provider.py::test_an_unpinned_kas_start_serves_kiro_cli_chat_default_model: an unpinned KAS start (""orauto), new or resumed, reads the setting once for the session's folder and serves it throughserve_unpinned; no setting, a pin, or the kiro backend serves nothing, and a pin still goes throughset_model.test_kas_model_select_capture.py::test_a_served_kiro_cli_default_is_not_a_pin: a served setting goes out under the id KAS takes (_kas_model_spelling), the session still reads as unpinned, an engine-fallback promotion leaves it unpinned, and an explicit pick afterwards pins.test_kas_cli_settings.py::test_an_auto_default_model_reads_as_none: anautosetting reads as none (it replaces the two notice tests).test_acp_session_provider.py::test_an_unpinned_kas_reset_serves_kiro_cli_chat_default_model:xfail(strict=True, reason="GH #33744"), the deferrednew_conversationrow.test_session_handle_bindings.pylists the new handle member.Proof: PROVEN test/test_acp_bindings.py::test_the_member_set_is_the_frozen_inventory, test/test_session_handle_bindings.py::test_the_member_set_is_the_frozen_inventory (head 7c4972b)
Determinism: the six changed test targets (612 tests plus the strict xfail) ran 20 times at
-n0and 10 times at-n 4 --dist loadgroup --max-worker-restart=2besidetest_kas_cli_settings.pyandtest_kas_model_select_capture.py, all green; one shuffled order (seed 3572) passed.Manual verification
Not run against a live KAS engine; unit coverage drives the start path and the handle write. With KAS: set
"chat.defaultModel": "<a model id>"in~/.kiro/settings/cli.json, start a new chat with no model pinned on the KAS engine, and the model chip names that model; pick another model and back, restart, and the chat stays on the picked model.Screenshots / video
N/A: the diff touches no frontend file. The one visible difference is the one above: on an unpinned KAS chat with the setting, the model chip names the setting's model and the start notice that said KAS ignores it no longer appears.
Related Issues
Closes #33023
Follow-up: #33744
Sibling sweep
Swept: git grep -nE "create_session(|load_session(" -- src/kiro_crew
Sibling: src/kiro_crew/providers/acp_runtime_start.py:938 -- changed here
Sibling: src/kiro_crew/acp/session_provider.py:384 -- tracked in #33744
Sibling: src/kiro_crew/subagent_manager/run_start.py:459 -- tracked in #33744
Sibling: src/kiro_crew/session_allocation.py:919 -- tracked in #33744
Sibling: src/kiro_crew/acp/session_provider_mcp_reinject.py:158 -- not affected -- the reload keeps the model the KAS session already ran
Sibling: src/kiro_crew/connections/warm.py:1157 -- not affected -- a sign-in mint session that never runs a chat turn
Pattern harvest
Not generalizable: the defect is one setting KAS does not read; the fix reuses the existing intent-preserving write (
ensure_served_default) rather than a new kind of pin.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)