Skip to content

fix(kas): start an unpinned chat on kiro-cli's default model - #34146

Closed
bolichen97 wants to merge 1 commit into
mainfrom
fix/33023-kas-cli-default-model
Closed

bolichen97 wants to merge 1 commit into
mainfrom
fix/33023-kas-cli-default-model

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A KAS chat with no model pinned in Crew starts on the model kiro-cli's chat.defaultModel names, as the same chat does on kiro-cli.

kiro-cli starts a chat on its cli.json chat.defaultModel when nothing pins a model. KAS reads no cli.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

  • Sessions that do not take a chat's own start: a sub-agent sharing its parent's KAS process, a warm worker's fresh conversation (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).
  • A pinned chat whose pin is withheld (another harness's id, or one the account cannot run) keeps KAS's default, as before.
  • A warm-pool KAS process started in another folder reads that folder's workspace setting, not the claiming chat's.
  • kiro-cli, which reads the setting itself.

What changed (motivation → approach → change)

An unpinned KAS chat now starts on kiro-cli's chat.defaultModel when it names one. It used to start on KAS's default, because KAS reads no cli.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 through set_model and then puts the session's intent (_model) back, so only the model the session runs (_resolved_model_id) changes. ensure_served_default already moved a KAS session off an unlisted auto this way; it now calls the same method.

Chat on KAS Before After
nothing pinned, setting names a model KAS's default, plus a notice that model, still unpinned
same, KAS refuses that model KAS's default, plus a notice the model it was already serving, a log line
a model pinned the pin the pin; the setting is not read
restart of an unpinned chat KAS's default reads the setting again
a pick after the start a pin a pin

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 unchanged
Reader: 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 it
Reader: src/kiro_crew/acp/session_provider.py:AcpSessionProvider.kas_default_model_notice -- chat -- removed; its only reader was AcpProvider.kiro_cli_model_notice
Reader: 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.py

Tests

  • test_acp_provider.py::test_an_unpinned_kas_start_serves_kiro_cli_chat_default_model: an unpinned KAS start ("" or auto), new or resumed, reads the setting once for the session's folder and serves it through serve_unpinned; no setting, a pin, or the kiro backend serves nothing, and a pin still goes through set_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: an auto setting 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 deferred new_conversation row.
  • test_session_handle_bindings.py lists 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 -n0 and 10 times at -n 4 --dist loadgroup --max-worker-restart=2 beside test_kas_cli_settings.py and test_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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

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
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 9, 2026 21:57
@bolichen97
bolichen97 enabled auto-merge (squash) November 9, 2026 22:18
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 9, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

This PR and #34155 both fix #33023: an unpinned KAS chat starts on the kiro-cli chat.defaultModel without making it a pin. They change the same KAS cold-start branch in src/kiro_crew/providers/acp_runtime_start.py and share 10 files, including kas_cli_settings.py, session_handle_model_selection.py and session_provider.py.

Please keep one of #34146 and #34155 and close the other, carrying over anything only this one has.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 10, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Closing as superseded: #34155 already fixed this on main, so rebasing this PR would only redo merged work.

@bolichen97 bolichen97 closed this Nov 11, 2026
auto-merge was automatically disabled November 11, 2026 15:43

Pull request was closed

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 11, 2026
@bolichen97
bolichen97 deleted the fix/33023-kas-cli-default-model branch November 20, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KAS ignores kiro-cli's chat.defaultModel

2 participants