Repository navigation
feat(apps): per-app model setting under Settings → Chat → Model - #19507
Conversation
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS People can't tell "Inherit (claude-opus-5)" apart from "claude-opus-5" in the per-app picker, and the help text repeated on every row names things the user can't see. Watch
Suggestions
[UX-REVIEWED] 74b33b6 Description read[DESCRIPTION-READ] 8aef4eacbd1f72a373bf60d1bd41852e134e74075a039697195c5a6e575ac557 That sha256 names everything this verdict read: the PR description, plus the 11 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 Check that operators accept a set What this change shipsInventory (8 items) — 8 justifiedIntent: let a user pick, per app, which model that app's sessions and background agents start on, without changing the global default. This is an ADDITION, and every app defaults to Inherit.
[FIRST-PRINCIPLES-REVIEWED] 74b33b6 Description read[DESCRIPTION-READ] f510ddf6a1a256b7349050c4a6ee984cc1e62f839d0890b090f80db080d331c2 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the stored [DESIGN-REVIEWED] 74b33b6 Description read[DESCRIPTION-READ] 9b45dd181e51f34c1ef7757d318db8eb3119ee8d9f6892205560ab10e6a888d1 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: |
3e007ff to
bdf0601
Compare
bdf0601 to
976af30
Compare
|
UX Review, addressed on the new head: Evidence gaps. The PR body now has stills for:
"Inherit" doesn't say what it inherits. The option now names its source. It reads Inherit (<Default Model>), for example "Inherit (claude-opus-5)", or Inherit (auto) when the Default Model row is unset. A test pins both forms. The description is a long paragraph. The group description is now one line: "The model each app's sessions and background agents start on." The list of what still wins moved into each row's (i) hint, the same tooltip the sibling Subagent Model and fallback rows carry. There is a still of it open. Placement. Kept under Settings → Chat → Model:
|
976af30 to
cfdc818
Compare
|
Review findings, addressed on the new head: GPT 6.1 (blocking), autouse fixture on the shared Opus 5.5, the chip on an app-owned slot names the global default.
First Principles, Going through
The docstring of |
|
GPT 6.1 (blocking), the error notice had no hand-off decision. The Apps group's |
cfdc818 to
44be407
Compare
|
Advisory notes on Design Review: two precedence rules for one setting. Each path takes the agent tier of the session it actually starts, and that is what the issue's ruled design asks for. The per-app setting fills the chain right after the session's agent model (
Letting the per-app setting outrank the default crew's pin for chat sessions would reorder the ruled precedence (agent or crew above the per-app setting), so this PR does not do it. It is a reasonable follow-up decision for the issue owner, and so is a notice on the Apps group when the default crew pins a model. UX Review (CONCERNS). Taken as follow-ups, not changed here:
|
44be407 to
f06310e
Compare
|
Advisory notes on First Principles Review: the app-name grammar was written out twice. Fixed. The PATCH allowlist no longer has its own regex. It splits the path on Design Review: an app's spawn model beats UX Review (advisory), not changed in this PR:
|
e789606 to
057b2b3
Compare
36f1210 to
6c0a24d
Compare
|
Rebased onto current main; adapted 3 tests (and the matching docstring) to #18342's default-template change; no other change. |
iamwhatever
left a comment
There was a problem hiding this comment.
This PR adds an opt-in apps.<name>.model setting. It resolves after the agent/crew tiers and before the global default for app-owned chat turns and pre-warm, fills the model of app spawns that pick none, and gets a Settings → Chat → Model picker plus an app query on the resolved-model chip. The session side and the PATCH path (KEBAB_RE.fullmatch plus _validate_role_model entitlement) look correct, and I found no way to write outside apps.<kebab>.model. The spawn tier has one real defect, the GPT 6.1 finding on 6c0a24d, and it has no reply. resolve_app_spawn_model (src/kiro_crew/config/loader.py, the crew = config.agents.get(agent_name) branch) treats a same-named crew's pin as the spawn's agent tier and returns "". But spawn_sdk only spawns templates from list_agents(), _selection_kind reads an explicit agent as "template", and subagent_manager/run.py:2288 then passes crew_agent="", so resolve_crew_identity and session._session_model ignore that crew entirely. A user who sets a model for the app therefore gets the template pin, role_models.subagent or the global default whenever a crew shares the template's name, with no notice, and test_a_crew_pin_wins (resolve_app_spawn_model(cfg, APP, "default") == "") pins that wrong answer instead of the real spawn's. Fix: drop the same-name crew branch and check only the spawned template's own pin (_resolve_named_agent_model(agent_name)). Then change that test to assert the app pin, and add one that drives _spawn_effective_model(model, agent, crew_agent="") to show the spawn actually runs on the app's model. — crew-pr-reviewer (deep re-check)
An app's sessions and background spawns can start on a model the user chooses for that app. Unset or empty inherits, so nothing changes for anyone who does not set it. Precedence, highest first: the session's own pick, the app's own pick (Research campaign, Spec Builder default), the agent or crew pin, the per-app setting, the global default. The value is a model pin like the role-model pins: the Settings write validates it against the account, and the session layer withholds an id the account cannot run. Refs #4754
One picker per enabled app writes apps.<name>.model. Its Inherit option names the Default Model it falls back to, and each row's hint says what still wins. A retained pin the account stopped advertising stays shown. The composer chip asks the resolved-model endpoint with the slot's owning app, so an app session names the model it starts on. Strings in every locale; the model selection spec and the feature map name the new tier. Refs #4754
6c0a24d to
74b33b6
Compare
|
@iamwhatever thanks, the spawn tier was wrong. Addressed on A same-named crew hid the app's model from a spawn.
Show the spawn actually runs on the app's model. New Tests. Both tests fail without the code change ( Fold. The PR is at the two-commit cap, so the fix is folded into the second commit. The branch was also conflicting with main, so it is rebased onto |
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed at 74b33b6: no blocking defects found.
Problem / Motivation
Goal: Let a user choose, per app, the model that app's sessions and background agents start on, without touching the global default.
Today you can switch the model for one session from the composer. Research has a per-campaign model, and Spec Builder has a default model for new spec sessions. Every other app inherits the global default unless the user re-pins each session by hand. So there is no way to say "this app should use the strong model" or "this app should use the cheap one".
Why it matters
Users want a strong model for high-stakes app workflows and a cheaper one for routine app work. Without a per-app choice, they pay for the flagship everywhere or keep re-pinning sessions by hand.
Not a goal
modelTierwould resolve throughdecisions.model_route. That map is documented as the Auto router's tier models, so an operator who pinned thecomplextier would see app sessions silently move to that model. That changes a configured value's meaning and its cost.model.routeanddecisions.model_routeare untouched.What changed (motivation → approach → change)
The issue leaves open whether an app's preferred model is declared by the app author or chosen by the user. This PR takes the user-chosen setting:
Config.
apps.<name>.modelis a new top-level record map (AppSettingsConfig,model: str = "").workspaces/memory_stores.config-baseline.jsonis regenerated.Precedence, highest first:
Sessions.
resolve_effective_model(..., app_name=)gains the per-app tier after the agent/crew tiers. With noapp_namethe call is unchanged.slot._app), so non-app sessions never read the setting.modelrequest, which every inherited default already rides. The provider therefore withholds an id the account cannot run, exactly as today.App spawns. A spawn that passes no
modelgets the per-app setting, unless the spawned template pins its own model. A crew that shares the template's name does not count: an app spawn allocates the template with no crew, so its session never reads that crew's pin. Because it fills the spawn'smodel, a set value also outranksagent.role_models.subagentfor that app's spawns.Settings write. The config PATCH allowlist matches
apps.<kebab-name>.modelby the manifest name grammar, since apps install at runtime. It applies the same grammar and entitlement check as theagent.role_models.*pins, so a model the account cannot run is refused.Settings UI. An Apps group sits at the end of Settings → Chat → Model. There is no Apps tab in Settings, so the per-app rows sit with the other model defaults.
auto.Composer chip.
GET /api/agents/resolved-modeltakes an optionalapp: a kebab-case app name, and anything else is ignored. The composer passes the slot's owning app, so an app session's chip names the model the session starts on rather than the global default.Docs. The model-selection spec names the new tier, and the feature map's
chatrow lists it.Backwards compatibility
Compatible: the
appstable is new and empty by default. Every resolver call without an app name is unchanged, and an app with no setting resolves exactly as before.Removes nothing: the change only adds a config table, a resolver tier that is empty by default, a PATCH path and a Settings group; no key, path, validator or reader is narrowed or removed.
Tests
test/test_app_model_setting.py:"","auto"and an unknown app all read as inherit.""resolves exactly as without the setting, for the resolver, a real chat turn on an app-owned slot, the pre-warm path and an app spawn.modelrequest (not a slot pin)._spawn_effective_modelwith no crew) runs on the app's model.app, and ignores a value that is not an app name.website/src/pages/settings/AppModelsSection.test.tsx:Other test changes:
AcpAdapter.defaults.test.tsanduseChatPageComposerChips.test.tsxcover the chip passing the slot's owning app to the resolver, and passing none for a slot no app owns.Manual verification
Captured the built SPA with fixtures (screenshots below):
Locally, these pass on touched files:
Screenshots / video
Settings → Chat → Model → Apps. Meetings is pinned to a model, and the other enabled apps inherit the Default Model (named in the option). The disabled app Papyrus is not listed:
A row's picker: Inherit first, then the account's advertised models.
A row's (i) hint, naming what still wins over the setting:
Empty and error states
No enabled app:
The app list cannot be read:
A refused save. The row returns to its stored value, and the inline error names the app:
Composer chip in an app session. Both rows run the real composer-chip hook and the real
resolved-modelrequest. Meetings is set to claude-haiku-5 and the Default Model is claude-opus-5. The Meetings session asks withapp=meetings, so its chip names claude-haiku-5. An ordinary session asks with no app and still names claude-opus-5:Related Issues
Fixes #4754
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.