Repository navigation
feat(session-control): session_create takes a model for the new session - #14049
Conversation
|
Intent: let an agent choose the model a session starts on when it opens one with |
63158a5 to
cdcd75f
Compare
|
Rebased onto main 5bbc6f7 with no code change, to re-run the fork GPT/Opus review lanes: on the previous head (63158a5) they reported "could not run" after the CI app hit its installation API rate limit (Resolve desktop matrix logged |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify at merge time that main still needs the piggy-backed (I confirmed the carry-along fix is sound: base Suggestions
[DESIGN-REVIEWED] f7404f9 |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS No test pins the tool description's promise that an unservable-but-well-formed id is withheld at first turn with only a transcript notice — verify that fallback fires. What this change shipsInventory (7 items) — 6 justifiedIntent: let an agent pick the model a session it opens starts on (ADDITION, linked issue #14033).
[FIRST-PRINCIPLES-REVIEWED] f7404f9 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5 Review (fork) — ✅ no blocking findingsReviewed Review detailsNothing blocks — two advisory findings, both new prose asserting behaviour the code does not implement. FINDING — src/kiro_crew/dashboard/session_control.py:2309 — the comment says FINDING — src/kiro_crew/mcp_dashboard.py:477 — "an id from that same list, or 'auto'" promises parity with the session's model dropdown, but [OPUS-REVIEWED] c239240 |
cdcd75f to
2ced0b3
Compare
|
mechanism: redact() comparison before allocation in create_session
|
|
|
|
|
2ced0b3 to
16dd34a
Compare
16dd34a to
30c8385
Compare
d9ea711 to
fae5a01
Compare
|
Rebased onto main |
|
Head fae5a01: every check and both AI reviews are green except Backend Tests (Windows) (6), which failed on test_spawn_approval_channel_delivery_2381.py::test_an_authorized_destination_still_posts_through_the_transport_gate. This PR does not touch that file, and all 39 tests in it pass locally on this head. Could a maintainer re-run the failed jobs? As a fork contributor I can't. Thanks. |
fae5a01 to
819887a
Compare
|
Rebased onto main e4e6ed7 as 819887a with no code change, to re-run CI. The earlier ask for a maintainer re-run is withdrawn. The Windows shard 6 failure (test_spawn_approval_channel_delivery_2381.py, assert False is True) is in a file this PR does not touch, and it passes locally on the new head along with this PR's tests (428 passed). |
819887a to
c239240
Compare
|
New head f887d28. Main is red on test_review_repair_routing_skill.py (prepare-pr SKILL.md is 68015 bytes against a 68000 ceiling since #14181), so this PR now carries a one-line trim as a second commit; a rebase drops it if main gets its own fix. I also added the Goal line and Not a goal section that the PR template now requires. The Windows shard 5 failure (test_wake_judge_feedback.py) is in a file this PR does not touch. |
spawn_run and spawn_continue already take a per-run model, but session_create had no way to pick one, so a conductor opening worker sessions could not put them on a different model than the default. Add an optional model argument: held to the spawn_run model-id charset by the schema, refused with model_rejected by the same guard the dashboard model picker runs, pinned on the slot with the pick-generation bump a human pick gets, and recorded in the persist-at-birth metadata so an idle child keeps it across a restart.
kirodotdev#14181 left the skill at 68015 bytes, so test_slim_skills_do_not_regrow_duplicate_guidance_or_wire_model_ids fails on main. Drop the duplicate 'never edit the goal' clause; the frozen-goal paragraph already says only the user may edit it.
f887d28 to
f7404f9
Compare
Problem / Motivation
Goal: Let an agent choose the model a session starts on when it opens one with
session_create.An agent that opens a new session with
session_createcannot choose its model. The tool takestitle,agentandfolderonly, so every session it opens starts on the agent's or the global default. Subagents do not have this gap:spawn_runandspawn_continuealready takemodel.Why it matters
A conductor that fans work out to worker sessions has to leave them all on one model, or the person has to open each tab and change the dropdown by hand.
Not a goal
session_set_modeltool).[1m]ids; that check is shared withspawn_run,spawn_continueandcron_add.What changed (motivation → approach → change)
session_createtakes an optionalmodel. The new session starts pinned to it, the same way a person's pick in the model dropdown pins it.src/kiro_crew/validation.pySESSION_CREATE_SCHEMA.modeluses the same model-id pattern and length cap asspawn_run.modelsrc/kiro_crew/mcp_dashboard.py,dashboard/handlers/session_control.pymodeltoPOST /api/session-control/createonly when set, and its reply names the modeldashboard/session_control.pycreate_sessionrefuses withmodel_rejectedwhen the id is longer thanMAX_SHORT_STRINGor breaks_MODEL_NAME_RE(the HTTP route does not run the MCP schema, so the bound lives here), whenredact()would change the id (a credential-shaped value is never stored or broadcast) or when the picker's own_model_rejected_reasonrefuses it. It then setsslot.modeland bumps_model_pick_genas a human pick doesdashboard/session_control.pymodel, so an idle new session keeps it across a restartOmitting
modelbehaves exactly as before.session_forkstill takes no model override, because it copies the source session's model.src/kiro_crew/docs/session-control.mdand the owning specdocs/system-specs/modules/session-control.mddocument the new argument, its metadata field and its SEL detail. The tool description names no concrete model id. It states that an id the account cannot serve is accepted at create time and withheld at the session's first turn, which then runs on the account's default with a notice in that session's transcript.The second commit is a one-line main fix that this PR carries so its checks can pass. #14181 left
prepare-pr/SKILL.mdat 68015 bytes, over the 68000-byte ceiling intest_review_repair_routing_skill.py, so Backend Tests shard 3 fails on main. The commit drops the clause "never edit the goal" from the proportionality step, because the frozen-goal paragraph already says only the user may edit the goal. If main gets its own fix first, a rebase drops this commit.Backwards compatibility
Compatible:
modelis optional and omitted callers get the old behaviour and the old metadata line.Tests
test/test_session_control.py: a named model is pinned on the slot, bumps the pick generation, is returned, and is written to birth metadata. Omitting it leaves no pin and no metadata key. A model the picker guard rejects, and a credential-shaped id, each refuse the create withmodel_rejected, leave no slot behind, and the credential case does not echo the id. Route-level tests drivemodelthroughPOST /api/session-control/create: a valid id pins the created slot, and a bad-charset id comes back as amodel_rejectedrefusal. Over-length and bad-charset ids are refused in the core too.test/test_mcp_dashboard_folders.py: the tool forwardsmodelin the create payload, sends no key when it is omitted, and rejects a malformed id before any HTTP call.Manual verification
N/A: unit coverage exercises the tool, the route and the core; the model reaches the backend through the same
slot.modelpath the dropdown andsession_forkalready use.Screenshots / video
N/A: backend and MCP tool change only; no website/ files are touched.
Related Issues
Fixes #14033
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)